Laser Trip Wire, How To Toggle - Page 1
Forum section: electronics / beginners

author: Brown
author_rank: Contributor
timestamp: October 31, 2013, 02:13:54 am
content: So I made AfroTechMod's laser trip wire circuit, link, and I was wondering how to make it toggle the LED without an Arduino

author: kizzap
author_rank: Unknown
timestamp: October 31, 2013, 02:57:57 am
content: Edit: I can't read I swear. Missed theWITHOUT

author: Alex
author_rank: Regular Contributor
timestamp: October 31, 2013, 03:06:23 am
content: Quote from: Brown on October 31, 2013, 02:13:54 amD-type flip flop comes to mind wired as a Toggle flip flop by connecting the D input to Qbar output. Googling these keywords will take you there.Alex.

author: Brown
author_rank: Contributor
timestamp: October 31, 2013, 03:20:04 am
content: I want the led to stay on even if the laser has been broken again. The led should turn off when I press a reset button, will a D Type Flip Flop do this?

author: Alex
author_rank: Regular Contributor
timestamp: October 31, 2013, 03:28:35 am
content: Please confirm: The LED must turn ON when the beam is broken. It must then stay on continuously, no matter what the beam does. To reset it, you want to press a switch. Correct?

author: kizzap
author_rank: Unknown
timestamp: October 31, 2013, 03:30:31 am
content: Quote from: Brown on October 31, 2013, 03:20:04 amSo are there two signals that control the state of the LED now? the tripwire and a button? In that case look at a SR (Set Reset) flip flop.

author: Brown
author_rank: Contributor
timestamp: October 31, 2013, 03:32:00 am
content: I'm new to EE, I don't know what flip flops are, and yes Alex

author: Alex
author_rank: Regular Contributor
timestamp: October 31, 2013, 03:41:55 am
content: Great, as kizzap said an SR flip-flop then. Flip flops are very specific circuit blocks usually found in digital logic circuits. They come in the form of small integrated circuits, chips. Kizzap could you show Brown how to wire this up please, otherwise i will draw you a diagram tomorrow.Alex

author: Brown
author_rank: Contributor
timestamp: October 31, 2013, 03:44:14 am
content: Thanks Alex and Kizzap! My first post and in minutes I got replies Thanks!!

author: IanB
author_rank: Super Contributor
timestamp: October 31, 2013, 04:33:24 am
content: Quote from: Brown on October 31, 2013, 03:32:00 amA flip flop is highly technical term in electronics for a circuit that flips one way or flops the other way. Usually such circuits stay flipped or flopped in whatever state they are in unless given the appropriate trigger to change. If the circuit is currently flipped it can be made to flop, and if the circuit is currently flopped it can be made to flip.

author: kizzap
author_rank: Unknown
timestamp: October 31, 2013, 05:56:21 am
content: Quote from: Alex on October 31, 2013, 03:41:55 amOh I guess I can, even have the pin numbers on there.If you use a 74HC02 this circuit should work, if not let us know. Same if you have any questions.-kizzap

author: codeboy2k
author_rank: Super Contributor
timestamp: October 31, 2013, 07:01:22 am
content: You can latch it with the addition of one more PFET to AfroTechMod's circuit.See what I've done below. Although the SR latch will work too, you don't need an SR latch.I've added Q2, a P-channel MOSFET.

author: Alex
author_rank: Regular Contributor
timestamp: October 31, 2013, 10:33:54 am
content: Quote from: kizzap on October 31, 2013, 05:56:21 amThanks!Brown, codeboy's circuit is very good too since you have one transistor, but you will need a 'normally closed' pushbutton as indicated. Maybe you can build both to introduce yourself to more electronics.Alex

author: kizzap
author_rank: Unknown
timestamp: October 31, 2013, 12:43:48 pm
content: Quote from: Alex on October 31, 2013, 10:33:54 amIt would be trivial to change to an normally open button, simply tie the source for the mosfet the button is connected to, through a resistor, to +V, then use a normally open button to short the source down to ground. Single extra resistor (which you should have a few of already, and cheap) vs. going out to find a not all that common button (yes I know that they do exist.)-kizzap

author: codeboy2k
author_rank: Super Contributor
timestamp: October 31, 2013, 10:22:37 pm
content: Quote from: kizzap on October 31, 2013, 12:43:48 pmI gave it some thought before posting, how to use a NO switch, and came up with the same idea. But the math was more involved and he said he was just learning so I didn't want to complicate it, but it can be done if it's hard to find a NC switch like that. I figured that there are many SPDT push buttons or DPDT so it should be not that hard.If you do use a single NO switch, just make sure the resistor pulling the source of Q2 up to 5V is an order of magnitude lower than the dark resistance of the LDR, like maybe 20-30 ohms, 1W or so. For home use, or prototype, or just playing and learning, then a 1/2 W will be ok.It's a pulsed load on the reset switch. Just don't hold it down too long, the resistor will be over its rated wattage, and don't use 1/2W in any production release of something like this.The dark resistance of the LDR is pretty low, like 250 ohms, and may go as low as 100 ohms in a really dark room.so the source resistance plus the dark resistance of the LDR forms a voltage divider that has to have a voltage higher than the Vgs(on) of Q1. This means that the top resister of the divider (the source of Q2) has to be pretty low. And making it low enough to overcome the LDR dark resistance means that it needs to be high-wattage to handle the connection to ground without smoking..In fact, this simple switch covers the basics of ohms law, voltage dividers and MOSFETS pretty well.There is lots to learn from making this work, and making it safe.

author: Brown
author_rank: Contributor
timestamp: November 01, 2013, 01:23:09 am
content: I think I have a NC switch, So I'm ordering 74HC02 and a IRF9540 P Channel MOSFET. If I don't have a NC swtich can't I just connect a wire and disconnect it to reset it? Thanks Kizzap, Alex, and Codeboy2k!

author: codeboy2k
author_rank: Super Contributor
timestamp: November 01, 2013, 04:22:59 am
content: Quote from: Brown on November 01, 2013, 01:23:09 amYou're welcome. Yes, you can use a wire like that. You really only need the switch if you want it in a box or on the wall