Arduino Controlled 432 MHZ Wireless Power Outlets
Arduino Controlled 432 MHZ Wireless Power Outlets
Home automation becomes more and more popular, affordable and fascinates people. Internet offers such
possibilities as never before. Impress your friends showing on Iphone that you can switch on/off lamp in your
apartment 1000 km away and simultaneously see it through a webcam.
Wirelessly controlled power outlets are best suited for switching on/off appliances as they do not need cables and
only the remote control needs to be interfaced to a microcontroller. Design is electric -shock -safe as the high voltage
modules are not opened.
Arduino microcontroller greatly simplifies the task, because it is a standard board that can be easily reprogrammed.
Arduino could be connected to a PC, WiFi router with USB running OpenWRT, or direct connection to Internet could be
done via Arduino Ethernet shield. Picture below illustrates how home automation box could look. There are external
sensors attached to Arduino, PIR, photodiode, sound level monitor, 1-wire temperature sensors DS18B20.
Before building one please prepare yourself by reading through these links:
Almoust Arduino, but simpler. One chip, direct USB connection, charge pump to make 12 V for transmitter.
But more difficult to reprogram than Arduino.
http://www.instructables.com/id/USB-controlled-home-automation-hack/?ALLSTEPS
10 EUR Funk – Schalter set 6899 433 MHz. Removed from market because of fire danger
http://avr.börke.de/Funksteckdosen.htm
http://www.baua.de/de/Publikationen/BAuA-AKTUELL/2007-3/pdf/ba3-07-s09.pdf?__blob=publicationFile&v=2
Conrad.de 10 EUR only one remote and one outlet. Or 20 EUR 3. Design looks crappy.
http://blog.sui.li/2011/04/12/low-cost-funksteckdosen-arduino/
Funksteckdose
REV Telecontrol 1000 W 1+3 er Set' von www.rev.biz
Art. Nr 008345 <20 EUR. For this price can not make self.
Remote control has 4 switch selections A, B, C, D and 3 ON/OFF buttons allowingv to control 12 loads.
Power outlets are quite smart. They remember the last state also when removed from power.
Disadvantage - red LED on all time, does not indicate status of load.
Power consumption measured of one outlet was below 1W. The meter showed 0.0W.
Chip gets power less than the battery voltage, ca 5V. The signal amplitude from chip is TTL.
Smart buttons on circuit board. Double pressed layout. Power connected to chip and also to button encoder.
SAW filter 433 MHz as resonator for transmitter. Good thermal stability.
My previous solution to build in a relay into an outlet is not CE certified and probably illegal,
but wireless Funksteckdose remains certified and thus it could be even sold.
Reverse engineering
Schematics
Circuit below is not exactly what is inside. The transmitter actually has a 433 MHz SAW oscillator.
Signals
http://www.maltepoeggel.de/?site=usbfunk&p=3&lang=de
Remote needs 12 V, originally supplied by a battery. If you don’t want a battery in your gadget then can make a charge
pump from Arduino.
http://www.instructables.com/id/USB-controlled-home-automation-hack/?ALLSTEPS
This kind of voltage doubler should work too on Arduino PWM output:
Code for Arduino nicely written http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294088583
Basics for one button. For hardware described here http://avr.börke.de/Funksteckdosen.htm
void setupFunk(){
pinMode(funkpin, OUTPUT);
}
void loopFunk(){
}
void codeSenden(char* sc){
char ch;
Measured on the chip output pin 15 using digital oscilloscope. Buttons for switch A only.
Haven’t tried to decipher encoding. Simply Arduino should reproduce these signals. Can connect Arduino to pin 15 of
the remote control chip. No level matching was necessary as the signal goes to the transistor base of the RF oscillator
via a resistor.
Further things to do: wireless temperature sensrors, weather station, PIR motion detector door/window switches.
http://www.practicalarduino.com/projects/weather-station-receiver
https://github.com/practicalarduino/WeatherStationReceiver
http://www.practicalarduino.com/about
Perl sensor lesen
http://www.mikrocontroller.net/topic/252922
My code
Copy - paste into Arduino SDK. Use Arduino0022 to compile. Code worked for me, sorry somewhat ugly.
Check with digital oscilloscope that Arduino produces signals identical to original remote.
#include <OneWire.h>
#include <DallasTemperature.h>
#define TEMPERATURE_PRECISION 12
#define ONE_WIRE_BUS 2 // Onewire data wire is plugged into port 2 on the Arduino. Needs ca 4k pullup resistor to 5V.
OneWire oneWire(ONE_WIRE_BUS); // Setup 1Wire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
DallasTemperature sensors(&oneWire); // Pass our oneWire reference to Dallas Temperature.
DeviceAddress insideThermometer, outsideThermometer, thirdThermometer; // arrays to hold device addresses
int d=314; // delay adjusted to macth original wireless remote. Use a digital oscilloscope to check.
int tpin=13; // 433 MHz RF transmitter hooked to this pin (soldered parallel to the remote encoding chip output.)
int dig1pin=11; int dig2pin=12; // digital outputs that can be switched on with a serial command
String dig1="d1off "; String dig2="d2off ";
String tA1=" A1? "; String tA2="A2? "; String tA3="A3? "; // last command output to wireless socket
int count=0; //byte count in serial message
void setup() {
pinMode(tpin, INPUT); // we unblock transmit pin when not in use so that normal remote functions too.
pinMode(dig1pin, OUTPUT);
pinMode(dig2pin, OUTPUT);
Serial.begin(9600); Serial.flush();
Serial.println ("Reads AI0, AI1, AI2. Controls digital output pins 11, 12. Commands to switch digital outputs: D1on, D1off, D2on, D2off.");
Serial.println ("Generates 1-wire bus (pin2) for DS18B20 temperature sensors. Needs external4.7k pullup.");
Serial.println ("433 MHz wireless power outlet chip HS2260A-R4 simulation (pin 13). Commands: A1on, A1off, A2on, A2off, A3on, A3off.");
Serial.println ("Reset button of Arduino is disabled to 5V, remove jumper for reprogramming");
Serial.println ("Make sure there is no echo from USB host back to Arduino, buffer will overload and commanding will not work");
sensors.begin();
if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find 1-wire sensor nr 1");
if (!sensors.getAddress(outsideThermometer, 1)) Serial.println("Unable to find 1-wire sensor nr 2");
if (!sensors.getAddress(thirdThermometer, 2)) Serial.println("Unable to find 1-wire sensor nr 3");
sensors.setResolution(insideThermometer, TEMPERATURE_PRECISION);
sensors.setResolution(outsideThermometer, TEMPERATURE_PRECISION);
}
// functions for wireless remote control emulation
void I() { // sends one
digitalWrite(tpin, HIGH); delayMicroseconds(3*d); digitalWrite(tpin, LOW); delayMicroseconds(1*d);
digitalWrite(tpin, HIGH); delayMicroseconds(3*d); digitalWrite(tpin, LOW); delayMicroseconds(1*d); }
void O() { // sends zero
digitalWrite(tpin, HIGH); delayMicroseconds(1*d); digitalWrite(tpin, LOW); delayMicroseconds(3*d);
digitalWrite(tpin, HIGH); delayMicroseconds(1*d); digitalWrite(tpin, LOW); delayMicroseconds(3*d); }
void F() { // sends float
digitalWrite(tpin, HIGH); delayMicroseconds(1*d); digitalWrite(tpin, LOW); delayMicroseconds(3*d);
digitalWrite(tpin, HIGH); delayMicroseconds(3*d); digitalWrite(tpin, LOW); delayMicroseconds(1*d); }
void E() { // synchronization
digitalWrite(tpin, HIGH); delayMicroseconds(1*d); digitalWrite(tpin, LOW); delayMicroseconds(31*d); }
void loop() {
String kommand=""; // string received via com port
String report=""; // string output to com port
count=Serial.available();
for (int x=0; x<count; x++) { char ch = Serial.read(); kommand = kommand + ch;}
//if (kommand != "") {Serial.print (kommand); Serial.println (count);}
kommand=kommand.substring(0,4);
if (kommand=="A1on") {tA1=" A1on "; pinMode(tpin, OUTPUT);
for (int i=0; i <= 20; i++) { I();F();F();F();I();F();F();O();O();O();I();O();E(); } }
Important!!
Disable echo back to Arduino, its input buffer will fill up and Arduino will not listen to commands/
opkg update
opkg install kmod-usb2
opkg install coreutils-stty
opkg install kmod-usb-serial
opkg install kmod-usb-serial-ftdi
#!/bin/sh
#/var/www/cgi-bin/readuino.sh
if ! [ -f /tmp/isrunning ]; then
if [ -c /dev/ttyUSB0 ]; then
#!/bin/sh
#!/www/cgi-bin/arduino
# simple CGI to tail most recent info from an arduino
#opkg update
#opkg install coreutils-stty
#opkg install kmod-usb-serial
#opkg install kmod-usb-serial-ftdi
if ! [ -f /tmp/isrunning ]; then
/www/cgi-bin/readuino.sh & 2>&1 >/dev/null
fi
echo "<hr><b><font color=brown>Wireless wallplug outlet 433 MHz transmitter on Arduino pin 13, wallplug address A1.</b>"
echo "<br> Mains power: " $A1
echo "<form><input type='button' value='Switch ON ' onClick='window.location=1'></form>"
echo "<form><input type='button' value='Switch OFF' onClick='window.location=0'></form>"
echo "<hr></html>"
echo ""
#!/bin/sh
#!/www/cgi-bin/1
# switches on 432 MHz power outlet
echo "Content-type: text/html"
echo ""
echo "<html><body>"
if [ -c /dev/ttyUSB0 ]; then
echo "/dev/USB0 exists, OK <br>sending command 1 ON"
echo "A1on">/dev/ttyUSB0
else
echo "/dev/ttyUSB0 does not exist<br> can not send command"
fi
echo "</body></html>"
Home automation kit including a new TP LINK router WR703N interfaced to Arduino that reads sensors and controls wireless power outlets.
Nice low power consumption solution how to connect your home to Internet, read sensors, control electric appliances, make graphs.
Pocket router WR703N is the newest home automation solution and most cost-effective.
This pocket size router has a single chip 400 MHz processor that uses 1W power, wifi interface, ethernet and USB.
Original chineese firmware is reflashed with OpenWRT that is a most popular small-size Linux distribution for routers.
It is a powerful kit for learning Linux programming using command line.
You can store personal webpage on it. Router preserves its original properties as a WiFi router.
Arduino is a very popular standardized microcontroller board with many examples and easy programming.
Arduino Duemillanove is connected to router via USB. It reads 3 analog inputs and passes values to router.