Wednesday, September 15, 2010

Arduino Temp / Humidity Update!

Tonight I added a RGB LED to the project. The LED turns red when the temp drops too cool (to indicate that the furnace has turned on), and blue when it gets too hot (to indicate the A/C has turned on). When the temp is in our 15 degree comfort range, the LED is green. I'll try to get a pic uploaded tomorrow, and video this weekend. I just put my finger over the temp sensor, and the LED changed from green to blue. Very cool!

Tuesday, September 14, 2010

Our Temperature / Humidity Monitor is working!

We received our SHT21 Temperature / Humidity Sensor today from Misenso. No documentation came with it, so a bit of googling found parts of the necessary info on 3 different sites (spliced a few bits of code, installed the I2C library, and crossed my fingers on the wiring). If you want to duplicate this email me, and I'll send you the pde file, the library, and schematic. It's specific to this implementation of the SHT21 module and most 4 line LCD displays.
Code download - sht21_LED.pde

Library -

// Connections:
// LCD pin 1 to Arduino GND
// LCD pin 2 to Arduino 5v
// LCD pin 3 (Contrast) to GND
// rs (LCD pin 4) to Arduino pin 12
// rw (LCD pin 5) to Arduino pin 11
// enable (LCD pin 6) to Arduino pin 10
// LCD pin 15 to Arduino pin 13
// LCD pin 16 to Arduino GND
// LCD pins d4, d5, d6, d7 to Arduino pins 5, 4, 3, 2

//Tested with SHT21 Breakout from Misenso
//SHT21 pin SDA to Arduino Analog pin 4
//SHT21 pin SCL to Arduino Analog pin 5
//SHT21 pin GND to Arduino GND
//SHT21 pin VCC to Arduion 3v (not 5v)

//Red Cathode to Arduino pin 9
//Blue Cathode to Arduino pin 8
//Green Cathode to Arduino pin 7
//Anode to 270 ohm resistor to 5V

#include <LiquidCrystal.h>
#include <Wire.h>
#include <LibHumidity.h>

LibHumidity humidity = LibHumidity(0);

LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);

int backLight = 13; // pin 13 will control the backlight
int RedLEDPin = 9; // LED connected to digital pin 9
int BlueLEDPin = 8; // LED connected to digital pin 8
int GreenLEDPin = 7; // LED connected to digital pin 7

void setup()
pinMode(backLight, OUTPUT);
digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.

pinMode(16, OUTPUT);
digitalWrite(16, LOW); //GND pin
pinMode(17, OUTPUT);
digitalWrite(17, HIGH); //VCC pin

//Furnace / AC Indicator
pinMode(RedLEDPin, OUTPUT); // sets the digital pin as output
pinMode(BlueLEDPin, OUTPUT); // sets the digital pin as output
pinMode(GreenLEDPin, OUTPUT); // sets the digital pin as output


void loop()
lcd.begin(20,4); // columns, rows. use 16,2 for a 16x2 LCD, etc.
lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row)
lcd.print("Humidity: "); // change this text to whatever you like. keep it clean.
lcd.setCursor(0,1); // set cursor to column 0, row 1
lcd.print("Temp in C: ");
lcd.setCursor(0,2); // set cursor to column 0, row 2
lcd.print("Temp in F: ");
if (humidity.GetTemperatureF() < 60) { digitalWrite(RedLEDPin, LOW); // sets the Red LED on digitalWrite(BlueLEDPin, HIGH); // sets the Blue LED off digitalWrite(GreenLEDPin, LOW); // sets the Green LED off } else if (humidity.GetTemperatureF() >= 75)
digitalWrite(BlueLEDPin, LOW); // sets the Blue LED on
digitalWrite(RedLEDPin, HIGH); // sets the Red LED off
digitalWrite(GreenLEDPin, HIGH); // sets the Green LED off
digitalWrite(GreenLEDPin, LOW); // sets the Green LED on
digitalWrite(BlueLEDPin, HIGH); // sets the Blue LED off
digitalWrite(RedLEDPin, HIGH); // sets the Red LED off


delay (20000);

Unsure what is causing the two strange characters at the end of the Temp in F line, but will work on that. (Michael Grant pointed out the unnecessary carriage return we had in our code. All fixed now.)

Monday, September 13, 2010

Data logging with the Arduino

Our solar and wind power monitor needs the ability to save historical data so that we can track watt hours and amp hours daily and weekly. A SD card provides enough capacity, and allows us to easily download the data to our PC. There is a nice data logging shield available for under $20 that fits the application nicely.

Data logging shield for Arduino makes saving data to files on any FAT16 or FAT32 formatted SD card really easy. The included Real Time Clock timestamps all your data with the current time, so that you know precisely what happened and when!

For a power monitor idea, see

Sunday, September 12, 2010

Sparkfun Inventors Guide

I highly recommend you download Sparkfun's Inventors Guide. It will give you a lot of valuable information on how to use the Arduino, trigger some neat ideas of your own, and Sparkfun is a valuable resource for components and sample code.

Arduino Medical Monitoring

The Arduino seems the ideal platform for making your own medical monitoring system. Your temperature, heart rate, respirations, blood pressure, weight and O2 content of the blood are all measurable and loggable. Here are a few links to get you started, but email me at with more links to this application.
Related Posts Plugin for WordPress, Blogger...