Mercury thermometer

Today we are programming a simple but quite didactic exercise. Using the temperature sensor in scratch-io shield (LM35) we can display a mercury thermometer in the screen.
See below the sprites scripts.
A theory pill: LM35 give a voltage proportional to temperature of the package. 0 º centigrade equals to 0mvol, 1º centigrade equals to 10mvol. Knowing that Arduino ADC convert 0to5vol into 1to1024 data... K=2,048 data/º
here you have the script for S4A:
termometro.sb
termometro.sb
termometro.sb



external image LM35-Pinouts.png
external image LM35-Pinouts.png



thermo.png
thermo.png




Here below, the Arduino script and the mercury 'line' script. See the complete code in the link above for details.
.


therm_2.png
therm_2.png
therm_3.png
therm_3.png
























A simple project that shows a basic thermometer:

By reading the Lm35 temperature sensor on board attached in analog input line 3 we can develop a thermometer.
Notice that we read three times the temp sensor to avoid gitches, and later we convert ADC measure to centigrades. The LM35 chips are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. Vout = 10mV/ºC
Arduino ADC features: Vref = 5 volt, digital range[0-1024]
Kte=0,55ºC/Sample
..
programaTemp.png