Home Automation Bluetooth 433Mhz Android
Home Control is using Android app to control six 433Mhz switches over Bluetooth-Arduino-433Mhz transmitter.
A OLED display is added to show information to user.
On display information will look like this:
Switches #1-#6 1 - 2 - 3 - 4 - 5 - 6
Status Switches * = on * * * * * *
Day / Date Mon 23
Time hh:mm:ss 19 : 26 : 05
BT paired / month BT 04
Timer >>, work days >> mon-thu 17:00 23:30
Timer >>, weekends >> fri-sun 17:00 23:45
!! Staus show only that commands are transmitted, does not have real feedback that Switches are realy switched ON !!
Written by Chris Mollema from The Netherlands
This was my first trial programming with Arduino UNO, please forgive if it's written rather basic.
All code is as much as possible documented in this sketch, suggestions are welcome on
[email protected]
For control with Android smartphone or tablet or phone I made a App using on-line MIT Inventor
I used a Arduino Uno R3 (ebay-clone) for testing and eventualy build the real module with small Arduino NANO (ebay-clone) in a small housing
Memory 20.950 bytes (68%)
Variables 1.858 bytes (90%)
Low Memory warning: I never experianced problems
Costs for this Project:
Arduino Nano € 3 ebay
RTC 1307 or 3231 € 2 ebay
BT HC05 € 4 ebay
OLED display € 4 ebay
433Mhz receiver+transmitter € 2 ebay
Prototype PCB 3x6 cm € 1 ebay
Power Supply adapter 5V € 0 common used phone USB adapter
Switch on-off BT € 0 scrap
Capacitor 100uF/10V € 0 scrap (for reducing spikes on power Vcc-Gnd, I experienced sometimes RTC set to 00:00:00 when power on-off, might have to do something with CH bit initialising RTC clock module??)
2 sets Switches+Remote €20 Action shop NL
Lot of Fun € 0
Total €36
********************************************************************
This Sketch is for a 128x64 size OLED display (Yellow-Blue) bought on ebay
OLED SPI type wiring:
OLED module => Arduino Board + change lines 222-225
GND => GND
VCC => 5V
SCL => pin 10
SDA => pin 9
RST => pin 13
D/C => pin 11
OLED I2C type wiring:
OLED module => Arduino Board + change lines 222-225
GND => GND
VCC => 5V
SCL => A5 for Nano and SCL on Uno
SDA => A6 for Nano and SCL on Uno
********************************************************************
RTC Real Time Clock DS1307 or DS3231 wiring I2C, a DS3231 is more accurate, bought one on ebay with rechargeble Lithium battery included, tested with this program and found OK.
GND - VCC 5V
RTC SCL => pin A5 Arduino
RTC SDA => pin A4 Arduino
Future plans : Time can not be set within this program, please download Timeset and follow instructions on serial monitor to adjust local year-date-time
*********************************************************************************
* DISCONNECT BLUETOOTH TX-RX line when uploading sketch to Arduino UNO / NANO *
*********************************************************************************
Bluetooth connection module HC05 v01 (5 Volt DC version)
HC05----Arduino
GND => GND
VCC => 5V
Connect BT STATE output to UNO pin 7, this pin indicates the module has a bluetooth connection (not all versions have this function integrated in the module)
Connect Bluetooth TX to UNO RX with (I put a switch between TX-RX, OPEN CONNECTION during loading program Arduino otherwise communication error )
BT Tx ------switch------UNO Rx
Connect Uno TX pin 1 with serial resistor divider
(Output signal 5V must be reduced to 3,3V on BT input RX)
UNO TX ]----[1 kOhm] --+-- [2.2 kOhm] ----[ GND
|
+--[ BT RX
Connect centre divider to RX on BT module, signal is reduced to : 5V * (2.2 / (1+2.2) = 5V * 2.2/3.2 = 3,4V
********************************************************************
Buttons for manual switch ALL switches ON-OFF
Mini Push Button Momentary N/O , input HIGH when button is activated
Resistors 10k pull inputs low
Input 5 connected to button ON VCC -----[PB]----- Input 5 ----[10k]----GND
Input 6 connected to button OFF VCC -----[PB]----- Input 6 ----[10k]----GND
********************************************************************
Transmitter 433Mhz connections
Power 5V on VCC and GND
Connect Transmitter DATA to Arduino Uno Output Pin 8
Antenna: I used a coiled antenna but straight wire with length 6" will do
For more secure connection in communication all Codes are send twice to the Switches , a delay (TimerVal2) between each transmissions.
********************************************************************
Lamp Switch modules are common low-cost 433mHz modules, in the Netherlands sold by Action, Blokker etc.
One set normally is sold for around €10 with three ON/OFF switches and one 10-button remote control (one button ON and OFF for Channels 1-2-3-4-ALL)
The different Codes of the remotes are factory set and must be collected with software (433mHz RC-Sniffer), load Sniffer sketch on your UNO and connect a 433mHz receiver.
Codes from Remote Control are send to the 433Mhz-receiver, it's Data Output can than be read via your Arduino (use sketch RF-Sniffer) with serial monitor.
Write down remote transmitter codes for all 10 buttons (ON and OFF for 1-2-3-4-ALL) and apply them in this sketch : #define X1 - X8 for ON codes and Y1 - Y8 for OFF codes
For my Home Automation I used 2 sets: total 6 Switches
********************************************************************
*/