in somewhat of a building spree i took the code for reading the DS18B20 digital temperatur sensor and built a thermometer to display the temperature outside. It´s cold in Berlin.
Here´s the code:
int ledPin1 = 3;
#define ONE_WIRE_BUS 7
Serial.println(“Dallas Temperature IC Control Library Demo”);
Serial.print(“Parasite power is: “);
if (sensors.isParasitePowerMode()) Serial.println(“ON”);
if (!sensors.getAddress(VL, 0)) Serial.println(“No address for D 0″);
Serial.print(“Device 0 Address: “);
Serial.print(“Device 0 Resolution: “);
void printTemperature(DeviceAddress deviceAddress)
float tempC = sensors.getTempC(deviceAddress);
//Serial.print(“Temp C: “);
lcd.drawText(15, 10, “Temperatur aussen”, 1, RGB( 0,255, 0), RGB(0, 0, 0));
lcd.drawText(15, 20, Vorlauf, 9, RGB( 255, 255, 255), RGB(0, 0, 0));
void printAddress(DeviceAddress deviceAddress)
for (uint8_t i = 0; i < 8; i++)
if (deviceAddress[i] < 16) Serial.print(“0″);
and here´s a picture of the system running:
Hey all, just wanted to say that i updated the code so it compiles and uploads in the 1.0.1 IDE. The Arduino guys changed the function name “Client” to “EthernetClient” in the ethernet libraries, and i had to get the updates library for the Dallas Temperature sensors. Miles Burton is doing a good job with this: http://milesburton.com/Dallas_Temperature_Control_Library
Here’s the Code. It reads the sensor data, connects to the server and sends the data nicely.
#define Client EthernetClient
#define ONE_WIRE_BUS 7
#define TEMPERATURE_PRECISION 9
I just cleaned the code a little bit. Here´s the new code which will work better. It stops somehow after ~18h, and i think it has something to do with an overflow in the variable which stores the “delay”…will work this out later. Here´s the code:
#include <Ethernet.h> //library for ethernet functions #include <Client.h> //library for client functions #include <DallasTemperature.h> //library for temperature sensors #include <OneWire.h> //library for the onewire bus read more...
Had no time to really get into the code, especially because i have to do some html/php and i´m not yet very experienced. But the project is in my thougths every day. I should be learning very hard but i only make 4-5hrs a day… In the remaining time i´m thinking about concepts for new projects (beside sports and friends) , like a giant 8×8 RGB-Matrix like Richard Kline did here (seen on makezine.com)
I really would like to use an rainbowduino for this, but i didn´t found anything about “external” RGB-matrices in the rainbowduino-sphere…
Today i finished somewhat of a 0.8 version of my attempt to read temperature data from several DS18B20 temperature sensors with the arduino and to send them to my “kitchenserver”. Why kitchenserver? Because its running all night long and therefore had to go to kitchen.
What is my goal?
To read temperature data and store it in a database for further processing.
My father always says: “Die Sprache des Ingenieurs ist die Zeichnung” what means as much as ” the language of an engineer is drawings” so i made a little “graphic”:
Edit: I found out that my first code is only working for one sensor, due to some Arduino->PHP inconsistencies (Arduino called the script for every temperature, but script wants to write all data in one call) So I rewrote the code to send all temperatures in one call. I have now 5 sensors up and running and storing data to my database. I would try the setup with more sensors but i have only 5 of them so i first have to buy some. If you want to build a system like this, use the newer code, the old code is only for educational purposes now ;)