eptheta Posted December 20, 2009 Report Share Posted December 20, 2009 I have created a circuit which is supposed to detect light from a laser (using a photodiode) and increment a counter every time the light is blocked. It works partially, but sometimes the signal bounces and the counter jumps from 1 to say 4 and then to 5 then 7 etc... it's just unstable. If i flash the laser on and off very slowly, then it registers the count more or less properly, but i want it to detect fast changes, for example me waving my hand back and forth in front of the laser. Here's a link to the diagram of my circuit. The counter circuit works perfectly, so there's no need to include it.http://img96.imageshack.us/img96/8761/circ.pngIf you can't improve or point out the faults in my design, could you perhaps suggest an appropriate alternative circuit that would suit my purpose ?If anyone here can help me i would be very grateful.Thanks Quote Link to comment Share on other sites More sharing options...
Hero999 Posted December 20, 2009 Report Share Posted December 20, 2009 The circuit drawn wrong.The diode is connected backwards so a large current will flow both through it and the transistor's base causing them to both overheat.The emitter is connected to -5V when you probably meant 0V.There's no pull-up resistor on the input, I assume it's a CMOS input so can be susceptible to noise.I don't believe you have the circuit connected as shown, otherwise it wouldn't work.You probably have connected the diode the correct way round and the emitter to 0V.The problems you're having are due to the lack of a pull-up resistor and hysteresis. Quote Link to comment Share on other sites More sharing options...
Alex Tsekenis Posted December 20, 2009 Report Share Posted December 20, 2009 Maybe a comparator circuit with a bit of hysteresis using a CdS cell or a photodiode?http://home.cogeco.ca/~rpaisley4/Comparators.html Quote Link to comment Share on other sites More sharing options...
Hero999 Posted December 21, 2009 Report Share Posted December 21, 2009 Whilst that would work I think it's a bit overkill.If the transistor is connected up correctly, a high value resistor connected between the base and the output of the NOT gate will provide positive feedback and therefore hysteresis. Quote Link to comment Share on other sites More sharing options...
eptheta Posted December 21, 2009 Author Report Share Posted December 21, 2009 Hi,Sorry, i did mean 0V not -5 VThe diode is the right way round, and its not over heating. I'm using the Photo diode as a light dependent resistance not as a voltage source ( though it does both ) so it merely gives +V to the base allowing the transistor to work like a switch.My not gate is in TTL chip (7404) so it has a default high value, so i don't think i need a pull up resistor.My main problem is still the bouncing. Anything else i can do ? Quote Link to comment Share on other sites More sharing options...
Hero999 Posted December 21, 2009 Report Share Posted December 21, 2009 Sorry but that still will not work as you've drawn it, a photo diode should be reverse biased. As you have it shown, current will flow through the LED and both blow it up and the transistor.To use it in photovoltaic mode you need to connect it between the base and emitter.Don't you mean you used an LDR not a photodiode?You're right about not requiring a pull-up for TTL, although it is a good idea.I need to be sure you have the circuit correctly drawn before I can help you with the bouncing.How many spare inverters do you have on the 7404? Quote Link to comment Share on other sites More sharing options...
eptheta Posted December 21, 2009 Author Report Share Posted December 21, 2009 Alright i may seem like an idiot here (since i am relatively new to electronics) but I'll try and explain "exactly" what i did:-my photodiode (like any LED) has a long end and a short end. I connected the long end to +5V and the short end to the base of the NPN transistor.-emitter to 0V-the load, which is the clock signal, was connected to the NOT gate on the 7404 and then to the clock input of my 4206.This setup worked for me and i kept it running for about 10 mins just to be sure, and it didn't blow up. I know i am probably wrong about this explanation so i'll put up a picture of what I've done(and a representation on paint), if that will help. So here's a complete representation of my circuit, ignoring the 4026 and 7 seg pins and connections:Also, my 7404 has 5 spare inverters.NOTE: i cant see the images so here are the links anyway:http://img685.imageshack.us/i/circcccopy.jpg/http://img685.imageshack.us/i/circcc322.jpg/ Quote Link to comment Share on other sites More sharing options...
Alex Tsekenis Posted December 21, 2009 Report Share Posted December 21, 2009 -my photodiode (like any LED) has a long end and a short end. I connected the long end to +5V and the short end to the base of the NPN transistor.Very surprised this did not blow up. The photodiode is forward biased with 5V - 0.8V across it. A massive current will flow in the base of the transistor.This setup worked for me and i kept it running for about 10 mins just to be sure, and it didn't blow up. If it doesn't blow up it doesn't mean that it works or that it is a good design.So, you either try Hero's suggestions below and attempt to add hysteresis or try a comparator circuit with hysteresis which also means that you can throw away all NOT gates. Quote Link to comment Share on other sites More sharing options...
Hero999 Posted December 21, 2009 Report Share Posted December 21, 2009 I bought some over priced LEDs from Tandy (the now defunct UK branch of RadioShack) which were backwards: the long lead was the cathode and the short lead the anode which could explain this.Here's my suggestion. I'm going to assume that you've already connected the LED the right way round, otherwise it wouldn't be working. All you need to do is connect R1 from the NOT gate to the transistor's base. Quote Link to comment Share on other sites More sharing options...
Alex Tsekenis Posted December 21, 2009 Report Share Posted December 21, 2009 I bought some over priced LEDs from Tandy (the now defunct UK branch of RadioShack) which were backwards.Ah yeah, I remember, dodgy LEDs. Probably that's it then. Since your photodiode is transparent(?) the lead that does not contain the actual semiconductor should be the anode. I have found this to apply to dodgy LEDs even if they have non-standard leads. Let me know if you have found any LED or similar diode that doesn't follow this rule so that I don't assume it anymore.http://upload.wikimedia.org/wikipedia/commons/f/f9/LED%2C_5mm%2C_green_%28en%29.svg Quote Link to comment Share on other sites More sharing options...
Hero999 Posted December 21, 2009 Report Share Posted December 21, 2009 It was along time ago, about 15 years.I think that was also wrong, the big bit was positive and the small bit negative. Quote Link to comment Share on other sites More sharing options...
eptheta Posted December 22, 2009 Author Report Share Posted December 22, 2009 Sorry, but what is R1 here ? a resistor of 1 Megaohm ? Quote Link to comment Share on other sites More sharing options...
Alex Tsekenis Posted December 22, 2009 Report Share Posted December 22, 2009 Yes, a 1MOhm resistor. Maybe you will have to tweak the value a bit.Ok, so no rule of thumb, read datasheet if available or test each LED experimentally. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.