Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
ECE 445 Senior Design
Fall 2015
Please, No Pictures!
Final Report
Yogesh Karwal, Thomas Rosengrant Project No. 5
TA: Ankit Jain
December 9, 2015
ii
Abstract
The premise of our project is to help prevent embarrassing moments from getting caught on film. We
wanted to achieve this by creating a device that would block ones face from being captured by a
camera. The device would detect a camera flash, process the flash, and then output a flash. The camera
would capture the image but the face of the subject would be “flashed out” and the identity of the user
would be preserved. The device would also be able to prevent false flash detection by counting the
duration of the flash. If flash is too long then the device would not output a flash. Another way the
device prevents false flash detection is by collecting luminous data from the environment and
comparing it to the detected flash. In this paper we will discuss and detail our triumphs and pitfalls of
this project.
iii
Contents
1.0 Introduction ............................................................................................................................................ 1
1.1 Block Diagram ..................................................................................................................................... 1
2.0 Design ...................................................................................................................................................... 2
2.1 Detection Circuit ................................................................................................................................. 2
2.2 Processing Block .................................................................................................................................. 3
2.3 Output Block ....................................................................................................................................... 4
2.4 Power Block......................................................................................................................................... 5
3.0 Design Verification .................................................................................................................................. 6
3.1 Detection Block ................................................................................................................................... 6
3.2 Processing Block .................................................................................................................................. 6
3.3 Output Block ....................................................................................................................................... 6
3.4 Power Block......................................................................................................................................... 6
4.0 Cost Analysis ........................................................................................................................................... 7
4.1 Labor ................................................................................................................................................... 7
4.2 Parts .................................................................................................................................................... 7
4.3 Grand Total ......................................................................................................................................... 7
5.0 Conclusion ............................................................................................................................................... 8
5.1 Accomplishments ................................................................................................................................ 8
5.2 Uncertainties ....................................................................................................................................... 8
5.3 Ethical considerations ......................................................................................................................... 8
5.4 Future work ......................................................................................................................................... 8
References .................................................................................................................................................... 9
Appendix A Requirement and Verification Table ................................................................................... 10
1
1.0 Introduction Every so often people are captured at their worst by a camera. It’s always the embarrassing moments
that you wish no one saw. That same picture ends up circulating on social media for everyone to see.
Celebrities are always facing the wrath of social media when the new scandalous or embarrassing
pictures find their way online curtesy of paparazzi. Whether it’s your great aunt, or a future employer
that picture ends up in front of their screens and your image is tainted forever. This is where our project
comes in. Our project is a device that people can use to prevent embarrassing pictures from being taken.
The way we approached this project was by creating a hat that housed all of the components of device.
The construction of our device is broken down into 4 parts: detection, processing, output, and power.
We utilized concepts learned in programming, circuits, and logic courses and apply them to our project.
Finally we used logic reduction and creation techniques to produce our final project. In depth
description and functionality of each part is talked about later in the paper.
1.1 Block Diagram We broke this project into four distinct blocks. In Figure 1 (below) you see them put into a flow chart.
Figure 1: This is our block diagram. The black lines indicate data transfer and the red lines indicate data transfer.
2
2.0 Design
2.1 Detection Circuit The detection block gathers luminous data from the environment and then sends a signal to the
processing block. A photodiode is able to detect the amount of light is in a room and output a
proportional voltage. When the photodiode was illuminated by flash, the output voltage was in the
range of 25 mV. This voltage is not a workable voltage since it is much too small. This is why obtained
voltage from photodiode is then amplified using operational amplifier, op-amp for short. The op-amp
uses a very large resistor to amplify the input voltage. This resistor is represented by R1 in Figure 2 and
has a value of 8.7 MΩ. After amplification the voltage was in the range of 1.9 – 3 V. This amplified
voltage is then compared by a comparing circuit. The comparing circuit is the first step in determining
whether the detected light is a flash or not. The comparing circuit utilized the same op-amp used earlier
and a 10K potentiometer to create a threshold voltage. This threshold voltage value is the value just
under the voltage level of a flash. If a flash is detected and it goes higher than the threshold voltage,
then the op-amp outputs a signal the processing circuit.
Figure 2: This is our final Detection Circuit design that we put into operation.
3
2.2 Processing Block The processing block calculates the duration of the signal from detection circuit and decides whether
the signal is camera flash. It also takes information from an ambient sensor that detects current light
levels in the environment. We gathered that most cameras have a flash time of 3ms. The signal from the
detection circuit needs to have duration of 3ms. To calculate the duration we used an AVR
microcontroller and used an Arduino to program it. The code counts the duration of signal, then if the
signal is 3ms in length the microcontroller outputs a signal for 10ms. If the duration is longer that 3ms,
then the microcontroller does not output anything. The signal from the microcontroller is then sent to
the output circuit. Figure 3 shows the pin layout of our processing unit. The biggest part of the
processing block is the calculations have to happen really quickly so the output circuit can output
properly. Below in Figure 4 shows an example output of the microcontroller when there is a flash
detected by the detection circuit. The signal is low for about 3ms; this is when the calculation happens.
The signal then goes high for about 10ms; this is the signal going into the output circuit.
Figure 3: This is the pin layout of our microcontroller.
4
Figure 4: Example output of our microcontroller.
2.3 Output Block The output block is what sends the flash needed to void ones face from the picture. The circuit starts out
by charging two capacitors to about 5 – 6 V. This is how much voltage our device works on, and will be
discussed further in our power block. Once both of the capacitors are charge the circuit then waits for
the signal from the microcontroller. Upon receiving the signal from the microcontroller, a switch is
triggered and discharges capacitor C1 as shown in Figure 4. C1 discharges to a transformer. This
transformer steps up the 5 V to 340 V. The reason we step up the voltage is the xenon flash tube we use
require 340 V to ionize the xenon gas inside the flash tube. Once that voltage is stepped up it feeds into
the xenon flash tube. The gas becomes ionized meaning it becomes conductive and allows for current to
flow through it. The ionized gas completes a series circuit with capacitor C2. With the complete circuit,
C2 then discharges and energy get dissipated in the flash tube which creates the flash. Since the time
constants are so small for each of the capacitors are so small the charging and discharging happens
within milliseconds. Time constant equation is shows below in equation (1).
𝜏𝑐 = 𝑅𝐶 (1)
5
Figure 5: This is our output circuit. This is where the flash happens.
2.4 Power Block The power block consisted of a large heavy duty 6 V battery. This 6 V was connected everywhere Vcc
shows up in Figures 2, 3, and 4. The battery needed to not only supply enough voltage but also enough
current to power everything.
6
3.0 Design Verification This is a summary of our Requirements and Verification Table. Appendix A contains our complete
Requirements and Verifications table.
3.1 Detection Block The detection block needed to provide a signal in which the processing block would interpret as a high
signal or low signal. The AVR Microcontroller’s datasheet detailed a VIN low signal of 0.75 V ± 0.75 V and
a VIN high signal of 4 V ± 1 V [1]. Our output to the detection block needed to be within these levels. To
test that we were within these requirements we chose to send a constant optical signal in to our light
sensor and then with a DC multi-meter to measure the voltage. Additionally we kept the sensor in the
dark and then measured the voltage coming out of the detection block with a DC multi-meter.
3.2 Processing Block Our processing block had a requirement to respond within 3ms ±1ms of detecting a flash. We also
required it to output a 10ms pulse after counting for a constant 3ms input. To verify we sent a 2ms pulse
with a pulse width generator and tested the output with an LED. If the LED light up then then the
microcontroller would fail this requirement. We also set the pulse generator to output a pulse of 3ms
and 6ms and with both pulses we saw the LED light up and the oscilloscope displayed a constant 10ms
pulse as shown in Figure 4.
3.3 Output Block The output block was required to flash when the input was set to a high level or 4 V ± 1 V [1]. So to
verify this requirement we would send a 10ms pulse into the circuit and check to see if the flash tube
flashed.
3.4 Power Block The power block was required to supply enough power to all our components. We tested and verified
this by measuring the terminals of the battery with a multi-meter. Battery should read 6 V ± 1.5 V.
7
4.0 Cost Analysis
4.1 Labor Table 1: Labor Cost
Name Hourly Rate Total Hours Invested Total = Hourly Rate x 2.5 x Total hours
invested
Thomas $28.00 222.5 $15,575.00
Yogesh $28.00 222.5 $15,575.00
Total 445 $31,150.00
4.2 Parts Table 2: Parts List and Cost
Item Part Number Vendor Quantity Cost
Fashionable Hat Fedora Macy’s 1 $30
Photodiodes 720-BPX61 Mouser 4 $11.10
Batteries 6V Battery ECE Store 1 $5
Flash Tubes XFTA-55-230 XenonFlashTubes 3 $0
Comparator TI-LM339ADR Mouser 1 $4
AVR microcontroller ATMega328P-PU Mouser 2 $10
Resistors Various Mouser 25 $5
Potentiometer Various Mouser 5 $5
Op-Amp LM741 Mouser 6 $8
Total $78.10
4.3 Grand Total Table 3: Total Cost
Cost Category Total
Labor $31,150.00
Parts $78.10
Grand Total $31,28.10
8
5.0 Conclusion
5.1 Accomplishments We had gotten three of our four blocks completely working. The detection, processing, and power block
all functioned the way needed to and we were able to verify functionality based on our R&V table. We
not only got those blocks working but we also learned a lot about team work, scheduling, time
management, cost analysis, and company proprietary. We both were attending different courses so our
schedules were quite different. So working around scheduling was a challenge that we overcame. This
was accomplished by communicating ahead of time to each other.
5.2 Uncertainties Towards the end of the project we had a few issues with the flash tubes we were provided with [2]. The
supplier did not send voltage or current specification for the flash tubes. We tried multiple times to
contact the company but we seemed to have been ignored. We did a few days of research and finally
discovered that we needed a voltage of over 300V to get the Xenon Bulb to flash and then supply a high
current to keep it light up for the 10ms pulse we required. This resulted in us not being able to complete
our output circuit. Another short coming we had was the comparator we had planned to use. The chip
ended up shorting on us and we were not able use it. This prompted us to design a new comparing
circuit as shown in Figure 2. Lastly, our microcontroller we originally ordered was a really old model. We
were not able to program the chip since the programmer needed was very outdated. However, we did
manage to find the AVR microcontroller in time and programmed it properly.
5.3 Ethical considerations We wanted to be honest in our dealings with this project. We did not purposely create false data. We
also considered power requirements as heat could be an issue with high power products. There is an
unsafe aspect of our project. The flash bulbs need 340 V to flash. 340 V is quite a large voltage and could
burn you if came into contact. It is our responsibility that the circuit components are properly insulated
to prevent injury and potential combustion.
5.4 Future work We did not finish the output block so at first this would be the first thing to consider when dealing with
in future work. Also we wanted to consider ways to put it not only in hats but other carrier mediums like
jewelry or scarfs. We also could revise our processing code to not immediately output another pulse
directly after a pulse was just noticed on the same input. This way it would allow for a resting period on
a specific output to charge up effectively. Even though newer cameras do have burst mode where
pictures are repeatedly taken one after another, there really is not a flash to detect in those cases. Also
supplementary testing on different lenses to bring further distance detection capabilities is another area
of work we would do. This would increase the quality of the product significantly.
9
References
[1] Mouser Electronics Inc., website, Available at: http://www.mouser.com/. Accessed Aug. 2015.
[2] XenonFlashTubes Inc., website, Available at: http://www.xenonflashtubes.com/. Accessed Oct.
2015.
10
Appendix A Requirement and Verification Table
Requirement Verification Points
1. Detection
a. Outputs voltage signal equal
to the supply voltage of the
comparator if a flash is
detected (4V ± 1V). Else
provides a ground signal
(0.75V ±0.75V).
1. Detection
a. Probe output node with O-Scope to
measure voltage when light is
shining on light sensor.
b. Probe output node with O-Scope to
measure voltage when light is not
shining on light sensor.
30
2. Processing
a. Measures the length of light
pulse and determines
whether to send a signal to
output light in the proper
direction. Send 3ms and
6ms high input and measure
with o-scope a 10ms output
pulse of (4V ±1V.)
b. Send a 2ms pulse and
should only be (0.75V
±0.75V) constantly.
c. Set the ambient input on the
microcontroller to high and
then should see no pulse
(0.75V ±0.75V.)
2. Processing
a. Put probe of oscilloscope to output
pin and measure voltage. Should
measure a 10ms pulse within the
horizontal divisions.
b. Keep probe at same spot and repeat
part a. to measure voltage and width
for time.
c. Keep probe at same spot and repeat
part a. to measure voltage and width
for time.
30
3. Output
a. Receive input from
processing circuit. Upon
receiving a logic high (4V
±1V) the bulb must flash.
Use a pulse generator to
send a 10ms 5V pulse.
b. Upon receiving logic low
(0.75V ±0.75V), do not
visually see a flash from the
bulb. Send a 10ms pulse at
1.4V from a pulse generator
and the bulb must not
produce any light.
3. Output
a. Visually inspect the bulb to detect a
flash on the bulb.
b. Visually inspect the bulb to detect a
flash on the bulb.
30
4. Power
a. Supply appropriate voltages
throughout all of the
circuits. The main supply
should be (6V ±1.5V.) Set
all the devices working,
connect them all in the
complete package as
designed and then send a
constant flash to send a high
signal to all.
4. Power
a. Probe battery nodes with a
multimeter to measured required
voltages.
10