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.

Simple circuit to Invert DC from Positive to Negative

Status
Not open for further replies.

stuhagen

Member
So I have a gear set that sends a 5v trigger when it hits a detent, (normally at 0v). My new reader needs to see it as 5v and trigger to 0v. So it is basically a inverted output. This looks pretty close, but I cannot find this and not sure it is exactly what I am wanting. https://www.linear.com/product/LTC1261L

I attached what I think is my goal. If there is a simple 8-DIP IC I can buy and add a few resistors/capacitors, I am ll over this.

Stu
 

Attachments

  • DC Inverter.jpg
    DC Inverter.jpg
    18.4 KB · Views: 396
Hi,
Any comparator IC would do the job. Your two waveforms are not mirror-image inversions of each other, but I guess that's sloppy drawing o_O ? A suitable comparator is the LM311 (8 pin IC). And attached is a circuit simulation screen-dump from LTSpice using a Linear Tech comparator, the LT1017. You can use the same value resistors for the LM311 (the values are not critical, but try keeping R1 = R2). The simulation waveform is on the top of the uploaded image. The Blue waveform is the voltage source V2, the green is the output from the comparator.

If you are not restricted to 8-pin ICs then a simpler solution would be to use any of the 4000 series CMOS inverting gate arrays, eg the CD4011 Quad 2-input NAND gate array. Select any one gate, tie the inputs together, connect the voltage you want to invert to the tied inputs, and the voltage at the output is the inverted form you want.
 

Attachments

  • Comparator_Inverter.gif
    Comparator_Inverter.gif
    83.9 KB · Views: 793
Last edited:
Awesome! (Yes poor drawing in MS Paint). I have tons of extra LM311's so I would prefer to use those. If this will do the job I prefer not to have to go buy one or 2 chips just for this. I suspect this doesn't need to be a very "clean" signal. What I am doing is taking the native signal provided by a distributor (automotive) and converting to what the after market engine management wants to see. I have no answer on why it needs to be a reverse trailing signal....but that is what it needs.

Stu

PS I have the damnest time getting my LT Splice to simulate...Guess i need to read up on it more.
 
Why don't you just use a simple transistor inverter like this:
Simple Inverter.gif

Q1 can be a common small-signal type like a 2N2222 or similar.
 
Why don't you just use a simple transistor inverter like this:
View attachment 86808
Q1 can be a common small-signal type like a 2N2222 or similar.

Now this is simple and I do have a bunch of 2N2222 around. I will need a 5v regulator as the native voltage is unfiltered 13.2v Alternator. Would this have enough speed? The one above has a fast response.
 
Hi,
Any comparator IC would do the job. Your two waveforms are not mirror-image inversions of each other, but I guess that's sloppy drawing o_O ? A suitable comparator is the LM311 (8 pin IC). And attached is a circuit simulation screen-dump from LTSpice using a Linear Tech comparator, the LT1017. You can use the same value resistors for the LM311 (the values are not critical, but try keeping R1 = R2). The simulation waveform is on the top of the uploaded image. The Blue waveform is the voltage source V2, the green is the output from the comparator.

If you are not restricted to 8-pin ICs then a simpler solution would be to use any of the 4000 series CMOS inverting gate arrays, eg the CD4011 Quad 2-input NAND gate array. Select any one gate, tie the inputs together, connect the voltage you want to invert to the tied inputs, and the voltage at the output is the inverted form you want.

Should I have Vcc come into R3? I am thinking either a 8v or 5v reguator
 
............................
Would this have enough speed? The one above has a fast response.
Distributor pulses are quite slow compared to the speed of just about any electronic amplifier circuit so the response should be more than fast enough.
 
Hi Stu,
JBeng is right. And just to prove it, I ran a simulation in LTSpice (screen-dump attached). The ON time of the input waveform is 0.0001 seconds; waveform has a 20% duty-cycle. You can see that the 2N2222 is plenty fast enough to do what you want.

And regarding your previous question: Should I have Vcc come into R3? I am thinking either a 8v or 5v reguator

R3 is a so-called pull-up resistor. This is required because like many comparators, the LM311 has an open-collector output. Not having this in place would be akin to having R1 missing in the circuit shown in the image attached to the current post.
NPN_Inverter.jpg
 
OK I tested it and it worked as it should. Now my issue is the output seems to be a lot less than the 5v input. What do you think causes the output to diminish so much? Do I need to amplify the output? Here is a scope shot showing the native input on top and the output below. Not sure exactly what the output voltage of the wave form is, but maybe 1.5v
 

Attachments

  • Scope Shot.jpg
    Scope Shot.jpg
    345 KB · Views: 274
What are you connecting to the output? If the load is too low a value, it could be dragging down the output. You could try a smaller collector resistor.
 
What are you connecting to the output? If the load is too low a value, it could be dragging down the output. You could try a smaller collector resistor.

I am trying to connect to a after market car computer. This computer could not read a rising signal only a dropping one. So as you can see, this simple circuit does indeed do the job. Some of the inputs in the new car computer have options to either turn on or turn off the internal pull-up resistor. Maybe I will try both ways just to see.

Besides, did not think going lower than 1k would help. Usually I see a 2.2k as a pull-up for these applications. If my tries fail, maybe I will try a 500 ohm?
 
If it has an internal pull-up then you shouldn't even need a collector resistor. Just connect the collector to the input with the option of the internal pull-up ON.
 
Hi

I agree with Crutschow..:)

I would also try it without the cap or greatly reduce the cap size, to maybe 0.001 mfd

eT
 

Attachments

  • TransInv.png
    TransInv.png
    53.9 KB · Views: 271
Just check it with the load (computer) disconected and the pull-up resistor in-circuit, just to make sure it does what you expect (you don't have a dead transistor or a resistor you wheren't expecting).

If the connection to the computer is pulling the output down then it's drawing significant current; have a good read of the datasheet/manual to see why this could be. It could possibly be a current-loop input, a bi-directional port or something? You don't want to risk damaging the new computer by driving excessive current into it (although automotive electronics are usually pretty tough).
 
I agree with Crutschow and eTech. It doesn't get simpler than 1 resistor + 1 transistor.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top