Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LM239 / Comparator circuit

Status
Not open for further replies.

Sam Jelfs

New Member
Hi, not sure if this is in the right section, sorry if its not.

just after a quick bit of help, I need to be able to determine if there is an open or closed switch in a circuit. Ive drawn a quick diagram, below, sorry for the quality, I normally use EDWin, but my version has expired... Anybody any clue if this will work. from what I know, if A is high, and there is a load in place, the LED should light, if A is low, or there is no load in place just an open circuit, then the LED should not light.

Am i right? If not, which is highly likely, how would i go about building the circuit so it would work.

Cheers

Sam Jelfs
 

Attachments

  • lm239-circuit.jpg
    lm239-circuit.jpg
    25.2 KB · Views: 406
It won't work as drawn.
If A is high to turn this on, I'm assuming the transistor is an NPN. You need to put values on the resistor and the load, and a part number for the transistor.
 
sorry, that was all done in a bit of a rush earlier... have added a few more details to it...

so do i need to add a couple of resistors on the V- side to drop the voltage?

Cheers

Sam J
 

Attachments

  • 1.jpg
    1.jpg
    30.3 KB · Views: 267
Are you saying the switch is in series with the load? Load voltage sensing is not a good way to detect the switch closure. What's the minimum current?
With a maximum of 100mA, you will only get 300mV across the load, and that will never happen with the 18k resistor.
Current sensing in the collector circuit would be better, but it's only simple over a limited range of loads.
What are you really trying to do? What loads are you trying to drive?
 
the load is variable, anything from 3:eek:hm: upwards, and it is a pyrotechnic, the point being that it has to be limited to 100mA draw, as I don't want it to go off, just to test to see if I have an open circuit or not.

Saying that, I think I'm going to have to increase the 47:eek:hm: resistor to a 91:eek:hm:, as I would like to drop the current through the pyro's.

Cheers

Sam J
 
If you are looking for an open circuit, 100 microamps would be plenty of current. I don't see why you need a transistor, just put a resistor to +5, connect the load and see if the LED lights. However, the logic is backward: the load input to the LM239 should go to the minus input so that when the voltage goes high, the output goes low. But, the input must be limited because as I pointed out before, the LM239 will not work with the input near the supply voltage. And, for that reason, the postive input should be connected to a voltage divider which will provide a voltage higher than a good load will produce.
 
sorry to resurrect this thread again... can anyone with a spare minute or two check out the circuit i'm using below, to my eye it should work, though im not so sure. the idea being that if the fuse is intact, the comparator should not conduct, and therefore a logic low will be found at the shift register input, likewise if the fuse has blown, the comparator will see the positive input as being infinitely high, and the switch will be open, so a logic high will be found at the shift register. am i correct?

oh, and the pull up resistor is an 18k, if that makes any odds. also, if that does work, can i just link all of the negative inputs together to give a common reference level?

Cheers

Sam j
 

Attachments

  • 1a.JPG
    1a.JPG
    16.8 KB · Views: 192
It should work because the input transistor is a PNP which will supply current to the fuse, but I would not call it reliable without a pullup resistor at the + input. I would put a diode from the +input to the -input to prevent the input from going to +12 volts.

Yes, you can tie the minus inputs together for a common reference.
 
cheers, have go it working now... more time accurately spent fault finding the circuit board, less time posting diagrams on forums was all that was requied, :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top