Showing posts with label Digital. Show all posts
Showing posts with label Digital. Show all posts

4/22/2013

Arduino and DS18B20 1-wire digital thermometer





Finally got this DS18B20 working. Actually three of them. And in two modes. Parasite power mode and main mode.
A 4.7K ohm resistor is the key.

Starting with the main mode, three wires are needed, as this sensor has three pins.
Data sheet is here : http://www.hqew.net/product-data/DS18B20

Connection is almost simple.
Pin 1 to Arduino ground
Pin 2 to Arduino digital input
Pin 3 to Arduino 5V
And a 4.7K resistor between pin 2 and pin 3

Works with three wires, as seen on the following illustration.



Parasite mode eliminates one wire.
Pin 1 to Arduino ground
Pin 2 to Arduino digital input
Pin 3 to Arduino ground (same as pin 1)
And a 4.7K resistor from pin 2 to 5V

Maybe following illustration helps.



Of course multiple DS18B20-s or different one wire devices can connected together like so:

Here comes the beauty of using digital thermometers. One pin on Arduino can be used for multiple devices, working together over one wire. Much like ethernet actually. Each device has its own unique address.
Second, a two wire cable can be used. Those are usually much easier to find than three wire cables. Also digital 1-wire thermometers work on longer cables. A simple test is cable-length-for-lm35-and-ds18b20.

Some words of caution:
No pins on DS18B20 should be left unconnected. Sometimes it works this way, sometimes it does not.
If using one should avoid mixing main mode and parasite mode thermometers on the same pin. Sometimes it works, sometimes it does not.

DS18B20 can also be installed outside. Some kind of protection is advisable.  I had one sensor outside, minimum temperature about -30° C, maximum about +35° C, protected like this. No problems so far.

Working with three DS18B20 thermometers for a year now – sometimes those thermometers do not get initialized correctly. Specially after power fluctuations. Hard reset helps in that case.



A1015         CP2102          DS18B20             AD620




3/07/2013

Digital voltmeter using ICL7107



The circuit given here is of a very useful and accurate digital voltmeter with LED display using the ICL7107 from Intersil. The ICL7107 is a high performance, low power, 3.5 digit analog to digital converter. The IC includes internal circuitry for seven segment decoders, display drivers, reference voltage source and a clock. The power dissipation is less than 10mW and the display stability is very high.
The working of this electronic circuit is very simple. The voltage to be measured is converted into a digital equivalent by the ADC inside the IC and then this digital equivalent is decoded to the seven segment format and then displayed. The ADC used in ICL7107 is dual slope type ADC. The process taking place inside our ADC can be stated as follows. For a fixed period of time the voltage to be measured is integrated to obtain a ramp at the output of the integrator. Then a known reference voltage of opposite polarity is applied to the input of the integrator and allowed to ramp until the output of integrator becomes zero. The time taken for the negative slope to reach zero is measured in terms of the IC’s clock cycle and it will be proportional to the voltage under measurement. In simple words, the input voltage is compared to an internal reference voltage and the result is converted in a digital format.
The resistor R2 and C1 are used to set the frequency of IC’s internal clock. Capacitor C2 neutralizes the fluctuations in the internal reference voltage and increases the stability of the display.R4 controls the range of the voltmeter. Right most three displays are connected so that they can display all digits. The left most display is so connected that it can display only “1” and “-“.The pin5(representing the dot) is connected to ground only for the third display and its position needs to be changed when you change the range of the volt meter by altering R4. (R4=1.2K gives 0-20V range, R4=12K gives 0-200V range ).