?

Log in

No account? Create an account
Adventures in Engineering
The wanderings of a modern ronin.

Ben Cantrick
  Date: 2006-01-10 08:11
  Subject:   The joys of analog circuit design.
Public
  Mood:der uber-nerd
  Music:Daft Punk - Technologic

So I've been trying to make a good thermistor monitoring and heating element regulating circuit for a while now. I finally settled on a three stage design, something like:

Wheatstone Bridge -> Differential Voltage Amplifier -> Schmitt Trigger coil control

About three weeks ago, we ordered some thermistors and heating coils from http://www.minco.com and we finally got them in today. This evening I built the first two stages of my prototype circuit and tested it. It failed miserably the first time around because the inputs to the diff amp were very high impeadance. I had to throw another dual opamp chip into the circuit to buffer them before they got to the actual diff amp stage. So now it looks like:

Wheatstone Bridge -> Dual buffers -> Diff Voltage Amp -> Schmitt Trigger coil control

Once I added the buffers in front of the diff amp, the circuit started working beautifully. It's working so well I could almost toss the Schmitt trigger stage and just let the diff amp drive the big transistor that switches current through the coil. I put the thermistor under my tongue (to warm it up to body temperature) until the diff amp stabilized, and then pulled it out and counted one one-thousands. It had driven itself hard to the positive rail (~7.65V, indicating low temperature sensed and a need to switch on the coil) just before I got to 3 one-thousand. Also, currently the sense and drive circuitry is taking just less than 3mA to run. I'm amazed! I knew the circuit was efficient, but that's frikkin' ridiculous. It may double to 6mA when I throw in the Schmitt trigger, but even so that's an order of magnitude less current than anything else I've ever done. The functionality per coulomb is staggering. abelits hung out for dinner this evening, and we laughed about people who would waste a whole microcontroller w/ADC on this kind of a project. Sledgehammer to swat a fly indeed. And you'd probably have to end up using an instrumentation opamp anyway...

Speaking of! I'm wryly amused about the fact that in the revised design, the second and third stages together form a ghetto Instrumentation Amplifier. That's exactly what I've been trying to avoid putting into this thing from day one! The reason was cost - good Instrumentation Amps can cost $5-$10 per chip. So now I have to use half of a $0.50 chip and a bunch of resistors to reinvent a crappy version of what I'm not willing to buy for $5. Oh the irony...

But it all works out for the best, because it's been a design goal of mine all along to do the whole thing with just one chip. That was easily possible when the whole thing was designed around two opamps. Now I'm on the hook for four opamps, and I was worried that I might have to resort to more than one chip. Luckily for me, quad opamp chips (Moto MC3403) are abundant, and in some cases even cheaper than the dual opamp chips (Nat'l Semi LM1458) I was using before. I was looking at Digikey and the new chips cost about $0.70 in quantity 1, which compares reasonably favorably with the old chips which were about $0.55 in qty 1. Though JB Saunders had the LM1458's for $0.15! Of course, the legs on the ones they gave me are a bit corroded, though it doesn't seem to have messed up their functioning at all. I'll go look for MC3403's or similiar quad opamp chips tomorrow. I guess I could also buy Radio Smack JFET quad opamps but those cost a whole $0.79 each! And I'm hoping that (minus the thermistor and coil) I can get all the components in for under $1.

Tomorrow I still have to design the Schmitt trigger stage and dig up some quad opamp chips. But hopefully by the end of the day we'll have a correctly working prototype. Then I can start on the physical parts of the device. Neoprene pouch, watertight bag, etc. And then after that, the PCB layouts and such. I'm looking forward to that as well. With such a tiny design (one real chip, less than 20 passives) doing PCBs would hardly be work even for someone who did this kid of stuff professionally. To me it's just plain fun because I haven't really done it before. I think if I pull this whole thing off well it'll be quite the resume item. I keep telling people that I really can do both hardware and software, but without some experience to prove it I can't ever get a job doing it. (And of course, without a job doing it I can never get the experience. Lovely little self-perpetuating cycle.)


It's probably obvious from the endless stream of blather, but I'm really enjoying this project. There have been some short periods of frustration but in general I've learned a hell of a lot and had a chance to do a lot of things that computer nerds don't generally get to do. I'm also proud that I haven't had to resort to asking for help during implementation. Though I do thank wohali for brainstorming with me in the early stages of the design, and abelits for pointing out a stupid mistake I was about to make in the design of the Wheatstone bridge that would have cost me about a factor of ten worth of voltage differential. Working with thermistors is a great thing too, because they're not very different in theory from strain gauges, which I am going to have to learn how to use when I start making the exoskeleton force sensors...

Edit: Here is a nice little Flash tutorial on op-amps.
Post A Comment | 7 Comments | | Link






Ben Cantrick
  User: mackys
  Date: 2006-01-11 09:51 (UTC)
  Subject:   Switched to an LM348 quad opamp chip today.
As the data sheet of this new chip claimed, power consumption is unchanged. 3.1 mA. Booya! Of course, the heat coil is going to be sucking down 300 mA, so my power frugality in the control logic is really quite pointless...
Reply | Thread | Link



Nuclear Bastard
  User: nuclearbastard
  Date: 2006-01-12 07:11 (UTC)
  Subject:   (no subject)
http://orlymastersystem.ytmnd.com/

I am Dani-chan's husband. Based on your response to that cat ransom thing, thought you would like this.
Reply | Thread | Link



Ben Cantrick
  User: mackys
  Date: 2006-01-12 23:06 (UTC)
  Subject:   (no subject)
Yeah, that cool. I saw it when Dani posted it. Thanks!
Reply | Parent | Thread | Link



Alex Belits: iskra
  User: abelits
  Date: 2006-01-16 02:00 (UTC)
  Subject:   (no subject)
Keyword:iskra
Did you, by any chance, end up with a too high value of the resistors on the side of the bridge attached to the inverting input, because feedback circuit makes effective input impedance lower, and bridge suddenly has to take that into account? IIRC, you can just reduce those without affecting the non-inverting side with the sensor.
Reply | Thread | Link



Ben Cantrick
  User: mackys
  Date: 2006-01-17 10:13 (UTC)
  Subject:   Not sure I understand the question...
Did you, by any chance, end up with a too high value of the resistors on the side of the bridge attached to the inverting input?

Doesn't seem like it. The bridge is basically constant 30K resistances on all four legs. (Okay, I'm lying a bit - one leg has 25k worth of resistors and a 10K ceramic trim pot. But that's just so you can match the resistance of the thermistor exactly.)
Reply | Parent | Thread | Link



Alex Belits
  User: abelits
  Date: 2006-01-18 02:01 (UTC)
  Subject:   Re: Not sure I understand the question...
The problem is that the feedback resistor also participates in this circuit, and this is what makes the input impedance of the whole thing so low that you need an additional buffer. Your bridge will still work if you reduce the values of resistors on one side proportionally, say, to 3K between inverting input and both power rails, and keep both 30K, including the sensor, connected to the non-inverting input. If you do that, the feedback resistor won't be affecting it as much as it does now, and you will just treat it as a low-impedance input. If that will result in a too high gain of the amplifier, you can add one more resistor between the bridge and its inverting input -- I think, it won't be too difficult to balance, considering that all you really need is a stable but easily adjustable voltage on that side, proportional to whatever the power supply produces.

At the same time the non-inverting input will have the same high impedance as if the additional buffer was there, so high resistance on that side of the bridge won't cause any problems.
Reply | Parent | Thread | Link



Ben Cantrick
  User: mackys
  Date: 2006-01-18 06:48 (UTC)
  Subject:   (no subject)
Ah, I see what you're saying. I have two reasons for not doing things that way...

First, this thing runs off batteries and every mA/hr counts. If I reduce the resistors on the bridge, that's more current that I'm flowing all the time.

Two, I have the opamps available to do the buffering. The quad opamp chips are acutally cheaper than the dual ones. Given it's cheaper to have the buffers in place anyway, and its a win on current draw, I'm inclined to keep the design as is.
Reply | Parent | Thread | Link



browse
May 2015