Halls sensor? Reed Switch?

MisterBill2

Joined Jan 23, 2018
8,761
Since it's a quick edit - here's the circuit I've built and worked.

View attachment 197866

And here's the LED's in the edited version:

View attachment 197867
When signal is High, the upper transistor conducts, bypassing the green LED and the red LED is lit.
When signal is Low, the lower transistor conducts, bypassing the red LED and the green LED is lit.

With that - I'm done.
THIS circuit will be reliable because any collector to base leakage current in one transistor will tend to turn off the other one. IT is a simpler version of the output circuit in a lot of power amplifier designs. It would also work to put a single LED current limiting resistor in series with the collector of the NPN transistor.
 

Tonyr1084

Joined Sep 24, 2015
5,976
It would also work to put a single LED current limiting resistor in series with the collector of the NPN transistor.
My concern is that the two LED's with a resistor going to the emitters would not block any current from 12V to Gnd. The LED's would see full voltage. No??? IF "Signal" were to be "open" (neither High nor Low) then neither transistor would be on and the LED's would burn down. Perhaps this might work if the voltage drop across the transistor is less than the voltage drop across the LED. But I am far from expert on this; so perhaps it WOULD work. But if the switch providing the signal were to fail - - - .

1580385716750.png
 
Last edited:

Reloadron

Joined Jan 15, 2015
5,934
My concern is that the two LED's with a resistor going to the emitters would not block any current from 12V to Gnd. The LED's would see full voltage. No??? IF "Signal" were to be "open" (neither High nor Low) then neither transistor would be on and the LED's would burn down. Perhaps this might work if the voltage drop across the transistor is less than the voltage drop across the LED. But I am far from expert on this; so perhaps it WOULD work. But if the switch providing the signal were to fail - - - .

View attachment 197890











What this looks like is a partial of a "matched switch" The problem I see is what would the signal level (input) have to be for the PNP to conduct?

This is a matched switch which I borrowed from here. Note a circuit like this uses a +VCC and a -VCC with ground. It's also a popular design as a current source, especially if we want a negative to positive current like -100 to 100 mA.

Ron

Matched Switch.png
 

Tonyr1084

Joined Sep 24, 2015
5,976
But isn't that what you were telling the TS?
There's a certain level of reasonableness. I'd never build my own heart defibrillator. Sure, I could probably build one - given enough time to study up on it, do the necessary engineering and such. But when it comes to something that needs to be reliable - sometimes going with a professionally designed, engineered and built system is the better way. Besides, the TS is thinking about using one of those units anyway. He can simply buy the lights with no circuitry OR he could buy the lights with all the circuitry needed. I build for hobby sake. He's building for the sake of a business shipping / receiving dock. I'm sure the truck drivers would appreciate a system that reliably indicates when they're in proper position. So why build five units (I think he said 5) when he can buy five units with the electronics already in them? All he needs to decide is whether to power with 12VDC, 24VDC or 110 VAC. If you're going that far - why not just buy the unit you need for your purpose?!

There is NOTHING I've ever built that someone's life or property may depend on my "thing" working properly every time.
 

Sensacell

Joined Jun 19, 2012
2,824
The circuit in Post #42 is bad- imagine the resistor between the LEDs and the transistor pair is gone, now you are left with two LED's across the power supply with no current limiting.
 

Tonyr1084

Joined Sep 24, 2015
5,976
@Sensacell, yes, the picture in post #42 IS bad. That's the point I was making. You can see how there's current flowing from positive to negative at full current through the two LED's. I set it up the way MisterBill2 was suggesting. Post #41. Or at least that's what I took Mr. Bill to be saying.

Wait a minute. I think I misread Mr. Bill's comment. I believe he was suggesting putting the resistor in series with the collector of the NPN transistor. I showed it on the emitter side of the transistors. Well - shut my mouth! Sorry Mr. Bill. I screwed up again. Geez! Maybe I really SHOULD be quiet. Sit back and learn a little more before I start opening my big keyboard.

[edit] Yeah, now that I draw it out - yeah, that works and gets the parts count down by one. When Q1 is on so is LED 1. When Q2 is on so is LED 2.
Very nice. Yeah. I like that. Except - what happens if there's no signal, no high, no low? An open signal would mean both Q1 and Q2 would be off. Both the red and green LED's would be lit at about 15 mW.
1580442268951.png
(12V - 2Vf (red) - Q1 (0.7Vf) ÷ 470Ω = 20 mA
(12V - 3Vf (grn) - Q2 (0.7Vf) ÷ 470Ω = 18 mA
A difference of only 2 mA. Nobody is going to see the difference in brightness.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
8,761
@Sensacell, yes, the picture in post #42 IS bad. That's the point I was making. You can see how there's current flowing from positive to negative at full current through the two LED's. I set it up the way MisterBill2 was suggesting. Post #41. Or at least that's what I took Mr. Bill to be saying.

Wait a minute. I think I misread Mr. Bill's comment. I believe he was suggesting putting the resistor in series with the collector of the NPN transistor. I showed it on the emitter side of the transistors. Well - shut my mouth! Sorry Mr. Bill. I screwed up again. Geez! Maybe I really SHOULD be quiet. Sit back and learn a little more before I start opening my big keyboard.

[edit] Yeah, now that I draw it out - yeah, that works and gets the parts count down by one. When Q1 is on so is LED 1. When Q2 is on so is LED 2.
Very nice. Yeah. I like that. Except - what happens if there's no signal, no high, no low? An open signal would mean both Q1 and Q2 would be off. Both the red and green LED's would be lit at about 15 mW.
View attachment 197961
(12V - 2Vf (red) - Q1 (0.7Vf) ÷ 470Ω = 20 mA
(12V - 3Vf (grn) - Q2 (0.7Vf) ÷ 470Ω = 18 mA
A difference of only 2 mA. Nobody is going to see the difference in brightness.
If a condition develops in which both transistors are cut off then both LEDs will illuminate to some degree. I had been thinking about that also.
But far more important is the question about the control circuit, which seems to have been totally forgotten.
A stack scheme is far from the best choice. The circuit that I described in words, back in post #14, can easily drive either a few LEDs or the bases of two PNP transistors controlling higher powered lights. It can be controlled by a single low current reed switch because only the bias current for a single CMOS inverter is being switched. Sorry about not having any drawing software presently available. Evidently few are able to visualize things from a verbal description. Such a terrible handicap!
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
5,976
I have used paintbrush for many years. I DID have a file of all kinds of schematic components I could copy and paste from but somehow that file has been lost. Still, it's easy to draw a circle then add in the lines that indicate a BJT or a FET. Gates, buffers, amps, resistors, coils and capacitors can all be drawn once (or twice), four times in the case of diodes (left, right, up, down) and then cut and pasted into your drawing. I've even drawn more complicated halves of a circuit then copied, pasted then inverted the drawing to attach it to an un-inverted section to complete a drawing.

I have LT Spice and could draw a circuit there but I'm not real practiced with it, and finding components that match my needs is confusing to me. I need more practice with it.
 

MisterBill2

Joined Jan 23, 2018
8,761
My computer with Autocad and winXP was the victim of a lightning direct hit last summer. I don't use simulator software, and purchasing a version of my program that will run on win7 or win10 would be very expensive indeed.
 

Tonyr1084

Joined Sep 24, 2015
5,976
My computer with Autocad and winXP was the victim of a lightning direct hit last summer. I don't use simulator software, and purchasing a version of my program that will run on win7 or win10 would be very expensive indeed.
I loved XP. I still have a computer - should I put it together again, that runs Paintbrush. But my main computers are iMac's. There was a paintbrush app that could be downloaded either for free or for a few bucks. I just had to have it.

My wife had a Windows computer that came with Win-8. She upgraded (for free) to Win-10. I've hated Win-7 and up, but I need the windows computer to run a Hantek computer based oscilloscope. I have the REAL DEAL oscilloscope - not an expensive one, can't do as much as the Hantek, but that's the one I go to when I want to see a sine wave.

But Paintbrush ? ? ? I love it.
 

Reloadron

Joined Jan 15, 2015
5,934
@Sensacell, yes, the picture in post #42 IS bad. That's the point I was making. You can see how there's current flowing from positive to negative at full current through the two LED's. I set it up the way MisterBill2 was suggesting. Post #41. Or at least that's what I took Mr. Bill to be saying.

Wait a minute. I think I misread Mr. Bill's comment. I believe he was suggesting putting the resistor in series with the collector of the NPN transistor. I showed it on the emitter side of the transistors. Well - shut my mouth! Sorry Mr. Bill. I screwed up again. Geez! Maybe I really SHOULD be quiet. Sit back and learn a little more before I start opening my big keyboard.

[edit] Yeah, now that I draw it out - yeah, that works and gets the parts count down by one. When Q1 is on so is LED 1. When Q2 is on so is LED 2.
Very nice. Yeah. I like that. Except - what happens if there's no signal, no high, no low? An open signal would mean both Q1 and Q2 would be off. Both the red and green LED's would be lit at about 15 mW.
View attachment 197961
(12V - 2Vf (red) - Q1 (0.7Vf) ÷ 470Ω = 20 mA
(12V - 3Vf (grn) - Q2 (0.7Vf) ÷ 470Ω = 18 mA
A difference of only 2 mA. Nobody is going to see the difference in brightness.
At what point on the signal input will Q2 be in saturation and Q1 Off? That is what I am not understanding. This is what I was questioning in post 44.

Ron
 

Tonyr1084

Joined Sep 24, 2015
5,976
Only the transition between high and low would there be an overlap. Depending on the transistors and their "Delay" "Rise" "Storage" and "Fall" times, overlap might be a concern when switching from a gate or other rapid state changing device. But since the TS is considering a reed switch - there's a propagation time between ON and OFF where - depending on the circuitry, overlap will probably not be an issue. Holding the signal high through a pull-up resistor then switching on via the reed switch - a ground signal (or low) there should be very very little overlap. And we're not talking about high frequency, we're talking about a state of being ON or a state of being OFF for long periods of time. The only thing changing the state of the output is the arrival and backing in of a trailer. Lights will be in one state until they're changed into the other state. The green light is on. A trailer arrives, the light changes to red, then the trailer is unloaded or loaded (or both) then pulls away and then the lights switch back to green. The period of time where the transistors are both on simultaneously is very very limited. In This thread I asked about the overlap of timing of transistors. Read as much as you care to.
 

ebeowulf17

Joined Aug 12, 2014
3,276
@Sensacell, yes, the picture in post #42 IS bad. That's the point I was making. You can see how there's current flowing from positive to negative at full current through the two LED's. I set it up the way MisterBill2 was suggesting. Post #41. Or at least that's what I took Mr. Bill to be saying.

Wait a minute. I think I misread Mr. Bill's comment. I believe he was suggesting putting the resistor in series with the collector of the NPN transistor. I showed it on the emitter side of the transistors. Well - shut my mouth! Sorry Mr. Bill. I screwed up again. Geez! Maybe I really SHOULD be quiet. Sit back and learn a little more before I start opening my big keyboard.

[edit] Yeah, now that I draw it out - yeah, that works and gets the parts count down by one. When Q1 is on so is LED 1. When Q2 is on so is LED 2.
Very nice. Yeah. I like that. Except - what happens if there's no signal, no high, no low? An open signal would mean both Q1 and Q2 would be off. Both the red and green LED's would be lit at about 15 mW.
View attachment 197961
(12V - 2Vf (red) - Q1 (0.7Vf) ÷ 470Ω = 20 mA
(12V - 3Vf (grn) - Q2 (0.7Vf) ÷ 470Ω = 18 mA
A difference of only 2 mA. Nobody is going to see the difference in brightness.
Why not just separate the two LED paths? I don't see any benefit in tying them together.

Right now, there's a single net joining the emitters of Q1 and Q2 with LED2 cathode and LED1 anode. Eliminate that shared net, then replace it with two separate nets:
One joins LED2 cathode with Q2 emitter.
Another joins LED1 anode with Q1 emitter.

With this arrangement, all the questions of shoot through and timing irregularities go away, right?
 

MisterBill2

Joined Jan 23, 2018
8,761
At what point on the signal input will Q2 be in saturation and Q1 Off? That is what I am not understanding. This is what I was questioning in post 44.

Ron
My most recent post I intended to reference post #14, a verbal description of how to do the whole thing without a totem-pole arrangement.
 

Tonyr1084

Joined Sep 24, 2015
5,976
I think we've gotten off on arguing different methods of establishing a red or green light. The TS wants to back a trailer up to a loading dock and have a green light turn red when the trailer is in place. The units he linked us to have numerous options. He certainly could build a circuit if he wanted to - but there's already product he can buy. Since he's already planning on buying the lamp unit - spending a very little more will get him the red and green switching he is after. He has his choices of 12VDC, 24VDC (DC is assumed) or 110 VAC. He can get them with or without power supplies. With or without light switching circuitry. Flashing and steady (I think) are also available. I've seen the same thing at many loading docks. I've seen green, yellow and red units where yellow indicates to the driver he's almost there.

The TS has options. In according with his asking how to build a circuit - that's been answered by several different people. Your approach may very well be viable. Draw a picture and post it. That way I don't get confused with what you're saying.

I think, am not sure, but can you put a reed switch with a magnet - say the north pole - behind a reed switch and hold it closed. When another north pole magnet approaches the two opposing poles cancel each other out and the reed switch opens? Maybe I'll give that a try some time. If so that would be a sweet door open alarm for my freezer. When closed two magnets cancel each other out and the reed switch remains open, not sounding an alarm. When one magnet is pulled away the reed closes and sounds a door open alarm. With an adjustable proximity the sensitivity of the alarm could be adjusted. I may just revisit this idea some day. I once tried using a gate to invert the signal but that drained my battery for some reason.
 

MaxHeadRoom

Joined Jul 18, 2013
23,111
I think, am not sure, but can you put a reed switch with a magnet - say the north pole - behind a reed switch and hold it closed. When another north pole magnet approaches the two opposing poles cancel each other out and the reed switch opens? Maybe I'll give that a try some time. If so that would be a sweet door open alarm for my freezer. When closed two magnets cancel each other out and the reed switch remains open, not sounding an alarm. When one magnet is pulled away the reed closes and sounds a door open alarm. With an adjustable proximity the sensitivity of the alarm could be adjusted. I may just revisit this idea some day.
You can get N.C. reed switches which should do the same thing with one magnet!
Max.
 

Reloadron

Joined Jan 15, 2015
5,934
The base of Q2 needs to be more negative than the emitter by at least 0.7 volts. The signal line can't go below zero volts. When the signal line is high Q1 is On correct? Q1 Emitter will be at about the forward voltage drop of LED 1 and the Q1 base will be well over saturation point. So now I make my signal line Low. That will turn
I think we've gotten off on arguing different methods of establishing a red or green light. The TS wants to back a trailer up to a loading dock and have a green light turn red when the trailer is in place. The units he linked us to have numerous options. He certainly could build a circuit if he wanted to - but there's already product he can buy. Since he's already planning on buying the lamp unit - spending a very little more will get him the red and green switching he is after. He has his choices of 12VDC, 24VDC (DC is assumed) or 110 VAC. He can get them with or without power supplies. With or without light switching circuitry. Flashing and steady (I think) are also available. I've seen the same thing at many loading docks. I've seen green, yellow and red units where yellow indicates to the driver he's almost there.

The TS has options. In according with his asking how to build a circuit - that's been answered by several different people. Your approach may very well be viable. Draw a picture and post it. That way I don't get confused with what you're saying.

I think, am not sure, but can you put a reed switch with a magnet - say the north pole - behind a reed switch and hold it closed. When another north pole magnet approaches the two opposing poles cancel each other out and the reed switch opens? Maybe I'll give that a try some time. If so that would be a sweet door open alarm for my freezer. When closed two magnets cancel each other out and the reed switch remains open, not sounding an alarm. When one magnet is pulled away the reed closes and sounds a door open alarm. With an adjustable proximity the sensitivity of the alarm could be adjusted. I may just revisit this idea some day. I once tried using a gate to invert the signal but that drained my battery for some reason.
Then all things considered I would think about an interrupt light beam similar to what we see used on garage doors for safety. The problem I see with for example a sensor like a magnetic proximity sensor or hall effect sensors is they have limited distance detection. This way an off the shelf turn key solution can be used in conjunction with the lights liked to earlier. I would also select something which will function in the environment of the loading dock in question.

Ron
 

Reloadron

Joined Jan 15, 2015
5,934
My most recent post I intended to reference post #14, a verbal description of how to do the whole thing without a totem-pole arrangement.
Yes, and somewhere back there I agreed with your suggestion as to just using a SPDT reed switch. Not sure how it could be fit into the loading dock scheme but it would be simple and I figured reliable. Heck, we only have red or green. The dock is either ready or not ready to receive or load. Even in the case of large docks with multiple slots. Anyway, I absolutely had to agree with your post 14 as to simple and reliable.

Ron
 
Top