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.

Help needed with a component recomendation

Status
Not open for further replies.

Kevin_B

New Member
Hello all, I'm looking for a component recommendation for a unity gain analog inverter. I have available a regulated 5v DC supply and a stable ground supplying various sensors whose outputs serve a sealed black box computer. The computer generates various control signals up to 12 volts DC, it's about the size of a text book, 20 to 30 years old I'm guessing, runs warmish, and is powered by 12vDC. That's about all I can say of it.

I need to add a sensor, which the computer can accommodate, but I have to invert its output. The new sensor will be excited off the 5v rail and outputs a signal between 1 and 3.5v. I'm thinking the signal level will vary on the order of 1Hz or so at the fastest, for the most part it'll just hold at a stable level around 1.5v and only periodically raise in response to a mechanical event.

Until the circuit's in operation there's not much I can measure so far as current, and even then I cannot really control or predict the real world event(s) that trigger the sensor, but I also have no reason to believe changes in signal voltage will appreciably effect changes in current. The computer's input pin measures 107kΩ relative to ground when powered on and 101kΩ when powered down. Otherwise I have no idea what's on the other side of that pin or if other operational conditions change the input resistance, but probably not. Also, all associated diagnostic procedures are based on measuring voltages with a generic voltmeter and the thin gauge of the system's hard wiring both suggest there's never a point much amperage is involved on any of these signal lines. Also, given where and how the system works and its other sensors I'm thinking we can discount noise considerations. This is a pretty rudimentary process control application, it's an old sawmill actually.

The goal here is to invert the new sensor's output such that 3.5v translates to 1 volt, 1 volt translates to 3.5v, and all ranges in between similarly and linearly translate across the full range of positive voltages. There's definitely vibration involved, and moisture too, at times lots of it, there's also dirt, dust, and at times maybe up to 120°F. I'm picturing a 1"x 1" breadboard glued to the body of the sensor all of which is then sealed in a vinyl dip and bolted as safely as possible beneath a frame member. I can bench test the inverter circuit and sensor by simulating the assembly's operation, but I cannot test the whole of it in actual operation. If it doesn't work in situ I may not know that for several weeks. Basically, once it's installed that's it. It's got to work and work reliably while giving no indication if that's actually the case or not. I'm placing my faith in the notion that if it works on my bench, it'll work in the machine...

I'm not sure there's much more I can add here, I do not have access to another system I can measure anything from and not much more I can characterize about what I do have. Nonetheless this basically seems pretty simple, it's just not the kind of project I have much experience with. I considered using an op amp, but I'm not sure if the operational conditions (vibration, uncertainty about current, low frequency) make that a good idea. I then thought about using an NPN, but discrete component design is taking me even further away from anything I have experience with. I can solder pretty well so I'm not too concerned about fabrication, but I am concerned about practicality, reliability, availability, and time. I have only about a week to get this figured out so components I can buy from Radio Shack (our only and nearest electronics supplier) would be really helpful. I'm in a remote place in Southwest USA. Anything needing to be shipped here will exceed my time budget for sure.

Given the factors involved what basic component(s) would be best to build this around? Sorry for the long story but thanks in advance for giving it thought.
 
Radio Shack is a shadow of its former glory.
Can you check with you local store to see if they have one of these in stock?
There are much better parts available from real vendors. Here in rural AZ I can get any parts I want from a supplier like Digikey in a day or two. Could you work with that?

If all you can get is what comes from RatShack, can you get these parts?

D10.png


The LM324 is a bit marginal in this application if operated from 5V. Can you use the 12V to power the opamp?
 
Last edited:
Everybody, read this... You might learn something :p

After a night's sleep, it occurred to me how to make the LM324 work reliably at 5V, so this version eliminates the +12V supply connection.

There are two issues with using the LM324 with only a 5V supply: the input pin common-mode range cannot go above 3.5V, and the LM324 struggles to pull its output above 3.5V.

I solve this using more resistors, however six of them are the same value; 100K. ( I tried to pick resistor values you are likely to find at RS)

I make a 2:1 attenuator which reduces the peak input voltage to U1 to 1.75V and then use a LM324 section to buffer that. I set the gain of U2 to -2 to compensate by the ratio of R6//R7 to R8.

Now the ref voltage should be 1.50V. I got close ( 1.49V) using standard 5% resistor values. If you want to tweak the offset, you can play with R3, or make it a trimpot.

C2 rolls off the high frequency gain because LM324s are known to be a bit noisy. I added R9 to help U2 drive its output pin to 3.5V which it might otherwise not reach on a 5V supply. This compromises the intrinsic PSRR of the LM324, so the 5V supply had better be "clean".

The plots show V(s2), V(output), and V(ref) plotted as a function of V(sensor).

D10a.png
 
Last edited:
Damn, I over-complicated it. Even with the first version, the non-inverting input of U1 never goes higher than 2.25V, so the input common-mode issue doesn't apply. So go back to version D10, power it on 5V instead of 12V, eliminate R5, and add the 2.2K pull-up resistor between the LM324's output pin and +5V to compensate for not having a rail2rail output.
 
Last edited:
Mike, thank you so much. Radio Shack had an LM324 (exactly one) so I grabbed it. I probably have most/all the rest of what's needed in my own stash but didn't have time to check as RS was about to close and I wanted to at least get the IC. I'll figure it out.

I totally agree about DigiKey being a much better outfit. We're in Silver City, NM however, delivery of anything around here is a sketchy proposition even on a good day. This time of year, a week before Christmas, there's no way I'd expect to get anything delivered here on time, if at all. I could totally go on a rant about this. Anyway, you're in AZ, I guess that makes us neighbors.

Just to make sure I've got this right, is this the final design you're suggesting?

upload_2016-12-19_18-46-56.png


Obviously not the NPN route. I'd love to know what drove your decision on that.

As for using 12v, it wouldn't be impossible but it would be nasty. There's about 40' of distance between the two and any wiring involved has to be protected in EMT, of which there is one, but pretty packed. There just happened to be an unused wire available I'll use to convey the new sensor output, but getting another line stuffed in there for power would be seriously frustrating. Yeah, I could run another length of conduit and put one wire in it, but all in all the 5v solution is a whole lot more attractive so I'm glad we ended up back there.

As for C2, I realize I left something out of the original description. I'm pretty sure the computer involved (and I am using that word loosely), is just looking for a couple of threshold voltages. I do not believe it's sampling the sensor signal as such, in fact it may well be an analog computer. There's no human I/F, just wires in / wires out and nothing digital on any of them. For the price of a cap for sure I'll include C2, but I really suspect noise would have to be crazy high to have any effect.

So thanks again for your assistance, I'll get this together and we'll see if it flies. Cheers, kb
 
The upper half of the voltage divider that makes V(ref) is missing. It was R2 in post #2 (D10). Otherwise ok.

I jumped to the conclusion that you needed a linear circuit with a gain of -1, centered around the input range. If you are confident that all you need is "logic" inverter, there may be a simpler way to do it, however, you would need to know the logic threshold, e.g. CMOS (~2.5V) vs TTL (~1.4V) or whatever?
 
Last edited:
> The upper half of the voltage divider that makes V(ref) is missing. It was R2 in post #2 (D10).

Isn't that the resistor shown just beneath C2?

> I jumped to the conclusion that you needed a linear circuit with a gain of -1, centered around the input range.

To the extent that's not an accurate conclusion, it is the prudent one. I'm pretty confident designing to that function will work, at least nothing suggests otherwise. It may be that a simpler solution would also work but we'd have to delve a lot deeper into the unknown to find out. Unless we stood to earn some far greater coefficient of reliability from that investigation I can't see there'd be anything to gain by it, it seems to me we've got a robust design here.

I don't know why I didn't think of this, but I'm assuming you selected the values of R1 and R2 based on my measured resistance found across the computer's input pin. Now that I'm seeing it like that it's obvious, I just didn't think of it, I was just thinking I'd need matching resistors there. Your way neatly resolved my uncertainty about current. I'm also sorry to say I wouldn't have thought to clamp the unused outputs, nor thought to use C2 either. Actually I was heading down the transistor path, so thanks again for steering this project in the right direction.

As for the voltage divider, I'm good with R2, right?
 
>
As for the voltage divider, I'm good with R2, right?
No, put back R3, as shown below. Note that my reference designators are different than yours. The voltage divider R3/R4 make V(ref)=~2.25V

Actually, 5.00V*(220K/(220K+270K)) = 2.245V

The load impedance on the sensor is ~100KΩ.

D10f.png
 
Last edited:
Mike, thanks for that last minute catch, here's what happened.

The output range turned out to be a bit wider than the input, but otherwise the circuit does exactly what it needs to do. On consideration I realized that result might actually be advantageous so I decided to leave it that way, call it a feature, and let user feedback cast the final vote. Okay, so I had to rifle through my hat collection till I got the one labeled Marketing Department; but sometime those guys make the right call.

Meanwhile, the component list ended up making the final assembly a larger than expected turning protection, mounting and placement issues into a mechanical puzzle. In retrospect, I should have first put it together on a breadboard then compacted that layout in its transfer to perf board, or better yet, refined the layout on paper before doing any assembly. I skipped past those approaches thinking there were only a handful of parts involved I could take straight to their final assembly. Yeah right, a time saver...

Anyway thanks again to you and everyone on this board, I hope you all have a wonderful Christmas and New Year holiday season. May all our 2017 inventions and concoctions be good ones. - kb
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top