Smart Vacuum Bottle with Arduino
Autor: Bruno | Publicado: 2010-03-13T01:05:00-03:00

Translated by Bruno. Original work by Gamesh_

Many times we face with a thermos coffee and we don't know if the liquid is on adequate temperature only looking for it. In the end we waste a lot of time with a cold coffee and that turn unpleased us.

However, this vacuum flask indicates by a graph of LEDs if the liquids are hot, warm or cold. The LEDs will go gradually from blue (cold) to red (hot), when there a overheat and will go off when there a cooling.
Watch the complete project below:



For project be developed were needed:



1 temperature sensor. You can find it in digital thermometer:


9 LEDs colors.1 red, 4 yellow, 3 green, 1 blue.

1 resistance 10K (Brown, Black and Orange)  

1 Arduino

1 thermos

Wires
&nbsp;
Nine holes were drilled in the side of the thermos with a hot iron of the same diameter of the LEDS. 


&nbsp; Wires connected the LED pin 5 to 13:
The temperature sensor was removed from the tip of the digital thermometer and connected to Arduino as shown below:



The sensor was positioned in the interior of the bottle of the glass through a longest wire. &nbsp; 

A code was developed based on another that controls the LEDs, and it was modified and adapted for our necessary. In this program also is possible read in the serial port from IDE of Arduino the value sent by the sensor and the number of LEDs that are off.
Results:
&nbsp;&nbsp; It was possible to detect the gradual variation of internal temperature of the liquid inside the vacuum. This is due to the cooling and heating with the graph of LEDs.

Code:

/*
&nbsp; 
&nbsp;&nbsp;&nbsp; Program to SMART THERMOS. 
&nbsp; 
&nbsp; -Program created by Gamesh_ (by Gamesh_) from Brazil 
&nbsp;  http://www.brasilrobotics.blogspot.com/
&nbsp;&nbsp; Created on  January 3, 2010
&nbsp; 
&nbsp;&nbsp;&nbsp; --The  program detects the temperature of the liquid (coffee, tea) in the thermal and
&nbsp;&nbsp; indicates a temperature graph.
&nbsp;&nbsp;&nbsp; Blue for cold, red for hot and
&nbsp;&nbsp; other colors to intermediate temperatures.
&nbsp;&nbsp; The objective whether the "coffee" is still a
&nbsp; &nbsp;&nbsp; good temperature to drink. --&nbsp; 
&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; 
The Program used as  the basis:&nbsp;&nbsp;&nbsp; LED bar graph&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; created 26 Jun  2009
&nbsp;&nbsp;&nbsp; by Tom Igoe&nbsp; 
&nbsp;&nbsp;&nbsp; available at: 
&nbsp;&nbsp;&nbsp;  http://www.arduino.cc/en/Tutorial/BarGraph
&nbsp; 
&nbsp; */


&nbsp;const int analogPin  = 0;&nbsp;&nbsp;&nbsp; // Check  temperature sensor.
&nbsp;const int ledCount =  9;&nbsp;&nbsp;&nbsp; // Number of&nbsp; LEDs used (the number of LEDs in the bar graph)

&nbsp;int ledPins[] =  {5,6, 7, 8, 9, 10,11,12,13};&nbsp;&nbsp; // Pins used with the LEDS (an array of pin  numbers to which LEDs are attached)

&nbsp;void setup() {

&nbsp;&nbsp;  Serial.begin(9600);
&nbsp;&nbsp; 
&nbsp;&nbsp; // loop over the  pin array and set them all to output:
&nbsp;&nbsp; for (int thisLed =  0; thisLed &lt; 9; thisLed++) {
&nbsp;&nbsp;&nbsp;&nbsp;  pinMode(ledPins[thisLed], OUTPUT); 
&nbsp;&nbsp; }
&nbsp;}

&nbsp;void loop() {
&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Reading the sensor:
&nbsp;&nbsp; int sensorReading  = analogRead(analogPin);
&nbsp;&nbsp; // map the result  to a range from 0 to the number of LEDs:
&nbsp;&nbsp;&nbsp; int ledLevel =  map(sensorReading, 320, 930, 0, 9);

Serial.print("Valores  ledLevel : ");
&nbsp;&nbsp;&nbsp;  Serial.println(ledLevel);
&nbsp;&nbsp;&nbsp;  Serial.print("Valores sensorReading : ");
&nbsp;&nbsp;&nbsp;  Serial.println(sensorReading);
delay(1000);


&nbsp;&nbsp; // loop over the  LED array:
&nbsp;&nbsp; for (int thisLed =  0; thisLed &lt; ledCount; thisLed++) {
&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp; if (thisLed  &lt; ledLevel) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  digitalWrite(ledPins[thisLed], LOW); //LEDs OFF
&nbsp;&nbsp;&nbsp;&nbsp; } 
&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp; else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  digitalWrite(ledPins[thisLed], HIGH);&nbsp; //LEDs ON
&nbsp;&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp; }
&nbsp;}



This work is licensed under a Creative  Commons  License.