EE 0 Spring 2006 Final Projec EE 0 Final Projec Basic Circui Par I: General insrucion 1. The final projec will coun 0% of he lab grading, since i s going o ake lab sessions. All oher individual labs will coun 70% of he lab grading; each of hem couns 10%. 2. This projec is composed of a basic par and a creaion par. A circui diagram will be provided for he basic par, which is required o be finished a he end of he semeser. There are four creaion quesions wih differen complexiy and differen bonus credis. No circui diagrams will be provided for he creaion par. You have o design he circui o realize he funcion by your own using he componens ha we can supply. You are allowed o discuss wih oher sudens and your GSIs. GSIs can help you analyze if he circui works bu we won give any hins on he design for he firs hree quesions. For he las open quesion, you are welcome o do whaever you hink will be worh doing using he componens we have, and discuss any possible funcion design wih your GSIs. (We may sill make modificaions o he freeform/creaive porion a he end of he lab, so for he firs week jus focus on building he basic circui diagram and doing analysis for your repor). Every effor mus be made o eam up as a eam of 2, and if necessary you can change session; only under special circumsances and approval by head GSI is required for forming a eam of or doing i alone. One of your eam members will keep he board and he componens during he projec period. Try o proec your progress, and keep i in a good condiion.. Every group will ge a projec ki wih a piece of breadboard and all he componens. Please check wih he componen lis in lab guide par o see if he ki is complee. Keep i in a good condiion during he whole projec. We don have many exra pars o supply if you lose any of hem. 5. The grading will be mainly based on he lab repor and he circui funcionaliy. A yped lab repor is preferred. Hand wrien is also fine, bu has o be nea and clear. Please see par I for more informaion on he lab repor. 1
EE 0 Spring 2006 Final Projec Par II: Basic Circui Ligh Sensor 1. Funcion analysis 2
EE 0 Spring 2006 Final Projec Figure 1. Basic circui diagram This is a ligh (visible or infrared) sensing circui. When here is no ligh shinning on he deecor in he circui (he circui elemen you use for visible or I ligh deecion), he green LED will be flashing. When here is no ligh shining on he deecor, he red LED will sar flashing insead of he green one. The whole circui can be broken down ino 5 basic building blocks labeled A-E in he diagram. We will analyze hem one by one in order o undersand he funcions. A..5 DC power supply. The circui is going o be powered by a 9 baery, bu lower DC power is also needed in he circui. Par A is using an op-amp o build up a simple volage follower which gives.5 oupu. Since.5 is half of 9, resisors 1 and 2 are equal. C1 and C2 are filering capaciors, which are usually conneced in parallel wih he DC oupu in order o filer ou any high frequency AC signal coming from he noise. B. Square wave oscillaor. Le s analyze i in a ime sequence and use.5 as he volage reference. The circui diagram can be redrawn as shown in Figure 2 (b).. 5 0 C - A 2-9 ou C -.5 A2 - ou -.5 5 (a) 5 (b) Figure 2. Square wave oscillaor (a) wih reference a 0. (b) wih reference a.5. Iniially = 0 and here is no charge on he capacior. However o he reference.5 ou, =.5 and =.5. Since his circui has a posiive feedback loop, ou any sligh difference beween and - may make ou high or low clamped o he power supply value. In his iniial condiion,
EE 0 Spring 2006 Final Projec =.5 > and =.5, so he oupu goes high and ge clamped o.5 immediaely afer he circui is on. Now he circui is in sae 1: ou =.5, =.5 and capacior C is being charged from ou. So - is rising up. When - is as high as or jus slighly higher han, he circui oggles because of he posiive feedback. So afer he capacior charges o a volage higher han, Oupu will hen be clamped a -.5 since >. Now he circui is in sae 2: ou =.5 and =.5. The capacior is being discharged from ou. And - is falling down. When - is as low as or jus slighly lower han, he circui oggles again because of he posiive feedback. Then he oupu is clamped a.5 again,.5 =.5 and he capacior is being charged from ou again. Therefore, we see ha he circui is oggling beween he wo saes, and he oupu volage is eiher.5 or -.5, which forms a periodic square wave. To undersand he oscillaion funcion beer, we draw wave forms a, and on he same scale as shown in Figure (b). I s clear ha he hreshold volages of oupu high and low are. 5 and. Go back o he original circui wih reference a 0. We jus need o add a DC offse.5 o all he resul and waveforms as shown in Figure (a). The hreshold volages changes o. 5 ou 2 and.5.
EE 0 Spring 2006 Final Projec. 5 ( 2 )/( ).5/() -. 5 /( ). 5 ( 2 )/( ) -.5/() -.5/() ou 9. 5/( ) ou.5 -.5/( ) 0 -.5 (a) (b) Figure. Waveforms of, - and ou (a) wih reference of 0. (b) wih reference of.5 C. Ligh generaion and deecion. isible Ligh (room ligh), For Basic Circui This basic circui can be made o deec eiher visible or infrared ligh. When you firs build he circui, you should sar wih he phooresisor he hin disk shaped elemen wih wo pins and squiggly lines on op. This is he easies o implemen since you don need o wire up a ligh source (and easier o debug since you can see visible ligh!). The phooresisor simply changes is resisance based on how much ligh is hiing i. The exac Drawing of range may vary, bu you migh expec somehing like 1kohm phooresisor when ligh his i, and 10k or above when i is in he dark. The phooresisor is made of a semiconducor (such as cadmium sulfide), and when ligh his i, elecrons jump from he valence o conducion band where hey can move around, and so he conduciviy increases. Infrared Ligh (ry his when he res of he circui is all complee) In a he end of he lab afer you ve finished, we will ask you o replace he phooresisor wih he infrared source and deecor and repor on ha seup as well (boh in secion C of he repor). The ransparen blueish LED is your infrared (I) ligh source. Secion 2 gives suggesions for opimal resisor values o use for he I source. The black LED-like circui elemens are he I phooransisors. (The black plasic covering hem blocks visible ligh, bu passes I frequencies). They only have heir source and drain pins sicking ou. When ligh his he deecor, i has he effec of raising he volage of he ransisor base erminal inside he package, and so conduciviy increases beween he source and drain erminals. Furher descripion and recommended resisor values are in secion 2. Srong isible Ligh Source There is also a visible phooransisor available for you o use for less sensiive ligh deecion in he creaive/bonus par of he lab. This requires a flashligh or 5
EE 0 Spring 2006 Final Projec oher inense ligh o acivae. Furher descripion is in secion 2. D. Comparaor and buffer. The open loop op-amp can be used as a comparaor. The posiive inpu connecs o a fixed DC volage used as a reference volage. Negaive inpu connecs o he deecor end. When deecor deecs ligh, curren increases hrough he deecor (wheher you re using he phooresisor or phooransisors, he effec is basically he same). Therefore he volage across 7, which is conneced o he negaive inpu of he op-amp, increases. When i s lower han he reference volage, he oupu of he comparaor will be high 9. When i s higher han he reference, he oupu is low 0. Thus he ligh on/off is convered o L/H of he op-amp oupu. An NMOS will be conneced o he oupu of he comparaor as a buffer since he oupu will be driving he LED and he logic circui following. When comparaor oupu (gae volage of he NMOS) is low, he NMOS is off, hus he drain is high or floaing. When comparaor oupu is high, he NMOS is on, hus he drain is grounded. This way, we realize he ligh on/off o oupu H/L conversion. E. AND gae. Only when boh inpus are high, he oupu is high, which will ligh up he red LED. Boh inpus will be high when he ligh is on (and he NMOS urns off) and when he blinking oscillaor is also high. Hence, using he AND gae, you pass he ~1-0Hz blinking signal from he green LED o he red LED, and since he comparaor urned off he NMOS, he green LED canno ligh up. Based on he funcions of all he building blocks, he funcion of he whole circui is as follows. When ligh is off, he comparaor buffer oupu is low. So he AND oupu is low, hus red LED is off. However, he oscillaor oupu will make he green LED flashing. When he ligh is on, he comparaor buffer oupu is high (9 ), so he AND gae oupu is high when he oscillaor oupu is in he high period, hus he square wave signal is ransmied o he red LED, which will be flashing hen. In addiion, because of LED is a diode, which can only work in one direcion, he green LED is off when comparaor buffer oupu is high. 2. Hands-on building he circui To build and debug each block separaely and hen combine hem ogeher o realize he whole funcion will make he process faser and easier. Try o make your circui clear, compac and nea. Keep your wires shor! I will be nice-looking and mos imporanly easy o debug. I will also make he lab repor much easier since you can break each block down. We will give general consideraions of how o selec values of he componens and 6
EE 0 Spring 2006 Final Projec provide recommended values and specificaions for some pars. A. Op-amp is LMC 682, he same as we used in Lab 6. Power supply will be from a 9 baery. So (pin 8) is 9 and - (pin ) is 0 or ground of he circui. Since he oupu is.5, half of he power, we need wo equal resisors for 1 and 2. To make he power consumpion low, we use 10kΩ for 1 and 2. Filer capaciors C1 and C2 can be 10µF. Smaller values can be used if high frequency noise exiss. BE CAEFUL OF THE POLAITY OF THE CAPACITOS, when connecing hem o DC volage. emember, he longer pin is he erminal of he capacior and ideally volage across i should be biased accordingly. B. Human eyes can differeniae frequencies smaller han 0 Hz. So we need o make he oscillaor frequency in he range 1 ~ 0 Hz. In order o express he frequency in erms of, and 5 and C, le s do some calculaions based on he analysis in he above secion. Since he wo hreshold values are symmeric as shown in Figure, we know ha he duy cycle of he square wave is 50% (half period 9 and half period 0 ). The period of he square wave is decided by he capacior charging ime consan 5 C. Le s use he rising half period of - in Figure (a). Since his is a firs order C circui, he rising par can be express as: = 5C 9 1 e. A ime 1, 2 2 5 9 C 1 e = =.5 period of he square wave. So 1 9 5C 1 e = =.5 ; a ime 2, T. The ime period 2 1 =, where T is he 2 ( ) 2( ) T 2 2 2 1 5C ln 5C ln 5C ln = = = 2 2. So he period is T 2 2 = 5C ln, and he frequency is 1 1 f = =. The falling half period of - will give he same T 2 25C ln soluion of he period or frequency since he signal is symmeric. So o conrol he frequency in he range of 1~0 Hz, we use =5=10 kω, =510 Ω and C=10 µf. Plug all hese numbers in he frequency equaion, we have he frequency of 1.5 Hz, which is deecable by human eyes. C. For he ligh generaion, if room ligh or flash ligh is being used; here is no need for ligh generaion circui. If an infrared (I) LED is being used as an I ligh 7
EE 0 Spring 2006 Final Projec source; he maximum curren is around 0 ma, and hreshold volage is abou 1.7. So we use 6 = 200 Ω or similar o keep he curren below 0 ma. For he deecion par, we use differen 7 values for differen deecors. If he visible ligh phooransisor is being used, which can deec inense whie ligh ( so a flash ligh has o be he source), 7 can be 10 kω o keep he curren smaller han he maximum 25 ma and also keep he power consumpion low. If phooresisor is being used, which can deec low inensiy ligh, or jus general room ligh, 7 = 1 kω would be a good choice. When room ligh is on, he resisance will be less han 1kΩ (resuls may vary, check yourself o see). Wih room ligh off or simply blocking he surface of i, he resisance will be greaer han 10kΩ (also check his yourself o find he acual value). So 7 and he phooresisor form a simple volage divider. So 7 =.5. Table 1 7 deecor gives a summary of componens, values as well as oupu volage ranges of differen source/deecor schemes. Source/Deecor 6 (Ω) 7 (Ω) Oupu /-() Flash ligh / - 10 k 0~ phooransisor oom ligh / - 1 k 2~ phooresisor (for basic circui) I LED / I deecor 200 10 k 0~ Table 1. Ligh source and deecor schemes D. Po 8 is a volage divider oo. You can hink of he poeniomeer as being a 10kΩ resisor where you can ap in somewhere along he resisor, so you end up geing a circui ha looks jus like a volage divider where 12=10kΩ. So his poeniomeer needs o be uned o he value ha makes he oupu volage of he poeniomeer s middle pin roughly in he middle of he on-off range of - in order o disinguish ligh-on and ligh-off saes. A 10kΩ po will be used o provide he volage reference. Turn i unil he oupu volage is abou 2.5- or even higher, depending on which deecor is being used. You can pick he righ volage for his comparaor by measuring he volage oupu of your deecor circui (on he - erminal) wih your source on and off. Afer you ve picked a value, you can play wih he po seing o ge he desired sensiiviy. The NMOS is BS170. The gae hreshold volage is abou 2.2. Please refer o he spec for more informaion. (The pin diagram is weird looking he middle pin is 8
EE 0 Spring 2006 Final Projec acually he base, even hough he pins are a an angle in he drawing. Ask your TA if you re no sure). E. D1and D2 can be 1N18. To keep he curren smaller han 0 ma for all he diodes (D1, D2 and LEDs), we use 9 = 1kΩ, 10 = 11 = 510Ω. Any oher similar values will be fine oo. Table 2 summarizes all he componens you may need o build he basic circui. 1 10 kω C1 10 µf 2 10 kω C2 10 µf 10 kω C 10 µf 510 Ω D1/D2 1N18 5 10 kω N1 BS170 6 -/-/ 200 Ω Op-amp LMC 682 7 10kΩ/1 kω/10 kω Ligh source Flash / oom / I LED 8 10 kω po phooransisor/ Deecor phooresisor/ 9 1 kω I deecor 10 510 Ω Baery 9 11 510 Ω LEDs Green and ed Table 2. Basic circui componens summary 9
EE 0 Spring 2006 Final Projec Par : Componen lis Componen alue Quaniy esisor 10 kω 8 1 kω 510 Ω 200 Ω 1 Po ( pins, large black dial) 10 kω Capacior 10 µf 0.1 µf 1 (very iny!) Componen Model Quaniy Op-amp IC LMC 682 2 (maybe 1 addiional) NMOS (see daashee, has ben pin for base) BS170 PMOS (see daa shee, all sraigh pins) ZP2106A 1 Diode 1N18 2 isible LED (longer pin is side) Green, Yellow, ed I LED (clear blue-ish color) - 1 I deecor (black cover, looks like an LED) - 1 Phooransisor (clear, looks like LED) - 1 Phooresisor (small disk wih squiggly lines) - 1 Buzzer (large black speaker) - 1 Microphone (erase-sized - 1 10
EE 0 Spring 2006 Final Projec piece wih wo wire leads Baery 9 1 Breadboard - 1 11