This video walk through can be used for either the WHR-HP-G300N or the WHR-300HP Buffalo routers.

For setting up the Buffalo WHR-300HP as a Wireless Bridge follow the first video.
For setting it up as a repeater watch both videos.

There is probably room for improvement here but this is what I have come up with for a 3.7 Volt LiPo battery meter. In the picture below I am charging my battery from a 5 volt source. All the charge controlling circuitry is built into the battery. I just wanted a way to monitor the charging progress, although, this could certainly be added to any project that uses a 3.7 volt LiPo battery for its power supply.
Hope this helps.

//3.7V LiPo Battery Meter
//3.7V LiPo Battery Meter
//Use two 1.2 K Ohm resisters as a voltage divider from the positive
//and negative terminal of the battery to read reference voltage from.
//we wouldnt want to send to much voltage to our Arduino.
//Make sure to tie the ground back to the Arduino. Otherwise, expect some odd readings.

int sensorPin = 0; //set up the sensor pin for reading the voltage
int sensorValue = 0; //variable to store the value coming from the sensor

void setup()
{
//This is the default value, but we can set it anyways
analogReference(DEFAULT); //5V Reference on UNO
Serial.begin(9600); //initialize serial communication
}

void loop()
{
sensorValue = analogRead(sensorPin); //set sensorValue as an analog read of the A0 pin
//print the value of the sensor multiplied by 0.00326 to get true voltage reading.
//this is a value of 0 - 1023 coming from the sensor pin and has to be converted.
Serial.println(“Battery Voltage Is”);
Serial.println(sensorValue * 0.00951);

delay(1000); //give a delay between readings.
}

IMAG0758

 

thermostat

 

UPDATE 8/8/15

This post still gets quite a few views every day. If you build something using this post I would love to see what you’ve made. Please send pictures of your completed projects to [email protected] along with any suggestions or comments you may have. I will be making a post to show them off.

UPDATE 4/21/13
Added fan only option to thermostat in code and added a switch to control it..
Cleaned up code
Added diagnostic Serial.print statements
Added threshold of +/- 3 degrees of set temperature.

 

UPDATE 1/30/13

Fixed download links for sketches

 

UPDATE 1/13/13

Updated tutorial using an I2C to interface the LCD to the Arduino, saving some of those much needed digital ports for other useful expansions and improvements. Read on and I hope you find it helpful. Leave me some comments or reach me on facebook, or google +.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 

UPDATE:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
If you have questions…. Please Ask!
Added Code for finding the address of a DS18B20 Temerature sensor.

UPDATE 12/8/2012
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
I have decided to use a IIC/I2C/TWI/SP​​I Serial Interface to reduce the number of digital ports used on my Arduino for future expansion. Read further for the Updated code and improvements.
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
This tutorial assumes you know how to properly hook up switches to the arduino and otherwise have some basic knowlege of how electricity works.
I will be adding a full physical connections tutorial for this thermostat in the near future.
I built this using the Arduino Uno Rev 3, relay shield from seeedstudio, Dallas DS18B20, and an 16×2 LCD.

Hardware Required:
Arduino Uno Rev 3
Relay Shield
Dallas DS18B20 One Wire Temperature Sensor (Datasheet)
16×2 LCD (Datasheet)

I2C interface ( you could just buy an LCD that already has an I2C interface on it)

1 10 K Ohm Potentiometer
2 Single Pole double Throw Rocker Switches

1 Red LED indicator for heating mode

1 Blue LED indicator for cooling mode
2 10 K Ohm Resistors
1 4.7 K Ohm Resistor
1 10 K Ohm Trimmer Potentiometer (if not using the I2C)
Wire

You need to install the libraries for the Dallas DS18B20 and also for using the LCD with an I2C. You can get them both here. You will also need to rename or move the original LiquidCrystal library if you are going to use an I2C with your LCD. If you don’t know how to work with libraries please visit arduino.cc.

This is all I have for now but I will be updating very soon!

Use this code to find the address of your DS18B20 Sensor.Download the Sketch Here

DS18B20 Address Finder::::

// This sketch looks for 1-wire devices and
// prints their addresses (serial number) to
// the UART, in a format that is useful in Arduino sketches
// Tutorial:
// http://www.hacktronics.com/Tutorials/arduino-1-wire-address-finder.html

#include <OneWire.h>

OneWire ds(3); // Connect your 1-wire device to pin 3

void setup(void) {
Serial.begin(9600);
discoverOneWireDevices();
}

void discoverOneWireDevices(void) {
byte i;
byte present = 0;
byte data[12];
byte addr[8];

Serial.print(“Looking for 1-Wire devices…\n\r”);
while(ds.search(addr)) {
Serial.print(“\n\rFound \’1-Wire\’ device with address:\n\r”);
for( i = 0; i < 8; i++) {
Serial.print(“0x”);
if (addr[i] < 16) {
Serial.print(‘0′);
}
Serial.print(addr[i], HEX);
if (i < 7) {
Serial.print(“, “);
}
}
if ( OneWire::crc8( addr, 7) != addr[7]) {
Serial.print(“CRC is not valid!\n”);
return;
}
}
Serial.print(“\n\r\n\rThat’s it.\r\n”);
ds.reset_search();
return;
}

void loop(void) {
// nothing to see here
}

 

Thermostat Code without the I2C interface:::: Download the Sketch Here

 

/* A fair portion of the code here is from Arduinotronics and I would have been lost with out it. This is my first “big” Arduino project. So, there is probably a ton of things that can be improved on and tweeked. I would love to know your thoughts and see your improvements! If you would like to share your thoughts with me on this please email me at modsbyus at modsbyus dot com and make the subject line RE: Arduino Thermostat Thoughts, or write a comment on the tutorial at http://www.modsbyus.com/diy-arduino-thermostat. Required library for the DS18B20 can be downloaded here.. http://cloud.modsbyus.com/public.php?service=files&t=82892f20b1296b9557303d6dc60b2f5a/ */

#include <OneWire.h> /*This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! */
#include <DallasTemperature.h>
#include <LiquidCrystal.h>

int sensorPin = A0; // select the input pin for the 10K potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
int setTemp = 0; // variable to store temp desired
int SSRCPin = 5; //Turn on A/C unit
int SSRHPin = 6; //Turn on heat (electric or gas)
int hcLED = 4; //indicator for Cooling mode
int SwitchPin = 1; // To switch between Cooling and Heating
int SSRFan = 7; // To turn on and off the air handler fan
float currentTemp = 0; //Store the current tempurature
// LCD Wires from LCD/to Arduino and other components
// 1 to GND
// 2 to 5V
// 3 to Trimmer Pot Reference Pin
// 4 to Arduino Pin 9
// 5 to GND
// 6 to Arduino Pin 10
// 11 to Arduino Pin 11
// 12 to Arduino Pin 12
// 13 to Arduino Pin 13
// 14 to Arduino Pin 8
// 15 to 5V
// 16 to GND

//Heat relay to Arduino pin 4

//Cooling relay to Arduino pin 5

//Fan relay to Arduino pin 6

//LEDs relay to Arduino pin 7

//DS18B20 to Arduino pin 2

//Heat/Cool switch to Arduino pin 1
LiquidCrystal lcd(9, 10, 11, 12, 13, 8);
/*This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! Thats the middle pin and the VDD pin */
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

DeviceAddress insideThermometer = { 0x28, 0xF0, 0xEA, 0x73, 0x03, 0x00, 0x00, 0xCF };
// DeviceAddress outsideThermometer = { 0x28, 0x20, 0x04, 0xA8, 0x02, 0x00, 0x00, 0x4D };

void setup(void)
{
// Start up the library
sensors.begin();
// set the resolution to 9 bit (good enough?)
sensors.setResolution(insideThermometer, 9);
// sensors.setResolution(outsideThermometer, 9);

lcd.begin(16,2); // columns, rows. use 16,2 for a 16×2 LCD, etc.
pinMode(SSRFan, OUTPUT); //set air handler fan pin as output
digitalWrite(SSRFan, LOW);//Set the fan relay pin normally low (off)
pinMode(SSRHPin, OUTPUT);//Set the heat relay pin as an output
digitalWrite(SSRHPin, LOW);//Set the heat relay pin as normally low (off)
pinMode(SSRCPin, OUTPUT);//Set the cooling relay pin as an output
digitalWrite(SSRCPin, LOW);//Set the cooling relay pin as normally low (off)
pinMode(hcLED, OUTPUT);//Set the indicator LED pin as an output
digitalWrite(hcLED, LOW);//Set the LED indicator pin as normally low (cooling indication)
pinMode(SwitchPin, INPUT);//Set the switch pin as an input
}

void printTemperature(DeviceAddress deviceAddress)
{

sensors.requestTemperatures(); //Get temperature from DS18B20

float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
lcd.print(“Error”);
} else {
// lcd.print(tempC);
// lcd.print(“/”);
currentTemp = (DallasTemperature::toFahrenheit(tempC));
lcd.print(currentTemp);
}

}
void loop(void)
{
delay(500);

sensorValue = analogRead(sensorPin); //Set the variable ‘sensorValue’ as and analog read of the sensor pin

setTemp = sensorValue / 10.24; //Gives us a set temp range between 0 and 99 degrees

lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); //Set the cursor to the 1st position on the 1st line
lcd.print(“Current:”); //Print the word ‘Current:’
lcd.setCursor(0,1);//Set the cursor to the 1st position on the second line
lcd.print(“Set:”); //Print the word ‘Set:’
//lcd.setCursor(0,3);
//lcd.print(“Heat: “);

 

lcd.setCursor(8,0);// Set the cursor to position 8 on the 1st line
printTemperature(insideThermometer);//Print the temperature read from the DS18B20
lcd.setCursor(6,1);//Set the cursor to the position 6 on the 2nd line
lcd.print(setTemp); //Print the value read from the potentiometer
//lcd.setCursor(7,3);
//lcd.print(heat);

//Cooling Mode
int val = digitalRead(SwitchPin) ;// val represents digitalRead(SwitchPin);
/* If the value of is equal to 1 (high) then make hcLED low (off) which sets the relay in a normally closed state. Hence, turning on the blue LED. */
if (val == 1)
{
digitalWrite(hcLED, LOW);//Set the heating/cooling LED indicator to LOW if ‘val’ is equal to 1
}

/* If the SwitchPin reads 1 and the current temperature is greater than the set temperature (if its hot) turn on the A/C and internal fan */
if (val == 1 && (currentTemp > setTemp))
{
digitalWrite(SSRFan, HIGH);//Set the fan relay high
digitalWrite(SSRHPin, LOW);//Set the heat relay low
digitalWrite(SSRCPin, HIGH);//Set the cooling relay high
}

/* Otherwise, if the SwitchPin reads 1 and the current temperature is less than the set temperature (the set temperature has been reached), turn off the A/C and internal fan */
else if (val == 1 && (currentTemp < setTemp))
{
digitalWrite(SSRCPin, LOW);//Set the cooling relay low
digitalWrite(SSRFan, LOW);//Set the fan relay low
}
// Heating Mode

/* If the value of is 0 then make hcLED HIGH (on) which sets the relay in a normally open state. Hence, turning on the RED LED */
if (val == 0)
{
digitalWrite(hcLED, HIGH);//Set the heating/cooling led high
}

/* If the SwitchPin reads 0 and the current temperature is less than the set temperature (if its cold) turn on the HEAT and internal fan */
if (val == 0 && (currentTemp < setTemp))
{
digitalWrite(SSRFan, HIGH);//Set the fan relay high
digitalWrite(SSRCPin, LOW);//Set the cooling relay low
digitalWrite(SSRHPin, HIGH);//Set the heat relay high
}

/* If the SwitchPin reads 0 and the current temperature is greater than the set temperature (the set temperature has been reached) turn off the HEAT and internal fan */
else if (val == 0 && (currentTemp > setTemp))
{
digitalWrite(SSRHPin, LOW);//Set the heat relay low
digitalWrite(SSRFan, LOW);//Set the fan relay low
}

}

You will need to add some things to the Relay Shield. A couple of pictures should do. Add some female headers and a couple of jumpers. The jumper wire on the right in the bottom picture is to bridge all the common terminals together for the 24 volts coming from the HVAC unit. The longer wire is taking ground to the common terminal for the LEDs used for indicating heat and cool mode.
Modified Relay Shield

2013_0113_1508_49

 

 

 

 

 

 

 

 

 

Thermostat Code with I2C Interface::: Download the Sketch Here

/* A fair portion of the code here is from Arduinotronics and I would have been lost with out it. This is my first “big” Arduino project. So, there is probably a ton of things that can be improved on and tweeked. I would love to know your thoughts and see your improvements! If you would like to share your thoughts with me on this please email me at modsbyus at modsbyus dot com and make the subject line RE: Arduino Thermostat Thoughts, or write a comment on the tutorial at http://www.modsbyus.com/diy-arduino-thermostat Required libraries for the DS18B20 and the I2C LCD can be downloaded here.. http://cloud.modsbyus.com/public.php?service=files&file=/admin/files/Modsbyus/libraries.rar/ */

#include <OneWire.h> /*This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! */
#include <DallasTemperature.h>
#include <Wire.h>
#include <LCD.h>
#include <liquidcrystal_i2c.h> // F Malpartida’s NewLiquidCrystal library
#define I2C_ADDR 0x20 // Define I2C Address where the PCF8574A is

//Define all the I2C to LCD pin relationships

#define BACKLIGHT_PIN 7
#define En_pin 4
#define Rw_pin 5
#define Rs_pin 6
#define D4_pin 0
#define D5_pin 1
#define D6_pin 2
#define D7_pin 3

#define LED_OFF 0
#define LED_ON 1
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

int sensorPin = A0; // select the input pin for the 10K potentiometer

int sensorValue = 0; // variable to store the value coming from the sensor
int setTemp = 0; // variable to store temp desired
int SSRCPin = 5; //Turn on A/C unit
int SSRHPin = 6; //Turn on heat (electric or gas)
int hcLED = 4; //indicator for Cooling mode
int SwitchPin = 1; // To switch between Cooling and Heating
int SSRFan = 7; // To turn on and off the air handler fan

 

float currentTemp = 0;//Store current temperature

//Heat relay to Arduino pin 4

//Cooling relay to Arduino pin 5

//Fan relay to Arduino pin 6

//LEDs relay to Arduino pin 7

//DS18B20 to Arduino pin 2

//Heat/Cool switch to Arduino pin 1

/*This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! Thats the middle pin and the VDD pin */
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

DeviceAddress insideThermometer = { 0x28, 0xE4, 0x89, 0x6B, 0x04, 0x00, 0x00, 0x49 };
// DeviceAddress outsideThermometer = { 0x28, 0x20, 0x04, 0xA8, 0x02, 0x00, 0x00, 0x4D };

void setup(void)
{
// Start up the library
sensors.begin();//Start the DS18B20 sensor
// set the resolution to 9 bit (good enough?)
sensors.setResolution(insideThermometer, 9);
// sensors.setResolution(outsideThermometer, 9);

lcd.begin(16,2); // columns, rows. use 16,2 for a 16×2 LCD, etc.
pinMode(SSRFan, OUTPUT); //set air handler fan pin as output
digitalWrite(SSRFan, LOW);//Set the fan relay pin normally low (off)
pinMode(SSRHPin, OUTPUT);//Set the heat relay pin as an output
digitalWrite(SSRHPin, LOW);//Set the heat relay pin as normally low (off)
pinMode(SSRCPin, OUTPUT);//Set the cooling relay pin as an output
digitalWrite(SSRCPin, LOW);//Set the cooling relay pin as normally low (off)
pinMode(hcLED, OUTPUT);//Set the indicator LED pin as an output
digitalWrite(hcLED, LOW);//Set the LED indicator pin as normally low (cooling indication)
pinMode(SwitchPin, INPUT);//Set the switch pin as an input
}

void printTemperature(DeviceAddress deviceAddress)
{

sensors.requestTemperatures(); // Get the current tempurature

float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
lcd.print(“Error”);
} else {
// lcd.print(tempC);
// lcd.print(“/”);
currentTemp = (DallasTemperature::toFahrenheit(tempC));//Convert Celsius to Fahrenheit
lcd.print(currentTemp); //Print the current tempurature
}

}

void loop(void)
{
delay(500);//Delay for 1/2 second

sensorValue = analogRead(sensorPin);//Set the variable ‘sensorValue’ as an analog read of the sensor pin

setTemp = sensorValue / 10.24; //Gives us a set temp range between 0 and 99 degrees

//lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); //Set the cursor to the 1st position on the 1st line
lcd.print(“Current:”); //Print the word ‘Current:’
lcd.setCursor(0,1);//Set the cursor to the 1st position on the second line
lcd.print(“Set:”); //Print the word ‘Set:’
//lcd.setCursor(0,3);
//lcd.print(“Heat: “);

lcd.setCursor(8,0);// Set the cursor to position 8 on the 1st line
printTemperature(insideThermometer);//Print the temperature read from the DS18B20
lcd.setCursor(6,1);//Set the cursor to the position 6 on the 2nd line
lcd.print(setTemp); //Print the value read from the potentiometer
//lcd.setCursor(7,3);
//lcd.print(heat);

//Cooling Mode

int val = digitalRead(SwitchPin) ;// val represents digitalRead(SwitchPin);
/* If the value of is 1 then make hcLED low (off) which sets the relay in a normally closed state. Hence, turning on the blue LED. */
if (val == 1)
{
digitalWrite(hcLED, LOW);//Set the heating/cooling indicator LED low
}

/* If the SwitchPin reads 1 and the current temperature is greater than the set temperature (if its hot) turn on the A/C and internal fan */
if (val == 1 && (currentTemp > setTemp))
{
digitalWrite(SSRFan, HIGH);//Set the fan relay pin high
digitalWrite(SSRHPin, LOW);//Set the heat relay pin low
digitalWrite(SSRCPin, HIGH);//Set the cooling relay pin high
}

/* Otherwise, if the SwitchPin reads 1 and the current temperature is less than the set temperature (the set temperature has been reached), turn off the A/C and internal fan */
else if (val == 1 && (currentTemp < setTemp))
{
digitalWrite(SSRCPin, LOW);//Set the cooling relay pin low
digitalWrite(SSRFan, LOW);//Set the fan relay low
}
// Heating Mode

/* If the value of is 0 then make hcLED HIGH (on) which sets the relay in a normally open state. Hence, turning on the RED LED */
if (val == 0)
{
digitalWrite(hcLED, HIGH);//Set the heating/cooling indicator LED high
}

/* If the SwitchPin reads 0 and the current temperature is less than the set temperature (if its cold) turn on the HEAT and internal fan */
if (val == 0 && (currentTemp < setTemp)) { digitalWrite(SSRFan, HIGH); digitalWrite(SSRCPin, LOW); digitalWrite(SSRHPin, HIGH); } /* If the SwitchPin reads 0 and the current temperature is greater than the set temperature (the set temperature has been reached) turn off the HEAT and internal fan */

else if (val == 0 && (currentTemp > setTemp))
{
digitalWrite(SSRHPin, LOW);//Set the heat relay pin low
digitalWrite(SSRFan, LOW);//Set the fan relay pin low
}

}

/blockquote>

Code with added Fan Function Download Here

/* A fair portion of the code here is from Arduinotronics and I would have been lost with out it. This is my first “big” Arduino project. So, there is probably a ton of things that can be improved on and tweeked. I would love to know your thoughts and see your improvements! If you would like to share your thoughts with me on this please email me at modsbyus at modsbyus dot com and make the subject line RE: Arduino Thermostat Thoughts, or write a comment on the tutorial at http://www.modsbyus.com/diy-arduino-thermostat/ */

#include <OneWire.h> //This temperature sensor requires a 4.7k Ohm resistor across its pins //2 and three!!!!
#include <DallasTemperature.h>
#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h> // F Malpartida’s NewLiquidCrystal library
#define I2C_ADDR 0x20 // Define I2C Address where the PCF8574A is

#define BACKLIGHT_PIN 7
#define En_pin 4
#define Rw_pin 5
#define Rs_pin 6
#define D4_pin 0
#define D5_pin 1
#define D6_pin 2
#define D7_pin 3

#define LED_OFF 0
#define LED_ON 1
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

int sensorPin = A0; // select the input pin for the 10K potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
int setTemp = 0; // variable to store temp desired
int SSRCPin = 6; //Turn on A/C unit
int SSRHPin = 5; //Turn on heat (electric or gas)
int hcLED = 4; //indicator for Cooling mode
int SwitchPin = 3; // To switch between Cooling and Heating
int SSRFan = 7; // To turn on and off the air handler fan
float currentTemp = 0;
int FanPin = 8; //Fan Pin Switch
int FanVal = digitalRead(FanPin);
int val = digitalRead(SwitchPin) ;

//This temperature sensor requires a 4.7k Ohm resistor across its pins 2 and three!!!! Thats the middle pin and the GND pin
// Data wire is plugged into pin 2 on the Arduino
#define ONE_WIRE_BUS 2

// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(ONE_WIRE_BUS);

// Pass our oneWire reference to Dallas Temperature.
DallasTemperature sensors(&oneWire);

DeviceAddress insideThermometer = { 0x28, 0xAF, 0x51, 0x6C, 0x04, 0x00, 0x00, 0x22 };
// DeviceAddress outsideThermometer = { 0x28, 0x20, 0x04, 0xA8, 0x02, 0x00, 0x00, 0x4D };

void setup(void)
{
Serial.begin(9600);
// Start up the library
sensors.begin();
// set the resolution to 9 bit (good enough?)
sensors.setResolution(insideThermometer, 9);
// sensors.setResolution(outsideThermometer, 9);

lcd.begin (16,2); // columns, rows. use 16,2 for a 16×2 LCD, etc.
pinMode(SSRFan, OUTPUT); //set airhandler fan pin as output
pinMode(SSRHPin, OUTPUT);
pinMode(SSRCPin, OUTPUT);
pinMode(hcLED, OUTPUT);
pinMode(SwitchPin, INPUT);
pinMode(FanPin, INPUT);
}

void printTemperature(DeviceAddress deviceAddress)
{

sensors.requestTemperatures(); // was in loop

float tempC = sensors.getTempC(deviceAddress);
if (tempC == -127.00) {
lcd.print(“Error”);
} else {
// lcd.print(tempC);
// lcd.print(“/”);
currentTemp = (DallasTemperature::toFahrenheit(tempC));
lcd.print(currentTemp);
Serial.print(“Current Temp “);
Serial.println(currentTemp);
Serial.print(“Set Temp “);
Serial.println(setTemp);
}

}

void loop(void)
{
Serial.println(“Begin main Loop”);
int FanVal = digitalRead(FanPin);
int val = digitalRead(SwitchPin) ;

delay(500);

sensorValue = analogRead(sensorPin);

setTemp = sensorValue / 10.24; //Gives us a set temp range between 0 and 99 degrees

//lcd.clear(); // start with a blank screen
lcd.setCursor(0,0);
lcd.print(“Current:”);
lcd.setCursor(0,1);
lcd.print(“Set:”);
//lcd.setCursor(0,3);
//lcd.print(“Heat: “);

lcd.setCursor(8,0);
printTemperature(insideThermometer);
lcd.setCursor(6,1);
lcd.print(setTemp);
//lcd.setCursor(7,3);
//lcd.print(heat);
Serial.print(“FanPin: “);
Serial.println(FanVal);
Serial.print(“SwitchPin: “);
Serial.println(val);

if (val == 1 && FanVal == 1 && currentTemp < setTemp )
{
fan() ;
}
else if (val == 0)
{
heating() ;
}
else if (val == 1)
{
cooling() ;
}
Serial.println(“Finished Loop… Restarting Loop”);
}
//Cooling Mode
void cooling()
{
Serial.println(“Begin Cooling Loop”);
int val = digitalRead(SwitchPin) ;// val represents digitalRead(SwitchPin);
// If the value of is 1 then make hcLED low (off) which sets the relay in a normally closed state. Hence, turning on the blue LED.
digitalWrite(hcLED, HIGH);
/* If the SwitchPin reads 1 and the current temperature is greater than the set temperature (if its hot) turn on the A/C and internal fan */
if (currentTemp > setTemp + 5)
{

digitalWrite(SSRFan, HIGH);
Serial.println(“Cooling Mode Fan On, Current Higher than Set”);
digitalWrite(SSRHPin, LOW);
Serial.println(“Cooling Mode Heat Off, Current Higher than Set”);
digitalWrite(SSRCPin, HIGH);
Serial.println(“Cooling Mode Cool On, Current Higher than Set”);
}

/* Otherwise, if the SwitchPin reads 1 and the current temperature is less than the set temperature (the set temperature has been reached), turn off the A/C and internal fan */

else if (currentTemp < setTemp - 3)
{
digitalWrite(SSRFan, LOW);
Serial.println(“End Cooling Mode Fan Off, Temp satisfied”);
digitalWrite(SSRHPin, LOW);
Serial.println(“End Cooling Mode Heat Off, Temp satisfied”);
digitalWrite(SSRCPin, LOW);
Serial.println(“End Cooling Mode Cool Off, Temp satisfied”);
}
}
// Heating Mode

void heating()
{
Serial.print(“Begin Heating Loop”);
digitalWrite(hcLED, LOW);

/* If the SwitchPin reads 0 and the current temperature is less than the set temperature (if its cold) turn on the HEAT and internal fan */

if (currentTemp < setTemp - 5)
{
digitalWrite(SSRFan, HIGH);
Serial.println(“Heating Mode Fan On, Current Lower than Set”);
digitalWrite(SSRCPin, LOW);
Serial.println(“Heating Mode Cool Off, Current Lower than Set”);
digitalWrite(SSRHPin, HIGH);
Serial.println(“Heating Mode Heat On, Current Lower than Set”);
}
/* If the SwitchPin reads 0 and the current temperature is greater than the set temperature (the set temperature has been reached) turn off the HEAT and internal fan */
else if (currentTemp > setTemp + 3)
{
digitalWrite(SSRHPin, LOW);
Serial.println(“End Heating Mode heat Off, Temp satisfied”);
digitalWrite(SSRFan, LOW);
Serial.println(“End Heating Mode Fan Off, Temp satisfied”);
digitalWrite(SSRCPin, LOW);
Serial.println(“End Heating Mode Fan Off, Temp satisfied”);
}
}
void fan()
{
Serial.println(“Begin Fan Only Loop”);

//Fan Only Mode

digitalWrite(SSRFan, HIGH);
digitalWrite(SSRCPin, LOW);
digitalWrite(SSRHPin, LOW);

}

 

LCD_DS18B20_Relay_Shield_Breadboard

Supplies:

  1. You will need an Egg carton (to hold eggs)
  2. Two Eggs
  3. Four quick setting clear epoxy Like this
  4. four color changing LEDs Here are some.
  5. One 8″x6″ Project box These are perfect
  6. One quadruple , Double A  Battery holder Try this
  7. 9 Volt battery connector Here
  8. Two 110 ohm 1/4 watt resistors Here
  9. One small switch Here
  10. One piece of copper clad bread board
  11. Some 24 gauge wire
  12. Two feet of material (for wrapping the enclosure)
  13. One or more Stuffed Bunnies
  14. Thread (Try to match to your material)
  15. Wire grommet
  16. A USB cable (we will be cutting it)

Tools:

  1. Drill
  2. Sewing Needle
  3. Something to mix the two part epoxy in
  4. Soldering Iron
  5. Solder
  6. Clip on heat sink
  7. Hot glue
  8. Hot glue gun
  9. Phillips head screw driver
  10. Drill Bits
  11. Dremel
  12. Dremel cutting bit

Steps:

  1. Lets start by Washing the outside of the egg with soap and cool water. Then Drill out the top and bottom of some raw eggs with the dremel at high speed (25000 - 30000 RPM). Make the hole in the bottom of the egg larger than the one in the top. It will need to be large enough to pour in your epoxy. You will need to drain out ALL of the egg white and yolk by blowing through the top hole. Then thoroughly rinse the inside and outside of the egg shell through the large hole you drilled.
  2. Make a hole in the bottom of each place in the carton that you will be placing the eggs (this allows for plenty of air flow). Put a paper towel under the egg carton. Place the eggs with the large hole at the bottom in your egg carton where you just put the holes. We need to allow the eggs to dry for a while. If you are impatient(like me) you can use a hair dryer to dry out the eggs more quickly. You will still need to allow them to cool and air dry some(maybe an hour or so.)
  3. Once the eggs are clean and dry put some scotch tape over the small hole. Now mix one half of your first tube of two part epoxy and immediately pour it into the first egg. Then repeat this till the first egg is full. Once the egg is full place it in your egg carton with the hole facing up. Then repeat for the second egg.
  4. While you are waiting for the epoxy to set in the eggs lets work on our project box. Start by placing the battery holder inside the box to figure out you placement. Then figure out where you want your switch (usually on the back somewhere). What ever space is left over is where you will be placing the breadboard. You may have to cut your breadboard to fit. You can use the dremel or a pair of airline cutters for accomplishing this task.
  5. Its time to get the soldering iron and solder out. Heat your soldering iron to high if you have a dual temp iron. If you don’t, then you will need to have a soldering iron that is at least 45 watts. If your soldering iron is to cool then it will take to long to heat your components and may burn out your LEDs. Now solder the negative lead of the battery holder to the breadboard and the positive lead to the switch. Then solder a wire from the other tab on the switch to the opposite end of the breadboard.
  6. Now bridge two adjacent holes on the bread board with the positive lead from the switch. (this will be where you will solder the resistors)
  7. Solder the resistors from the two bridged points on the positive lead to the other end of the breadboard, leaving some room on the end for your LED leads to attach.
  8. Now bridge the negative lead to an adjacent hole and solder in a jumper from the bridged hole to the other end of the breadboard, again leaving enough room for your LED leads. Bridge from the negative jumper to two more adjacent holes.
  9. Cut the USB cable to length to go from the breadboard to the eggs that the Bunny will be holding, leaving a little extra for mistakes, and strip one end back about 1.5″ and the other end about 4 -6″.
  10. Choose your colors for negative and positive for each LED. Solder them to the board. (Negative to Negative and each positive to a resistor.)
  11. Drill the holes in your Project box for the USB cable and the switch.
  12. Mount the switch, battery pack and breadboard inside the project box with hot glue.
  13. Run your USB cable through the hole you drilled and put in the grommet at the hole around the cable, then hot glue the grommet and cable on the inside of the box. (this will help ensure the cable wont have too much movement and cause problems later on)
  14. Now time to go back to the eggs. They should be plenty ready now. Now crack and peel off the shells. Once you have done that you will probably have to clean the  Epoxy eggs with very warm water and soap.
  15. Now find a drill bit that is just slightly bigger around than your LEDs. Drill out two points at the bottom of each egg for the LEDs to be placed in. Before permanently adhering your LEDs in the eggs test them by twisting the wires on from your circuit. Once you are certain that your LEDs are working with your circuit permanently adhere them with some epoxy.
  16. Sew your Bunny (Bunnies) to your fabric that you chose for wrapping your project box.
  17. Route the LED wire however you see fit for the placement of your eggs.
  18. Wrap your project box with your fabric using hot glue to adhere the fabric to the box making sure to get your Bunny placement right.
  19. Hot glue the eggs into place and flip the switch.

I have finaly gotten the Canon Pixma MP495 working under Ubuntu 10.10, with full resolution capabilities of the printer.
This printer is only advirtised as having a max resolution of 4800×1200 DPI. However, I called Canon to get the full range of print resolutions and was informed that this printer is capable of 9600×2400 DPI.

I haven’t tested this below Ubuntu 10.04 but it should work fine.

For setting your MP495 printer up on your network without the use of a Windows or Mac machine (Fresh out of the box with Ubuntu) you will need to match your Routers SSID to the printers default SSID, and remove any security you have enabled. This will allow the printer to connect to your network.
Printer Defaults:
SSID: BJNPSETUP
IP ADDRESS: Automatic

Once you have done that you will need to activate the wireless lan on the printer.
Press the Maintenance button on the printer 15 times until you see what looks like a capital E without the top line. Then press the color start button. (refer to page 10 of your Network Setup Troubleshooting manual for an actual picture of the symbol) You should see the wifi light on the front of the printer turn on and be solid not be blinking. (If it is blinking check your routers SSID settings and match the Default SSID of the printer as listed above.

Now download AngryipScanner and install it by double clicking it. It should open in the Software center or with the Gdebi installer. (this may take a few minutes to install.)
Once you have installed AngryIPScanner, run it and change the ip range to include from 1 - 254 in the last octet. Then click start.
When it finishes look for an active connection with a Hostname like A001BF000000.local. Yours may be different but should be very simular.
The IP address given for that hostname is the IP address of your printer. Open Firefox and type that address in the address bar and press enter. From there you can configure you printer for the SSID, and encryption that you had on your router before the change, and set a static IP for the printer so you can manage it easily.
After you change the SSID and encryption on the printer you will have to go back to your router and change the SSID and encryption back to what it was before so your printer can connect again.

Now your network should be back the way it was and your printer should be connected

Now that you have successfully connected the printer to your wireless network continue with the rest of the installation.

Download the drivers for the mp495

You will be downloading cnijfilter-mp495series-3.40-1-deb.tar.gz.

Try this method first!
Extract cnijfilter-mp495series-3.40-1-deb.tar.gz to your Home directory.
Change the permissions of the install.sh file to run as an executable by Right clicking on install.sh and then left clicking Properties.
Click on the Permissions tab and put a check mark in the Allow Executing file as program box.
Then open a terminal and type:
sudo ./install.sh
Follow the prompts and if you are using the printer over the network select network when prompted. I you are using it via USB choose USB.
Don’t forget to scroll down to complete setting up your printer to use full resolution and set up the scanner.

If the first method didnt work try this.

Open a terminal and enter cd /home/*/cnijfilter-mp495series-3.40-1-deb/packages . (Enter your username where the astride is.)

For 64 bit systems you need to replace cnijfilter-common_3.40-1_i386.deb, and cnijfilter-mp495series_3.40-1_i386.deb with cnijfilter-common_3.40-1_amd64.deb, and
cnijfilter-mp495series_3.40-1_amd64.deb. For the printer setup.
For the scanner replace scangearmp-common_1.60-1_i386.deb, and scangearmp-mp495series_1.60-1_i386.deb with scangearmp-common_1.60-1_amd64.deb, scangearmp-mp495series_1.60-1_amd64.deb. Everything else is the same.

Now enter sudo dpkg -i cnijfilter-common_3.40-1_i386.deb and press enter.

Now enter sudo dpkg -i cnijfilter-mp495series_3.40-1_i386.deb and press enter.

After that is complete go to System-Administration-Printing and click on Add.

If you have set up your printer on your network you should find it listed under Network Printing after a moment. (It takes a second for Ubuntu to find it on the network.)
Select the Canon-MP495-series_XX-XX-XX-XX-XX then click [Forward].
It will tell you that it is searching for Drivers. (wait for it…..)
In just a second a new window will appear asking for the Description of the Printer. Give it a name in the Location Field.

Now that you have a functioning MP495 printer, printing at a meager 600 DPI, lets make it better!

Change the Available Resolutions for Printing

Open another terminal and edit the first of two postscript files for this printer. gksudo gedit /etc/cups/ppd/Canon-MP495.ppd

Find:

*OpenUI *Resolution/Output Resolution: PickOne

Then we are going to replace the text from:

*OpenUI *Resolution/Output Resolution: PickOne

to:

*CloseUI: *Resolution

With:

*OpenUI *Resolution/Output Resolution: PickOne
*DefaultResolution: 4800dpi
*Resolution 600dpi/600 DPI: “<</HWResolution[600 600]>>setpagedevice”
*Resolution 1200dpi/1200 DPI: “<</HWResolution[1200 1200]>>setpagedevice”
*Resolution 2400dpi/2400 DPI: “<</HWResolution[2400 2400]>>setpagedevice”
*Resolution 2400dpi/4800 DPI: “<</HWResolution[2400 4800]>>setpagedevice”
*Resolution 2400dpi/9600 DPI: “<</HWResolution[2400 9600]>>setpagedevice”
*CloseUI: *Resolution

Save and close gedit.

Open another terminal and edit the second postscript file for this printer. gksudo gedit /usr/share/ppd/canonmp495.ppd
Find:

*OpenUI *Resolution/Output Resolution: PickOne

Then we are going to replace the text from:

*OpenUI *Resolution/Output Resolution: PickOne

to:

*CloseUI: *Resolution

With:

*OpenUI *Resolution/Output Resolution: PickOne
*DefaultResolution: 4800dpi
*Resolution 600dpi/600 DPI: “<</HWResolution[600 600]>>setpagedevice”
*Resolution 1200dpi/1200 DPI: “<</HWResolution[1200 1200]>>setpagedevice”
*Resolution 2400dpi/2400 DPI: “<</HWResolution[2400 2400]>>setpagedevice”
*Resolution 2400dpi/4800 DPI: “<</HWResolution[2400 4800]>>setpagedevice”
*Resolution 2400dpi/9600 DPI: “<</HWResolution[2400 9600]>>setpagedevice”
*CloseUI: *Resolution

Save and close gedit.

Now restart the cups service.
with sudo service cups restart in Ubuntu 10.10 and I think 10.04 too.
or sudo /etc/init.d/cups restart in previous verions.

You can now print with resolutions ranging from 600 DPI to 9600 DPI!
Enjoy.

For getting the scanner working download the drivers from here
extract scangearmp-mp495series-1.60-1-deb.tar.gz into your home directory.
Open terminal and type. (Replace the astride with your user name.)
cd /home/*/scangearmp-mp495series-1.60-1-deb
sudo ./install.sh
Then to use your scanner, open terminal and type.
scangearmp
A Big thanks goes to BartmanMN for finding the Scanner drivers.
Enjoy!

UPDATE 12/19/2012

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

This process is outdated. Visit the Buffalo Website and download the latest firmware release to use the WHR-HP-G300N as a repeater with out all of the complicated mess. Then check out my new post for setting up the Buffalo WHR-300HP as a wireless bridge or repeater for a full video walk through on how to configure either the WHR-HP-G300N or the WHR-300HP as a repeater.

 

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 

 

If you have a buffalo router with DD-WRT already installed then download this File. This is a downgrade from the currently installed DD-WRT firmware from Buffalo. Once you download the firmware, Extract it. I like to use WinRAR.

If you have the original NON DD-WRT Buffalo firmware then follow the instructions on their site for upgrading the firmware to the DD-WRT firmware and then follow the instructions above.

Perform the downgrade to the firmware I have provided through the link above. To do so…

  1. Reset your router to Defaults by going to (your routers IP… 192.168.11.1) Administration -> Factory Defaults Click Yes and then Apply Settings.
  2. Once your router has been reset to default, browse to 192.168.11.1 and go to Administration -> Firmware Upgrade. In the drop down menu select Reset to default settings. Click Browse and select the file that you extracted from the download. Click Upgrade.
  3. Your Router will be doing an Upgrade. If you unplug the router or power off the computer during the upgrade you will Brick your router! When it is done Close and reopen your browser (IE, Firefox…ETC.) Browse to 192.168.1.1 this should be the new IP Address of your router. Create a new username and password.
  4. Go to Setup. Change the WAN Connection Type to Disabled. Also, on the same page before saving the settings, Change DHCP Type to DHCP Forwarder. Click Apply Settings.
  5. Wait a few seconds. Your router is going to reboot after each time you click Apply Settings.
  6. Go to Wireless ->Basic Settings , at the bottom of the page click Add under Virtual interfaces. Set the Wireless mode to WDS AP, and change Wireless network name (SSID) to match the wireless network you are trying to extend. Click Apply Settings.
  7. Go to Status -> Wireless and scroll to the bottom of the page and click on Site Survey. Click on Join next to the network you are extending. This will pop up a message and then return you back to the basic wireless setup screen. Change the Wireless mode of the Physical interface to Client Bridge and click on Apply Settings.
  8. Go to Wireless -> Wireless Security and put in the passkey to your existing wireless network in both the Physical and Virtual interfaces. Click Apply Settings. Verify that the passkey was accepted in both fields after the settings have been saved. If only one has security, then you need to re-enter the passkey for the one that didn’t take and Click Apply Settings again.

That should conclude setting up your router as a repeater/extender.

 

UPDATE 11/18/2011:

If you are extending the WIFI from another WHR-HP-G300N you can only use WEP encryption or No encryption for the connection between the router and the repeater. I haven’t run into any problems when using the WHR-HP-G300N with other routers on any encryption types.

As we all know, WEP encryption isn’t the most secure. So, if you are in the position of having to extend the WIFI from another WHR-HP-G300N, make sure that you use a different SSID for the connection between the router and repeater and disable SSID broadcast. and then add a new virtual interface to the router of the SSID you want to extend. This will help protect you from someone attacking your wireless network.

If you are having trouble then please register and leave a comment.



 

 

I built this so I could leave my dogs unattended for a weekend. The entire build took 3 hours from start to finish. Its not the prettiest but it serves its purpose perfectly.

Each food drop delivers 1 1/2 cups of dog food. This will have to be adjusted for your build and pet.

I used 8″ sanitary PVC pipe for the holding tube and just reshaped one end as a funnel with a heat gun.

I used a parallax homework board for the controller. Download the .bs2 file below.

dogfeeder.bs2 file

I will be improving on this project and tutorial in the near future. The plan is to use a PIC16F877 microcontroller for the final build. Check back for more later!

Use the videos to determine how to open your computer case and what to clean out. I like to use can compressed air. You can purchase compressed air from Walmart, Radio Shack, Best Buy.. Etc.



  • Archives

  • Catagories

  • NAV

%d bloggers like this: