Hello anyone i am new here and i want to build a temp station at my house for temperature checking.
I searched the internet but i was not satisfied about the results so i want to know how to connect 8 and more lm35 sensors on the arduino board with this mux https://www.sparkfun.com/products/9056 and how can i read each sensor’s temp on the pc.
My first thought is that you’ll be placing the temp sensors at some distance from the Arduino. I’d expect those long wires will both present a “problem load” to the sensor and pick up electrical noise. You should read the datasheet re: capacitive loads. You may want to amplify the signal at the sensor end before sending over the cable.
To answer your question - you’d take the output of each sensor and wire it the a separate MUX input pin (C0 - C7). You connect the single MUX output (SIG) to one of the Arduino’s analog input pins (A0). You connect 4 digital output pins (your choice) to the MUX control pins (S0-S3). You can leave the enable pin unconnected. Of course the MUX board and all of the sensors get their Vcc and GND connected to the Arduino Vcc and GND.
You select which channel is output via the control lines per the Truth Table on pg2.
pas2007:
For example i wait to read a temperature about 14C and the serial monitor gives a value range 15-40C
Is that correct?
I'd perform a check to make sure the MUX and code are working properly. Make a voltage divider to get about 1V from the Uno's 5V supply. Connect that output in place of each sensor and verify the simulated reading is correct for 1V. You may just want to add a line of code to print the ADC reading.
If that works then I suspect that the temp sensor is having a hard time driving the capacitive load presented by the MUX. It’s specs say it’s 5 pF on the input and 50 pF for the common output pin. The LM35 datasheet indicates some additional precautions/circuitry may be needed w/loads > 50 pF. You may need to add at least the min change (a resistor) suggested.
From the PDF posted previously;
CAPACITIVE LOADS Like most micropower circuits, the LM35 has a limited ability to drive heavy capacitive loads. The LM35 alone is able to drive 50 pf without special precautions. If heavier loads are anticipated, isolating or decoupling the load with a resistor is easy (see Figure 14). Or you can improve the tolerance of capacitance with a series R-C damper from output to ground (see Figure 15). When the LM35 is applied with a 200-Ω load resistor as shown in Figure 16, Figure 17, or Figure 19, the device is relatively immune to wiring capacitance because the capacitance forms a bypass from ground to input and not on the output. However, as with any linear circuit connected to wires in a hostile environment, performance is affected adversely by intense electromagnetic sources such as relays, radio transmitters, motors with arcing brushes, and SCR transients, as the wiring acts as a receiving antenna and the internal junctions act as rectifiers. For best results in such cases, a bypass capacitor from VIN to ground and a series R-C damper, such as 75 Ω, in series with 0.2 or 1 μF from output to ground are often useful. These are shown in Figure 24, Figure 24, and Figure 27.
If you still see a “wide” variation in temps from co-located sensors then it could be that the MUX is adding a small voltage offset to each channel. At 10 mV/degC, 15 degs of difference is only 150 mV. You may have to calibrate that out or pre-amplify the sensors outputs before input to the MUX (so the offset means less deg).