23
Engineering Sciences 52: The Joy of Electronics FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete ease of use. The clock and alarm time can be easily set using a group of dials and a secondary display that can be turned off to save power. When the alarm goes off, it is turned off by firing a laser gun at a photodiode within a target. Robert Anderson Joseph Zuckerman

Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

 

Engineering Sciences 52: The Joy of Electronics

FINAL REPORT Laser Tag Alarm Clock

May 9th, 2016 

Abstract:

Our project is an alarm clock that was designed for complete ease of use. The

clock and alarm time can be easily set using a group of dials and a secondary

display that can be turned off to save power. When the alarm goes off, it is turned

off by firing a laser gun at a photodiode within a target.

Robert Anderson Joseph Zuckerman  

 

Page 2: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Introduction As typical engineering students at Harvard, we often suffer from sleep deprivation, and                         

waking up in the morning is often difficult with just a regular alarm. After getting sick of turning                                   off our alarms and drifting back to asleep, only to wake up and find that we slept through lecture,                                     we decided to create a solution of our own. Our goal was to create an alarm clock that requires                                     the user to be fully awake and cognizant to turn off the noise. A feature we decided could                                   accomplish this is a laser deactivated alarm. In order to turn off the alarm, the user must wake                                   up, find their laser gun, and shoot a small target from across the room, surely a task too difficult                                     for someone still half asleep. 

Our clock is displayed in military time on 4 7­segment “numitron” LED displays. A                           secondary display, which consists of 4 more numitrons and can be turned off, is controlled by 4                                 potentiometer dials. A button allows the user to set the clock with the time on the secondary                                 display and a switch enables the alarm, which is the time on the secondary display. This allows                                 the clock and alarm to be easily set, which was one of our main goals of design. When the                                     alarm goes off, sound is played through a speaker with adjustable volume to wake the user up.                                 To shut the alarm off, the user must shoot a laser (housed within an old screwdriver casing) at a                                     photodiode nestled within a custom built target. Many of the components of this project are                             interfaced together using an Arduino Pro Micro.  

Design

System Breakdown  Our design consisted of 10 core functional units: Timing, User Interaction, Flash Analog to                           Digital Converter, Single Slope Analog to Digital Converter, Display, Time Comparator, Laser,                       Laser Detector, Speaker, and Arduino.   Timing: The timing circuit, consisting of a 1Hz clock and several divide­by­n counters which                           keep track of the minutes and seconds at any given time. A signal is sent to the arduino every                                     60 minutes so that the arduino can keep track of the hours.   User Interaction: The user interaction consists of 4 potentiometers to adjust the time or the                             alarm time, a switch to turn the alarm on and off, a volume control for the alarm, a button to set                                         the clock, and an LED indicator to show whether the alarm is on or off. Two of the                                   potentiometers are connected straight to the arduino, while each of the other two are connected                             to one of the analog to digital converters.   Flash Analog to Digital Converter: Receives analog voltage from potentiometer and converts                       it into a 3­bit binary value between 0 and 5 to represent the  10’s digit of the minutes.   

1

Page 3: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Single Slope Analog to Digital Converter: Receives analog voltage from the potentiometer                       and converts it into a 4­bit binary value between 0 and 9 to represent the 1’s digit of the                                     minutes.   Display: Eight numitron displays show the current time and the alarm time/clock set time.                           Minutes are displayed using binary to to 7­segment decoders from the output of the counters                             and the analog to digital converters. Hours are displayed using constant current serial­in,                         parallel­out LED drivers with output from the Arduino. The seconds are also displayed in binary                             on 6 LEDs.   Time Comparator: Using an 8­bit binary comparator, the current time is compared to the alarm                             time. A signal is then sent to the arduino when the times were equal.   Laser: The Laser is set to operate under constant current with declining battery voltage. The                             Laser also has pulse width modulation to adjust the intensity of the beam.  Laser Detection: Using a photodiode, this circuit detects whether the laser has hit a target. It                               also has the ability to be calibrated in various lighting conditions. Sends a signal to the arduino                                 when the laser has hit the photodiode.   Speaker: The speaker plays music from the arduino when the alarm goes off using a power                               amplifier circuit.  Arduino: The arduino receives input from many of the above systems and has the logic to                               determine what state the clock should be in based on its inputs inputs.   Block Diagram

 

2

Page 4: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Schematic  NOTE:  Due to restraints in Google Docs, This is not the highest resolution image of the schematic we have. For a full resolution image that can be zoomed in on clearly, please see the image that was uploaded with the report or follow this link (the file that was uploaded is the best quality, the link contains an image better than what is below, but not as good as the original file). Several zoomed­in pieces of the schematic are shown below with their relevant explanations.  

Subsystems  This section will give a detailed description about the design and operation of the above                             systems. Rxx indicates a resistor, and Cxx indicates a capacitor. All other components are                           

3

Page 5: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

referenced as Uxx. This section will also discuss the results of building and testing the various                               subsystems, where such explanation is relevant.   Note: all power used is from bench power supplies at +5 volts and ­5 volts.The +5 was from the                                     6v channels of the power supply in order to source over an amp of current needed by the                                   project.   Timing:  

The timing circuitry begins with a 1Hz square wave clock, generated by an LMC555                           (U9). R63 (33K) and C9 (22uF) were chosen to give a frequency of 1Hz. This clock signal was                                   put into the CLK pin of a 74HC4040 (U2), an asynchronous 12­bit counter. The 4040 keeps                               track of the seconds for the clock, so to display the seconds in binary, each of the outputs of                                     Q1­Q6 could be connected to a blue LED and a 330 ohm current limiting resistor to display the                                   seconds in binary for a cool visual effect and testing purposes. Since the 74HC4040 is an                               asynchronous system and only has a master­reset and no load abilities, we cannot clear the                             counter on 59 like in a synchronous divide­by­60 counter, since output signal of this counter                             needs to go high for a full clock cycle to enable the next counter (one’s digit of minutes). To                                     accomplish this, using logic and a combination of NAND (59: U3­1&2, 60: U8­1&2) and                           NOR(59: U4­1&4, 60: U4­5 & U9­1) gates, the output goes high after 59 cycles, then the                               counter is immediately reset at 60.  Output for 59: Q1Q2Q4Q5Q6 Output for 60: Q3Q4Q5Q6  

The output of the 74HC4040 fed into the Enable T input of a 74HC163 (U6), a 4­bit                                 counter with synchronous clear, to keep track of the ones digit of the minutes. Since we want                                 users to have the ability to load whenever they want, the clock from the 1Hz LMC555 circuit was                                   used for the clock of this counter. However, since we used a one second clock, we could not                                   clear the counter immediately when 9 was output. We decided instead to clear on the output of                                 10 from the clock, which means that for one second, the minute counter would read 10 instead                                 of 0, which we decided was a fair tradeoff for good functionality. The output of this divide by 10                                     counter went to the Enable T input of another 74HC163 (U7), which is configured identically,                             except it clears on 6 instead of 10. Again, this means that the clock displays a 6 for one second,                                       but this was a fair tradeoff for overall functionality (and made for a cool effect as the clock                                   appears to cascade when the hours change). The output of the last counter goes to digital pin 7                                   of the arduino. This signal goes high to indicate that an hour has elapsed. An interrupt listening                                 for a rising edge was attached to pin 7 and was used to increment a (volatile) hours variable                                   whenever the signal came in.  

4

Page 6: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Seconds Clock

Minute Tens Digit and Ones Digit Counters

  User Interaction:  

The user interaction circuitry is fairly simple. The four 10k potentiometers (both R39’s,                          R47, and R59) have pins one and three connected to positive five volts and ground respectively.                               The middle (wiper) pin for R39 went to the arduino (Analog pins 0 and 1), which mapped the                                   voltages to the correct value for the hours, and R47 and R59 went to the flash and single slope                                     

5

Page 7: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

ADC, respectively. An SPDT switch (U31) was connected to the arduino (digital pin 3) with one                               of the terminals not connected and one of the terminal going to ground. An LED and 270 ohm                                   current limiting resistor connected to positive five volts was connected to the middle pin to                             display when the alarm was on. The pin was configured as an input pull­up to use the switch as                                     active low and power the LED when the switch was thrown to the ON position, by connecting it                                   to ground. A potentiometer for volume control (R65) has its middle pin connected to the speaker                               circuit. Lastly, an active low SPST button (U10) is connected to the load pins of the the 163’s                                   (U6 & U7) and digital pin 2 of the arduino. An interrupt is attached to pin 2, and on a falling edge                                           of the input, the hours variable was updated to store whatever the arduino reads from the                               potentiometers.   Flash Analog to Digital Converter 

 The flash ADC receives an input analog voltage from one of the potentiometers (R47)                           

from user interaction and outputs a corresponding 3­bit binary value. A voltage divider of 6 13k                               resistors (R41­R46) creates a voltage references of ⅙, ⅓, ½, ⅔ , and ⅚of 5 volts. These voltages                                     are each put into the negative input of one of 5 comparators (1 LM393 U14­2 and 4 LM339                                   U13­1­4). The input from the potentiometer went into the positive input of the comparators.                           Depending on the value of the voltage from the potentiometer, a certain number of comparators                             would output high, while others would output low. The relevant logic table is shown below: 

 Comparator Outputs               Binary 

Voltage (V)  C5  C4  C3  C2  C1  C  B  A 

< .83  0  0  0  0  0  0  0  0 

.83 ­1.66  0  0  0  0  1  0  0  1 

1.66­2.5  0  0  0  1  1  0  1  0 

2.5­3.33  0  0  1  1  1  0  1  1 

3.33 ­ 4.17  0  1  1  1  1  1  0  0 

> 4.17  1  1  1  1  1  1  0  1 

 The simplified logic equations for A, B, and C are below: 

 A = C1C2’ + C3C4’ + C5 B = C2C4’ C = C4  

This logic was implemented using only NAND (U10­1 & U11­1­3) and NOT (U12­1­4)                         gates. The output of the logic was connected to three LEDs for testing the converter (LED on                                 

6

Page 8: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

corresponding to 1 in binary), a 74LS247 (U17) for displaying the value in decimal, and the A­C                                 Load inputs of the tens digit minutes 163 counter (U7). The D input of the 163 is grounded since                                     the count should never exceed 5.   

Flash ADC 

  Single Slope Analog to Digital Converter  

The single slope ADC receives input from a potentiometer from user interaction (R59).                         This voltage was put into the negative input of an LM393 comparator. An inverting integrating                             op­amp (U46­1) is designed to integrate down from 0 to ­3.5 volts over the course of 9                                 milliseconds using a 470nF capacitor (C10) to store charge and a 15k resistor (R55) to set the                                 current through the capacitor. This signal is inverted using an unity gain inverter (U46­2), so it                               

7

Page 9: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

goes from 0 to 3.5 volts. This is put into the positive input of the comparator. While the value of                                       the potentiometer was above the value from the integrator, the comparator output was high.   

This output is sent to the ENT pin of another 74HC163 (U45). A 1 kHZ clock from an                                   LMC555 (U42) is put into the CLK pin of the 163. This clock then counts how long it takes the                                       integration to exceed the threshold set from the potentiometer on a scale of 0­9. Meanwhile,                             another 74HC163 (U43) is used to divide this clock signal by 9. This divided clock signal is used                                   to clear the integrator using a 74HCT4316 analog switch (U47), to clear the other counter to                               reset it to 0, and enable a 74HC175 quad flip­flop (U44) that is used to hold onto the last result                                        while the next integration proceeds. The output of the latch is sent to 4 LEDs for testing the                                   converter, a 74LS247 (U16) for displaying the value in decimal, and to the A­D load inputs of the                                   counter keeping track of the ones digit for the minutes (U6). 

 Below is a picture from the scope showing the threshold from the potentiometer (CH1),                           

the integration (CH2), and the output of the comparator (CH3).  

 

8

Page 10: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Single Slope ADC

 

 Display   

The minutes displays all use 74LS247 binary to decimal 7 segment decoders. U16 and                           U17 control the ones and tens digits of the minutes of the actual time, and their A,B,C, and D                                     inputs come directly from the corresponding 163 counters (U6 and U7). Each of the 7 pins of the                                   output goes to a pin of a numitron through a 24 ohm resistor (R13­19 & R6­12) to limit the                                     current to about 20mA. The minutes displays on the secondary display are set up the same,                               except the inputs come from the flash ADC and the single­slope ADC for the tens and ones                                 digits of the minutes, respectively.  These also use 24 ohm resistors (R75­81 & R68­74).  

All of the hours displays used TLC5916 constant current LED drivers. The drivers are all                             connected via their SDI and SDO pins (U56 → U57 → U19 → U18). All of the drivers have                                        their clock pins connected to pin 8 of the arduino and their latch enable pins connected to pin 4                                     of the arduino. Making use of the shiftOut function of the arduino, the hexadecimal value                             corresponding to the correct combination of segments to light was shifted out to each of the                               drivers. The drivers all make use of a 1k external resistor, which set the current to about 20mA.  

9

Page 11: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Displays and Drivers 

  Time Comparator  

The time comparator circuit uses a single 74HC688, an 8­bit binary comparator. The                         outputs from the 163 counters (U6 and U7), labeled T1­T7 are connected to the P1­P7 inputs of                                 the 688. The outputs of the two analog to digital converters, labeled S1­S7, are connected to the                                 Q1­Q7 inputs of the 688. Pins P8 and Q8 are both connected to ground. The comparator                               outputs low when all of the P pins are the same as their corresponding Q pins. So, when the                                     time and alarm set are the same, the output is low, and otherwise it is high. This output is                                     connected to digital pin 1 on the arduino. An interrupt was attached to pin 1 of the arduino to                                     wait for a falling edge from the comparator, which would trigger the alarm when the alarm was                                 on.   Speaker   

The speaker circuit we used received music from the arduino, which passes through a 10k potentiometer (R65) to allow the user to adjust the volume of the alarm. We then used a Class B Power Amplifier to drive the 8 ohm speaker with only limited current output from the arduino. The op­amp used (U51) is an LMC6482. The amplifier uses an MJE3055 (U53) NPN BJT and an MJE2955 (U54) PNP BJT. We used 2 12 ohm resistors (R64 and R66) as fuses. 

10

Page 12: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Power AMplifier for speaker

  Laser  

The laser circuit provides constant current to the laser under dropping batter conditions and uses pulse width modulation to adjust the apparent brightness to the user. An LMC555 is connected to a 68 ohm resistor (R21) and a 10k potentiometer (R20), with a 100nF capacitor (C7) connected to ground. The potentiometer creates a variable duty cycle, with higher duty cycles corresponding to higher perceived intensity of the laser. This signal goes through an SD101 diode (U65) and a 1k resistor (R22) into the base of a 2N3904 BJT (U71). Two 1N4148 diodes (U66 & U67) create a reference voltage of 1.2 volts at the base of the transistor. Then, accounting for the .6 volt drop from the base to the emitter, .6 volts drop across R23, a 30 ohm resistor, creating 20mA of current in the emitter. Since the collector and emitter currents are approximately the same, this will result in 20mA across the laser, safely below its maximum value of 25mA. 

11

Page 13: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Laser Pointer Circuit

   Laser Detection    The laser detection circuit begins with a simple op amp designed to generate a voltage proportional to the amount of light hitting the photodiode. The BPW46 photodiode was placed going into the negative terminal of an LMC6482 op amp (U24­1)and ground. As light hights the diode current begins to flow through the photodiode, and the same current must flow through the 100k resistor (R1) in the negative feedback loop. Since the positive input of the op­amp is grounded, the negative input also has 0 volts at it. Therefore, the op­amp must output the proper voltage to give the correct current across the resistor. This signal was then inverted through a unity gain inverter (U24­2) so the output was positive. Below are images of the output of the first op­amp and the output of the inverter.   

    

These images are over the course of many seconds, The first few spikes are the laser being held near the photodiode or passed through it briefly. In the second half of the images, the laser was held on the photodiode for longer periods and then released.   

The output of the inverting op­amp goes to a voltage controlled oscillator.  The VCO consisted of two op­amp circuits: an integrator (U25­1) and a schmitt trigger (U25­2). A voltage 

12

Page 14: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

divider (R25 and R26) sets the voltage at the positive input to the op amp (U25­1) to half the input voltage. Because the op­amp keeps its inputs at the same voltage, the same drop must occur across R24, requiring some current to flow across it. A VN2222 N­channel MOSFET (U29), controlled by the output of the schmitt trigger is used to control this current. When the MOSFET is on, the current flows through it, but since R24 has double the resistance of R25 and the same voltage drop, more current must flow through it. This current comes from the capacitor (C2), charging it, and the op­amp must output a constantly increasing voltage. When the MOSFET is off, all of the current must flow through the capacitor, discharging it, and the op­amp must output a constantly decreasing  voltage.   

The schmitt trigger (U25­2) takes the triangle wave as input. When the wave exceeds ⅔ of 5 volts, then it outputs high and the threshold changes to ⅓ of 5 volts. When the wave falls back below that, then it outputs low and the threshold goes back to ⅔ of 5 volts. This output is connected to the MOSFET, controlling the integrator. Below are pictures of the output of the voltage controlled oscillator with the the laser shined and just natural light.  

 

   VCO with no laser VCO with laser shined 

 In order to ensure than natural light alone did not turn off the alarm, we passed the 

output of  the voltage controlled oscillator through a high pass filter. However, since the highest frequencies (with the laser) were around 230 Hz and the lowest (just natural light) were around 20 Hz, and these frequencies are only 1 decade apart, we needed quite a bit of attenuation to get the 20 Hz frequencies to go to 0, as we desired. To accomplish this, we designed a third order active filter using the filter wizard at analog devices. We tested the filter by passing sine waves of various frequencies as well as the square wave output of the voltage controlled oscillator. The results are shown below. Inputs to the filter are shown on CH1 and the output is shown on CH2.    

13

Page 15: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

     Filter: 20 Hz sine wave  Filter: 50 Hz sine wave  

 

     Filter: 100 HZ sine wave           Filter: 150 Hz sine wave 

 

   Filter: 200 Hz sine wave              Filter: Output of VCO no laser shine 

 

14

Page 16: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

 Filter: Output of VCO with partial laser shine      Filter: Output of VCO full laser shine  

Even with a third order filter, we could not get perfect attenuation (0 output) while preserving the high frequency inputs from the full laser shine. To distinguish the two, then, we passed the output of the filter to an envelope detector to determine the amplitude of the output. The envelope detector consisted of the signal being passed through a 1N148 diode (U28) and then the output was connected to ground via a resistor and a capacitor. We tuned R34 (5.6k) and C6 (10 uF) to give us best results over our range of frequencies. The outputs of the envelope detector are shown below with the output of the filter on CH1 and the output of the detector on CH2.   

   Envelope detector: no laser partial laser      full laser  

Lastly, the output of the envelope detector went to the positive input of an LM393 comparator (U27). A 10k potentiometer (R37), a 15k (R36), and a 25k (R38) resistor are used to create an adjustable threshold between 2.5 and 3.5 volts that determines how precisely the laser needs to hit the target to turn off the alarm. This adjustable threshold also allows the circuit to be calibrated for differently lit spaces, since the amount of natural light varied in the locations the circuit was used. The comparator output is tied to Arduino digital pin 0, and goes high when the output of the envelope detector exceeds the threshold. An interrupt waiting for a rising edge on pin 0 is then set to turn off the alarm when the comparator goes high, signaling that a laser has been detected. Below is a picture of the envelope detector output (CH1), the threshold (CH2), and the comparator output (CH3).  

15

Page 17: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

   Comparator Output  

Laser Detection Circuit 

    

16

Page 18: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Arduino  

The arduino is running a 3­state finite state machine program. The 3 states are 1) alarm off, 2) alarm set, waiting for activation, and 3) alarm activated. The state machine diagram is shown below. 

   

The arduino has interrupts attached to the inputs for timing, comparator, laser detection, and clock set, as mentioned above. The arduino also plays the music for the alarm by outputting a set of frequencies for a certain duration of time on pin 10 connected to the speaker.   Design Narrative 

We learned a great deal over the course of the project, especially because of the large scope of our endeavor. The number one thing we took away is that a large project requires quite a bit of planning before anything can actually be executed. There was no way that we could have just jumped into this project without a good amount of design, sketches, diagrams, and schematics before hand. Before we started building anything we had a good idea of all of the components we needed and how they would fit together, that being said there were still many iterations and changes made along the way. 

We found the digital design to be easier for this project than the analog design. However, that being said, we needed to be extra careful with our digital designs since they required so much wiring and any mistakes would be quite difficult to fix.  The analog design took a bit longer, and required some tuning once it was built, but was much easier to build. We also found the analog systems much easier to debug since it is easier to see what is going on with the circuit on the scope, as well as just consisting of less wires to keep track of.  

Lastly, we now fully appreciate and are grateful for the Arduino as a tool to easily integrate many complex systems together with just a few lines of code. Writing our arduino code as a finite state machine kept the code simple and running bug­free. Throughout this project we designed and built our own versions of several components that are already exist as integrated circuits that could have just been stuck in the breadboard and eliminated hours of our hard 

17

Page 19: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

work. However, in choosing to design and build these components ourselves, we were able to gain a deeper and more thorough understanding of how these systems work. 

Conclusion Overall, we met all of our goals and we both think that the project was a total success. 

We had a functioning clock, which was easily resettable. Our alarm was easy to set, and consistently went off when the time matched the alarm time. The alarm turned off when the laser hit its target, and did not turn off just from natural light. The alarm clock was very user friendly and customizable, which were two of our main objectives. Plus, we accomplished all of this through designing electronics and did not take any shortcuts via programming (and we finished early enough to make it look nice!). 

However, there are a few things that we could improve on if we moved forward with the project. First, setting the alarm required that all of dials on the user interaction section remain the same or else the alarm time would change. A better design would incorporate a way to remember what the alarm time was until it needed to be changed. Next, sometimes the alarm clock would glitch if some of the potentiometers were caught right in the middle of two of the discrete values. This would be our top priority to fix moving forward. Lastly, the laser detection circuit was based off the intensity of the light shined on the photodiode, so any highly concentrated, bright light could turn off the alarm. A better design would be able to discriminate the frequency of laser from natural light, which would also make better use of the pulse width modulation we incorporated to the laser circuit. This could also solve some of the issues of having to filter out natural light.  

Despite the long hours, the two of us really enjoyed working on this project and were really impressed with what we were able to create after a semester in ES52. We think we did a pretty good job of tying in some of almost everything that we learned this semester, which made the experience even more rewarding. We are very proud of what we accomplished and think we turned out a project that is both pretty cool and practical.               

18

Page 20: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

 Bibliography

Works Cited 

Abrams, David, and Avinash Uttamchandani. Labs 1­6. Rep. no. 1­6. Cambridge: Harvard, 2016. Print. 

Abrams, David. "ES­52 Final Lecture." Es­52 Lecture. Maxwell Dworkin, Cambridge. 27 Apr. 2016. Lecture. 

Amariucai, George. "Envelope Detector." Http://seniord.ee.iastate.edu/. Iowa State University, n.d. Web. 1 May 2016. <http://seniord.ee.iastate.edu/SSOL/RADAR/prjpln99/detector3.html>. 

"Filter Wizard | Analog Devices." Filter Wizard | Analog Devices. N.p., n.d. Web. 08 May 2016. <http://www.analog.com/designtools/en/filterwizard/>. 

Java. "Voltage­Controlled Oscillator,." Falstad. N.p., 9 June 2015. Web. "Voltage­controlled Oscillator." Wikipedia. Wikimedia Foundation, n.d. Web. 08 May 2016. "What You Should Know about LED's." (1980): n. pag. Http://www.physics.unlv.edu/. 

University of Nevada. Web. <http://www.physics.unlv.edu/~bill/PHYS483/LED_PIN.pdf>. 

 Appendix Code Since the code for the project is rather long,  we have decided include the title block to give an overview of what it does. The whole code has been uploaded with the report or can be viewed at this link.  /* * Laser Tag Alarm Clock * ES52 Final Project * * Arduino code to run the finite state machine for our * alarm clock. Arduino receives input from push button * for clock set, alarm switch, two potentiometers for time * adjustment, binary comparator, and laser detection. * * Robert Anderson and Joseph Zuckerman * * 5/8/16 */   

19

Page 21: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

 Mechanical Components  Solidworks Drawings of some of the key laser cut components of the project. 

 

   

 

20

Page 22: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

Board Layout and Images The top view of the entire clock circuit depicting how the board was laid out. 

    

 

21

Page 23: Engineering Sciences 52: The Joy of Electronics FINAL ... · FINAL REPORT Laser Tag Alarm Clock May 9th, 2016 Abstract: Our project is an alarm clock that was designed for complete

The cover plate for the user friendly portion of the circuit explains all the adjustments that can be made to interact with the clock in one clean easy to reach location.  

 

   

Circuit for the laser pointer prior to being inserted into the casing and after insertion.  

  

22