Ben Cantrick (mackys) wrote,
Ben Cantrick
mackys

  • Mood:
  • Music:

The joys of analog circuit design.


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.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 7 comments