Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Thread Closed: Became flame-war

???
07/31/08 08:34
Read: times


 
#157155 - More hw info needed
Responding to: ???'s previous message
1) Temperature sensors seldom produce a voltage. If they do, they often cost a lot of money, or they measure temperature very badly.

The cheapest high-precision (0.5°C) sensor I know about are ds18s20 or ds18b20, i.e. Dallas one-wire sensors. Many of them can be connected to a single pin on the processor, but you only get about 1 sample/second because of the slow conversion times in the sensors. Or a ds2439 can be (ab)used which will manage about two temp samples/second and can also produce two voltage or current samples/second.

For lower linearity and precision, a resistive sensor can be used. They are either non-linear, which means that you need a lot of ADC resolution depending on where on the temperature scale your are. Or they may be linear, but with maybe 1-2°C precision and often bigger limitations to the supported temperature range.

A PT-100 or PT-1000 sensor will produce even better readings (and a very large temperature range), but has so small resistance variation for a temperature change that it will take a very explicit circuit to interface such a sensor with a microprocessor.

2) Impedance of input? Yes, that is important. A resistive temperature sensor requires a current to be sent through the sensor. A constant current may be used, and the varying resistance in the sensor will result in different voltages. Or a constant voltage together with a voltage divider can be used. Still a requirement for the current range, but this case will also produce a nonlinear reading. But in both cases, there must be sent a high-enough current through the resistive sensor that the voltage drop will be high enough that it can be read by the ADC. On the other hand - too high current sent through the sensor will produce internal heating in the sensor, affecting the precision.

3) You mention measurements with two digits (0.0 to 5.0V) and then 3 bits. Two decimal digits reaures at least 7 bits (0..127) of resolution. 3 bits gives 8 steps of resolution, i.e. 0V, 0.7V, 1.4V, 2.1V, 2.9V, 3.6V, 4.3V and 5.0V. For a linear sensor, you need at least 8 bits of resolution. Probably 10 bits, since the least significant bit(s) of an ADC can't be trusted. And you also wants a bit or two for any filtering, to avoid a hysterese problem where the value is just on the turn on/off level and very little noise makes two inputs switch places after the sorting, resulting in two relays constantly clicking.

4) If the sensors are not linear, then you need 12 bits or more, and you probably also needs code to normalize the reading before the sort/compare or the sensitivity will vary if all sensors are cold or if all sensors are hot.

5) Multiplexer slow? Yes, it will decrease the maximum number of samples you get from the ADC. But you say you need just a couple of samples/second. If you have an ADC capable of 10kHz sampling rate, then it is obviously fast enough that you can step the multiplexer every 10 ms and get 100 readings/second. This divided by 16 sensors would give 6 readings from each source every second. The limitation on how fast you can switch a multiplexer isn't so much affected by the multiplexer as by the impedance (yet again) of the sensors. How long will it take for the signal to stabilize after you have multiplexed in the next sensor? That affects how soon the ADC can take the next reading.

Few processors have 12 or 16 internal ADC. Normally, the processor has 1 ADC with multiplexed inputs. Each sensor gets one pin on the processor, and the internals of the processor allows a reading immediately after you have switched the internal mux to the next pin. With an external mux, you need a bit of delay. But you do not need to use a 16-to-1 mux. You can use two 8-to-1 or four 4-to-1 or eight 2-to-1. This gives 16-to-2, 16-to-4 or 16-to-8 and allows a higher sampling rate if the sensors are high-impedive and not individually buffered with op-amps.

6) You talk about AND logic to drive your relays. An AND gate is a gate with two or more inputs, with the goal of performing a logic operation - not any buffering, even there are AND-gates with buffered output. If you talk about driving relays, then you should probably use one transistor/output, or possibly a driver chip with many open-collector transistors in the same chip. You also need free-wheel diodes connected over the relay coils to protect the transistors when the voltage to the relay coils are removed. The free-wheel diode have limitations on how many relay deactivations it can handle/second. And the relays have limitations on how many activations/deactivations it can handle in a life-time. If you use MOS-FET transistors instead of bipolar, then you can normally get a smaller transistor with higher current capability, and also often skip the free-wheel diode. But without a free-wheel diode, it will be the transistor itself that will limit the number of deactivations/second, since it will be the transistor that has to "discharge" the stored coil energy.

Conclusion: You still haven't given enough information about your sensors, which makes it hard to:
- figure out how they should be connected to the processor
- figure out how fast they can be read
- figure out how many bits of precision you need for the ADC
- figure out if an external multiplexer is needed
- figure out if normalization need to be done of the read samples

For the outputs, there are also a couple of open issues:
- what voltages and what current for the relays
- min # of activations/deactivations needed / second.
- max # of activations/deactivations allowed / second.

The hardware must be designed for the needed toggle frequency, while the software must be designed to limit to the max frequency supported by the hardware.

List of 73 messages in thread
TopicAuthorDate
ATMEL AT89C52 Help?            01/01/70 00:00      
   Info            01/01/70 00:00      
      you are ignoring \'the standard\' and the fast            01/01/70 00:00      
         Not ignoring            01/01/70 00:00      
            it does not, but            01/01/70 00:00      
      Anyone want to write simple program for chip for u            01/01/70 00:00      
         \"a few hours\"???            01/01/70 00:00      
         No as simple as you may think            01/01/70 00:00      
            reply            01/01/70 00:00      
               Let's start at the beginning            01/01/70 00:00      
   A Serial Flash chip would be easier            01/01/70 00:00      
   Specification?            01/01/70 00:00      
      what about a "community project"?            01/01/70 00:00      
         Has anyone offered complete C++ for 805x?            01/01/70 00:00      
            yes??            01/01/70 00:00      
               Subset            01/01/70 00:00      
            Would Object Oriented Techniques Be Of Advantage?            01/01/70 00:00      
      Reply specs.            01/01/70 00:00      
         More specifications (and less)            01/01/70 00:00      
            Additional specs. Can you do it?            01/01/70 00:00      
               16 temperature inputs, relay outputs.            01/01/70 00:00      
                  problem is in software            01/01/70 00:00      
                     Lets first choose a chip.            01/01/70 00:00      
                        how many are you going to make?            01/01/70 00:00      
                        It is not just a voltage            01/01/70 00:00      
                  We want to keep it simple            01/01/70 00:00      
         MicroManagement ...            01/01/70 00:00      
         Narrowing it down            01/01/70 00:00      
            More specs again            01/01/70 00:00      
               ATMEL AT89C52            01/01/70 00:00      
                  More hw info needed            01/01/70 00:00      
                     Ok. thanks            01/01/70 00:00      
                        Don't assume. Don't "let's say". Go specific!            01/01/70 00:00      
                  dtraight from the horses mouth            01/01/70 00:00      
               Be Specific            01/01/70 00:00      
            shameless self-advertisement            01/01/70 00:00      
               Hi Jan, some user guide?            01/01/70 00:00      
                  documentation... is always a pain... ;-)            01/01/70 00:00      
                     sometimes "hobby projects" are better off            01/01/70 00:00      
                        what's that?            01/01/70 00:00      
                           a techwriter is            01/01/70 00:00      
                              oh I see            01/01/70 00:00      
                           The REAL issue with documentation            01/01/70 00:00      
                              ever done a hobby project, Richard? ;-)            01/01/70 00:00      
                                 not since the '60's ... well, maybe the '70's            01/01/70 00:00      
                                    well, IMHO, hobby projects are exactly the opposite...            01/01/70 00:00      
                                       remember the reference to Ultramon51?            01/01/70 00:00      
                                          the reward of hobbyist            01/01/70 00:00      
                                             the hobbyist does not need formal documents            01/01/70 00:00      
                                                hobbyist????            01/01/70 00:00      
                                             hobbyist - beginner            01/01/70 00:00      
                                                It's a tradeoff            01/01/70 00:00      
                                             Target goals and check lists            01/01/70 00:00      
                              naah            01/01/70 00:00      
                                 Smaller companies have to run fast            01/01/70 00:00      
                                    the sad thing is            01/01/70 00:00      
                                       Progress            01/01/70 00:00      
                     program interpreted from i2c eeprom?            01/01/70 00:00      
                        possible, but why?            01/01/70 00:00      
                           Waiting for first proposal for whole project?            01/01/70 00:00      
                              Waiting for complete and precise requirements            01/01/70 00:00      
                                 Lets keep on track.            01/01/70 00:00      
                                    A joke?            01/01/70 00:00      
                                       Well said            01/01/70 00:00      
                                       FOR SHAME !!!            01/01/70 00:00      
                                          Taunting?            01/01/70 00:00      
                                          You asked            01/01/70 00:00      
                                          There are AND gates that might work            01/01/70 00:00      
                                             Posible            01/01/70 00:00      
                                                Well ... depending on the relay ...            01/01/70 00:00      
                                                   Useful for others?            01/01/70 00:00      
                                    Off track? Not at all! Tell us what you want ...            01/01/70 00:00      
   shematic 1            01/01/70 00:00      

Back to Subject List