Bluetooth Home Automation Cheat sheet

Finished

πŸŽ‰ You built it!

Your phone now controls three lights and a fan through Bluetooth, an Arduino and four relays.

⬇ All sketches (ZIP)

Your project at a glance

Full wiring diagram

Phone commands

RelayArduinoControlsONOFF
1pin 8Light 1BA
2pin 9Light 2DC
3pin 10Light 3FE
4pin 11FanHG

Relays are active-LOW: LOW = ON, HIGH = OFF. Serial Monitor and Bluetooth both run at 9600 baud.

Signal side (Arduino)

FromTo
Arduino 5Vred (+) rail
Arduino GNDblue (βˆ’) rail
Relay VCCred (+) rail
Relay GNDblue (βˆ’) rail
Relay IN1Arduino pin 8
Relay IN2Arduino pin 9
Relay IN3Arduino pin 10
Relay IN4Arduino pin 11
HC-05 VCCred (+) rail
HC-05 GNDblue (βˆ’) rail
HC-05 TXDArduino pin 7
HC-05 RXDArduino pin 6

Load side (battery only)

FromTo
Battery +Relay 1 COM
Relay 1 NO220 Ξ© resistor 1
Resistor 1LED 1 long leg (+)
LED 1 short leg (βˆ’)Battery βˆ’
Relay 1 COMRelay 2 COM
Relay 2 NO220 Ξ© resistor 2
Resistor 2LED 2 long leg (+)
LED 2 short leg (βˆ’)Battery βˆ’
Relay 2 COMRelay 3 COM
Relay 3 NO220 Ξ© resistor 3
Resistor 3LED 3 long leg (+)
LED 3 short leg (βˆ’)Battery βˆ’
Relay 3 COMRelay 4 COM
Relay 4 NOFan wire 1
Fan wire 2Battery βˆ’

Battery βˆ’ never connects to the Arduino. Keep the JD-VCC jumper on the relay module.

Try next