Shop OBEX P1 Docs P2 Docs Learn Events
Lots of Temperature sensors to monitor - Page 2 — Parallax Forums

Lots of Temperature sensors to monitor

2

Comments

  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-09-06 08:38
    I agree with Loopy, per the initial alternative suggestions. One-wire is least hassle, least pins, fewest analog issues. PWM with TMP05 in daisy chain mode could be a close second.

    Kwinn, like Duane J, I have trouble with the mux in post #18. Consider row #1 activated. Certainly there is a path through the leftmost thermistor to channel 0 input and from there through the reference resistor to ground. But there are also paths up through the other three thermistors attached to channel 0 to their row power supplies (which are off), and back down through every other thermistor attached to those power supplies and then through their 10k resistors to ground. All those other paths would have to be blocked with column transistors. Another issue on cables is that all of those extra open circuits are picking up noise.
  • pjvpjv Posts: 1,903
    edited 2013-09-06 08:45
    Well then with these new requirements, Phil's suggestion of a TI MSP430 with the internal temperature sensor is your simplest -hardware at least- and lowest cost answer. It draws almost no power, and you can write software in it to mimic the One-Wire protocol. I did that years ago, and could send you the code.

    Numerous units communicate on a single 'party-line' bus over long distances, totally reliable. I have also developed other sensors and control functions to fit compatible over the same comms line. And a Prop is the interrigation and power management unit.

    Very inexpensive... less than $1.00 per node. I bought hundereds of the non-temperature version for 50 cents as I recall.

    I can't think of a better/cheaper/reliable answer for you. But you probably will have to get into the 430 software a bit...... not a bad thing at all. Once you become familiar with that chip, you'll use it for lots of 'glue' applications.

    Cheers,

    Peter (pjv)
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-09-06 10:20
    Here is a different method based on measuring the forward voltage of a diode.
    With a constant current flowing through the diode the voltage is dependent on the temperature.
    The voltage is highly linear vs temperature.
    Ideally a current source would be preferred, however a simple resistor works quite well.

    Here is a schematic snippet that uses an MCP3208:
    Sensor_Diode-Temperature-Array.png


    I have used this technique for an array of 16 x 32 or 512 diodes.

    Calibration is required at 2 points, room temperature and maximum temperature.

    Duane J
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-06 10:44
    Duane,

    Yes, in theory, that would work. But I shouldn't think that voltage output would be the way to go with long cables to consider.

    -Phil
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-09-06 11:50
    Oh! MPS430. I should have made the connection from Phil's earlier comment. It's amazing what can be crammed into a micro, most of it excess baggage for your simple application, but still at much lower cost than the individual function due to economies of scale.

    I looked at the MPS430G2230 data sheet, and it says the calibration for temperature is,
    VSensor,typ = TCSensor T [°C] + VSensor(TA = 0°C) [mV]
    I'm wondering how much individual calibration is going to be required, if any ? Say what if for example you want to match the ±0.5°C accuracy from -10°C to +85°C that you get with a DS18B20 right out of the box?

    The DS18B20 in a TO92 package with two wires is easy to mount on the end of a cable, even in a stainless steel thermowell for poking into the soil. Dealing with an SOIC8 or more parts-wise is going to be more awkward mechanically. The overall evaluation of which sensor is best has to take in a lot of application specific requirements.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-09-06 12:01
    I suspect the deciding factor is the actual distance in a physical network.

    1-wire will work up to a point, but the TI MSP430 might allow RS485 communications if an added driver/receiver chip is attached.
  • pjvpjv Posts: 1,903
    edited 2013-09-06 12:45
    Loopy;

    That's exactly what I do for industrial applications.

    Then I use a 6 pin RJ style telephone connector receptacle for the module; pins 1&6 are +Power, pins 2&5 are Common, pins 3&4 are Signal A/B. This makes the bus readily compatible with "pure" 1-Wire (no power line) devices for which I use 4 pin connectors whose pins 1&4 are Common, and pins 2&3 are Signal A/B.

    Cheers,

    Peter (pjv)
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-09-06 21:28
    Hi Phil
    Duane,
    Yes, in theory, that would work. But I shouldn't think that voltage output would be the way to go with long cables to consider.
    I have been using diode temperature sensors for many years.
    That 512 diode array was used to measure the exit temperatures of a computer card cage. This was calibrated to 1/10th degree F. Really worked well. The computer used was a Radio Shack model 100.

    The impedance of a diode sensor is relatively low even at low excitation currents. If noise is found to be a problem a small shunt cap, 0.1uF, really helps. For distances up to 100 feet or so a 1uF cap at both ends works better. Ok, the caps slow things down a bit.

    The venerable 1N4148s work well.
    And the 2N3904 NPN transistor with the base connected to the collector works better.

    Actually I wouldn't expect much problem with noise in a compost pile as everything should be well grounded.

    Of course thermocouples would be the nicest sensors. To bad they are hard to use and can't be multiplexed.
    I personally use old rotary telephone stepping relays with them. I have a Prop running FemtoBasic controlling it. While they are antiques they are not that rare nor expensive. Usually there are always a couple on ebay.

    Come to think about it stepping relays would do nicely with diodes and thermistors too.

    Duane J
  • ercoerco Posts: 20,257
    edited 2013-09-06 21:52
    The process being monitored is some kind of composting, so the accuracy should be degrees or tenths of a degree;

    I had no idea that composting was such an exacting science. Guess I'll have to "correct" the wife. She's been doing it successfully, probably because (like the bumblebee) she doesn't know she's doing it all wrong. :)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-09-07 01:17
    pjv wrote: »
    Loopy;

    That's exactly what I do for industrial applications.

    Then I use a 6 pin RJ style telephone connector receptacle for the module; pins 1&6 are +Power, pins 2&5 are Common, pins 3&4 are Signal A/B. This makes the bus readily compatible with "pure" 1-Wire (no power line) devices for which I use 4 pin connectors whose pins 1&4 are Common, and pins 2&3 are Signal A/B.

    Cheers,

    Peter (pjv)

    RJ connectors and telephone wires.. Yes, I use the 4 pin, the 6 pin, and the 8 pin in different situations. They are great connectors and easy to purchase. Plus the modularity allows the builder to quickly change configurations. To get to a printed circuit board, I generally use an RJ socket with wires as a dongle. Building boards to accept the RJ connector sockets can add expense.
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-09-07 12:03
    erco wrote: »
    I had no idea that composting was such an exacting science. Guess I'll have to "correct" the wife. She's been doing it successfully, probably because (like the bumblebee) she doesn't know she's doing it all wrong. :)

    I would not risk correcting the wife based on anything I post. I chose tenths thinking it would be at least 10x better than what is needed, and if got a little worse it would still be OK. The client did not clue me in on the details yet. I have the impression they are doing biofuel from waste vegetation or something. I just want with a general "temperature monitoring for cheap" solution, and refine it as better requirements trickle out.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2013-09-07 13:12
    If your clients are strictly controlling what kind of microbes they are using for composting, then I think the DS18B20 might be autoclavable. They are rated for 125 C, and IIRC, I've run some through the autoclave without any dramas. In fact I'm often impressed by what sort of things can survive an autoclave - LEDs, for example, and I think some light-to-frequency chips have made the journey, too.
  • kwinnkwinn Posts: 8,697
    edited 2013-09-07 18:46
    @Duane C. Johnson & Tracy Allen

    Well that's a little embarrassing. You are both right it certainly won't work without diodes, which I forgot to include.

    Corrected and re-posted the schematic in the original post (#18).
  • ercoerco Posts: 20,257
    edited 2013-09-07 20:07
    I would not risk correcting the wife based on anything I post.

    Too late, prof! The wife threw me out on my duff and since it's basically your fault, I'm heading to Chicago to bunk in with you for a while. Chi-Town is a fun place, we'll have a ball. Carson's Ribs, Lou Malnatti's butter crust, Giordano's stuffed crust, R&R McDonald's, etc.

    If the Excalibur nightclub is still bangin', we can party late then code into the wee hours of the morning. Gotta keep your client happy!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-07 22:39
    erco wrote:
    Chi-Town is a fun place, ...
    'Too bad the old Checkerboard closed down on the South Side, though. 'Looks like it's been reborn in Hyde Park, but it won't have the same funky ambience.

    -Phil
  • prof_brainoprof_braino Posts: 4,313
    edited 2013-09-08 06:57
    erco wrote: »
    Too late, prof! The wife threw me out on my duff and since it's basically your fault, I'm heading to Chicago to bunk in with you for a while. Chi-Town is a fun place, we'll have a ball. Carson's Ribs, Lou Malnatti's butter crust, Giordano's stuffed crust, R&R McDonald's, etc.

    If the Excalibur nightclub is still bangin', we can party late then code into the wee hours of the morning. Gotta keep your client happy!

    Now yer talkin`! If the client reimburses me for the equipment, I should have enough for pizza and a couple beers. I hope he pays with money, and not compost. Probably should have clarified that up front or something.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-09-08 10:21
    But will those beers be inbibed behind home plate for the 'sox or the ever hopeful cubs?

    On topic: How about a wireless deep do-do version running from coin cells or some kind of bio-reacted energy? MPS430. They might get lost in the mix, so you'd need a robotic track and retrieve module. They do turn the compost don't they?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-09-08 10:49
    Kwinn,
    Uhhh, the forward drop of diodes in series with the thermistors will have to be accounted for. It becomes a hybrid between the thermistors and the diode system Duane J proposed. I'd prefer using an analog mux such as the CD4052 (dual 4-channel) to attach one thermistor divider at the time to the common ADC channel. That also isolates the active channel from the noise that might be present on other lines.

    Prof,
    Analog multiplexers from Campbell Scientific (specializing in outdoor environmental and outdoor process instrumentation) are worth a look to see how they do their multiplexing. For example their old standby AM16/32 uses reed relays to attach one channel at a time to the ADC. The channels are heavily isolated and protected from ESD. They also have a model AM25T that uses optically isolated 500Ω mosfet SSRs to make the connections.
  • LawsonLawson Posts: 870
    edited 2013-09-09 10:39
    kwinn wrote: »
    @Duane C. Johnson & Tracy Allen

    Well that's a little embarrassing. You are both right it certainly won't work without diodes, which I forgot to include.

    Corrected and re-posted the schematic in the original post (#18).

    Actually I bet it would still work without the diodes. You'd just have massive matrix to solve with each scan to isolate the value of each thermistor. (shouldn't be too bad though, the corss-coupling isn't that strong)

    Alternatively, just use a row select FET for each thermistor. (for instance an IRLML6401PBFCT-ND would work well) I bet it wouldn't cost any more than a pile of diodes either. (just kind'a a pain to layout)

    Marty
  • kwinnkwinn Posts: 8,697
    edited 2013-09-09 19:15
    Kwinn,
    Uhhh, the forward drop of diodes in series with the thermistors will have to be accounted for. It becomes a hybrid between the thermistors and the diode system Duane J proposed.

    The effect of the diode is relatively small when compared to a thermistor, but it could be taken into account easily enough with simple calculations or as part of the calibration. How or if you do that depends on the accuracy needed for a particular application. It would not be that difficult to produce a calibration curve for all of the thermistor/diode sensors from 0 to 200 degrees F that should give better than 1 degree accuracy results.

    I'd prefer using an analog mux such as the CD4052 (dual 4-channel) to attach one thermistor divider at the time to the common ADC channel. That also isolates the active channel from the noise that might be present on other lines. ................

    Using an analog mux would also work and probably provide more accurate results, but prof_braino was looking for a simple inexpensive approach. I think this would work well for a composting operation.
  • kwinnkwinn Posts: 8,697
    edited 2013-09-09 19:18
    Lawson wrote: »
    Actually I bet it would still work without the diodes. You'd just have massive matrix to solve with each scan to isolate the value of each thermistor. (shouldn't be too bad though, the cross-coupling isn't that strong)

    That's a bet you would win. It's already done in spectrometer software to deal with inter element interferences, but it's not something I would want to try on a processor that does not have floating point hardware.
    Alternatively, just use a row select FET for each thermistor. (for instance an IRLML6401PBFCT-ND would work well) I bet it wouldn't cost any more than a pile of diodes either. (just kind'a a pain to layout)

    Marty

    The problem with using one FET per thermistor is that you would also need one control pin per FET as well. That adds chips and complexity.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-09 19:41
    kwinn wrote:
    That's a bet you would win. It's already done in spectrometer software to deal with inter element interferences, but it's not something I would want to try on a processor that does not have floating point hardware.
    It might be easy using a relaxation technique -- especially once you've got the first solution, since the individual temps won't be changing very fast.

    -Phil
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-09-09 20:51
    Hi kwinn;
    kwinn wrote: »
    The effect of the diode is relatively small when compared to a thermistor, but it could be taken into account easily enough with simple calculations or as part of the calibration. How or if you do that depends on the accuracy needed for a particular application. It would not be that difficult to produce a calibration curve for all of the thermistor/diode sensors from 0 to 200 degrees F that should give better than 1 degree accuracy results.
    Why not just chuck the thermistors entirely and just use the diodes alone.
    They are easily calibrated over that temperature range to 0.1°F accuracy. 1°F is a piece of cake.

    Duane J
  • jmgjmg Posts: 15,183
    edited 2013-09-09 21:22
    The request is to monitor temperature for a composting system.

    There would be 10 to 30 locations to monitor. They might be as close as 1 meter or as far as several meters.

    Thermistors would be the best choice, as they come in Glass packages at low cost.
    That composting environment will be very corrosive, so a sealed sensor and a sealed cable would give the best reliability.

    To read them, rather than use many ADC channels, it will likely be cheaper to use a Open Drain shift register, that simply selects one device at a time.

    Open drain choices could be NPIC6C596, and they have a low enough (typical) leakage spec, that they could run on a minimal interface. (even down to a one wire, mostly high scheme, with very narrow clks to advance and a simple RC in the +ve 595 lead.)

    At sub uA leakages, you can switch the sensor across the supply rails, and have only one on at a time.
    As a sync-check, make the final load a fixed resistor, clearly different from the NTC range.
    Then you can confirm how many sensors are connected, and add more with auto-sense.

    Another device that appeals for such 'smart pins' use, is the AT89LP52 - this gives 36io in a choice of 40/44 pin packages and it is a very cheap @ 65c/100, or roughly 2c per i/o.
    Each N-FET is ~ 32 ohms or roughly HC mos levels. - not as grunty as NPIC6C59x, but cheaper on a i/o basis.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-09 21:45
    Why not just chuck the thermistors entirely and just use the diodes alone.
    Maybe because the forward voltage vaires by only 2.4 mV/°C? That ain't much!

    -Phil
  • kwinnkwinn Posts: 8,697
    edited 2013-09-09 22:52
    Maybe because the forward voltage vaires by only 2.4 mV/°C? That ain't much!

    -Phil

    That's my main reason for not using diodes alone. The second is that prof_braino had already purchased the thermistors and wanted an inexpensive way to use them for this. I know there are quite a few alternative ways of doing this, some of them possibly less costly than using an array of thermistors when all the wiring and other requirements are accounted for, but an array of thermistors is pretty simple and reliable.
  • LawsonLawson Posts: 870
    edited 2013-09-10 01:02
    kwinn wrote: »
    The problem with using one FET per thermistor is that you would also need one control pin per FET as well. That adds chips and complexity.

    Why? The thermistors would still be arranged in a matrix scanned one row at a time. Why wouldn't you just connect all the gates in a given row together? (I'm assuming that 3.3 volts is used for the ADC reference and thermistor supply. With the source of each fet connected to the thermistor supply) The gates would switch relatively slowly with one IO pin driving eight fets, but I hardly think a 200-500nS switching time will matter much scanning thermistors. (and you could pick a logic level P-fet with a lower gate charge if that was a problem anyway)

    @jmg: nice idea using an open-drain shift registor or address decoder to scan an array of thermistors. Cheap and simple, though the 20-50 ohm output resistance and leakage of the gates would add some sensitivity to the controller temperature. (compensating for controller temperature would be another good reason to add a reference resistor)

    Marty
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-09-10 08:49
    What I'm thinking of is this, using the 40 cent CD4052 analog multiplexer. It has all the necessary mosfets built in, and all the necessary address logic. With an 8-input ADC plus 4 CD4052s and two address lines, the system can now handle 32 thermistors. No current flows through the mux gate, so no error. The signal to the ADC is pure ratiometric for highest accuracy and least fuss. The excitation voltage drops out of the calculation. The position of the Rref and thermistor can be flipped if it is desireable to connect one side of the thermistor to ground.
    muxThermsCD4052.png

    Whenever possible, I avoid having to calibrate. Calibration is okay in a one-off situation, or in a situation that requires exceptional accuracy, but it gets to be a real PITA when a project needs to scale up. It swamps the front end costs.
    587 x 388 - 30K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-10 10:55
    I think I'd be inclined to go with a current output topology, viz:

    attachment.php?attachmentid=103825&d=1378835707

    It has two main advantages:

    1. Cable length and resistance are irrelevant when the sense resistors are located at the mux/ADC end.

    2. Thermistors draw current only during reading => less self-heating.

    With the components shown above, a 4 - 20 mA output represents a temp range of about 45 - 100°C.

    -Phil
    840 x 540 - 11K
  • jmgjmg Posts: 15,183
    edited 2013-09-10 15:08
    I think I'd be inclined to go with a current output topology, viz:

    Interesting, but has some caveats

    * Puts more electronics at the coalface
    * Std LM317 has a Min load spec of 10mA for regulation
    * The LM317 tolerance (~ 4%) adds to the sensor tolerance
    * Low-ohm NTCs tend to be poor precision.
    Digikey shows 10k/50k/100k as the cheapest, high precision (1% in R) and available in glass.

    Current-mode is good, as it can save wires,

    A shift register design that shorts one NTC across a one wire CLK+Supply, can read in two ways
    a) Constant current (eg 500uA) will give 5V at 10k, falling as Temp rises.
    A risk with this, is if multiple shifter nodes power on, you still need enough Vcc to shift into correct mode. (can be addressed with either RST @ shifters, or a start-time switch to voltage-feed, on the host.)

    b) Current mirror/amplifier : Supply fixed Vcc, (eg 5V), and measure the current drain via current amplifier.
    5V & 10k, will give 500uA, increasing as temperature increases.

    This solution has no other error elements, and the current amplifier and load, are common to all sensor readings.
Sign In or Register to comment.