Pages: [1]   Go Down
Author Topic: Standalone Atmega328 Temp/pH/Humidity Sensor WIP  (Read 1778 times)
0 Members and 1 Guest are viewing this topic.
Niagara on the Lake, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nothing amazing, but I picked up another atmega328 chip and a resonator and built a little board. Right now it doesnt have anything hooked up but eventually it will be connected to an LCD, pH sensor, humidity sensor, temperature sensor, and some SSR's.

It has a blue LED connected to the [arduino] pin 13, an ICSP header for burning the bootloader (or incase I want the extra 2kb of space), a header for power, and a header for Tx, Rx, and RST (to program with the Arduino IDE).



« Last Edit: August 16, 2009, 01:38:19 am by SpikedCola » Logged

Niagara on the Lake, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Added RJ45 connector to attach sensors, and built a DS18S20 sensor board (just one for now, more to come later):




Logged

Niagara on the Lake, Ontario
Offline Offline
Full Member
***
Karma: 0
Posts: 144
Arduino rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I apologize if the multiple posts makes anyone unhappy; I just like having a new post for every update, as it makes it easier for me to track progress and time/dates.

Finished the code (for now) include a Max/Min/Current temp display, using custom characters (the up and down arrows) to identify which is max and which is min, without cluttering the (tiny) display. I ran out of AWG30 wire, so when I pick more up Ill add the LCD to the atmega board and wire it up.


Code:
#include <DallasTemperature.h>
#include <LiquidCrystal.h>

// RS EN D4 D5 D6 D7
LiquidCrystal lcd(0, 1, 2, 3, 4, 5);
DallasTemperature tempSensor;
double maxtemp = 0;
double mintemp = 255;
byte up[8] = { 0x04, 0x0E, 0x15, 0x04, 0x04, 0x04, 0x04, 0x00 };
byte down[8] = { 0x04, 0x04, 0x04, 0x04, 0x15, 0x0E, 0x04, 0x00 };

void setup()
{
  tempSensor.begin(12);
  lcd.begin(16, 2);
  lcd.createChar(0, up);
  lcd.createChar(1, down);
}

void loop()
{
  double temp = tempSensor.getTemperature();
  lcd.home();
  lcd.write(0);
  lcd.setCursor(5,0);
  lcd.print(temp);
  lcd.write(223);
  lcd.print("C");
  lcd.setCursor(15,0);
  lcd.write(1);
  if (temp > maxtemp)
  {
    maxtemp = temp;
    lcd.setCursor(0,1);
    lcd.print(maxtemp);
    lcd.write(223);
    lcd.print("C");
  }
  if (temp < mintemp)
  {
    mintemp = temp;
    lcd.setCursor(9,1);
    lcd.print(mintemp);
    lcd.write(223);
    lcd.print("C");
  }
}
« Last Edit: August 15, 2009, 11:46:50 pm by SpikedCola » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very cool!!!

Do u store the max, min value on the computer or in any other "thing"?
Logged

Pages: [1]   Go Up
Jump to: