Introduction: Wireless BT Power Socket (Arduino Based) + Android App
This device will allow you to control an electrical device from your Android smartphone (or tablet).
It uses a Bluetooth module for wireless communication to control the built-in relay switch.
The circuit uses the ATmega328p - Arduino uno - microcontroller for reading serial data from the Bluetooth module.
Visit www.ardumotive.com for more Arduino projects!
Step 1: What You Will Need
For this project you will need:
1st part list:
- ATmega328p (with Arduino Bootloader)*
- 28 pin DIP IC Socket
- 16MHz Crystal Oscillator
- 2x 22pF and 1x 100nF capacitors
- 10K resistor
- HC-06 Bluetooth module (yes, you can also use HC-05...)
- Relay module (one channel - 5V Vcc!)
- Prototyping PCB Circuit Board Stripboard
2nd part list:
- AC to DC adapter 5V ~1A (I used one phone charger)
- Schuko power socket
- Schuko power plug
- Schuko power cable 0.5M to 1M
- 1x Clamp
*You will need also an Arduino UNO board to program the ATmega328 micro possessor.
- Soldering iron
I made my box from MDF wood sheet. (you can also use plastic, plexiglass or another material to build it) I will explain more below. In this part maybe you will need and some kind of glue or screws.
Note for beginners:
If you want to make it easier you can just use an Arduino uno board and avoid soldering procedure! In this case you will need only the relay module from "1st part list". You can power on your circuit from usb cable or 12V adapter.
Step 2: The Circuit
Connections are easy, but you must pay attention on "Electric circuit" (1st image above) - Risk Shock Electricity!
If you are a "pro" you can find the "electronic" circuit schematic at 2nd image above, if you are a beginner you will find a "breadboard" schematic with Arduino uno at 3rd image above. ATmega328 pinout can be found on 4th image.
Note:DO not plug your circuit to the power wall socket if you are not 100% sure about your connections! Never touch relay pins when power is on!
Step 3: The Box
As I said before, I made my box from MDF wood sheet. You can make it as big or small you want, just make sure to fit all of the components. Take a look on above photos to take an idea. Make sure to leave one side as a lid just in case you want to change something or program the micro processor.
When it's ready, you can paint it to your favorite color! I painted my box to Arduino color ;)
Step 4: The Code
Here's the code, embedded using codebender!
Remove atmega328 from dip socket and plug it to Arduino uno board.
Connect it with your computer and press "Run on arduino" button.
Now remove it from Arduino board and plug it again to yours "Arduino based" circuit
Note: If you are a "beginner" make sure to disconnect rx & tx pins from arduino uno board before start programming.
You can read comments in code
Step 5: The Android Application
You can use this application on android smartphone or tablet with Bluetooth support.
(make sure that you have already enabled the "unknown sources" from security settings to install this apk)
How to use it:
- Enable Bluetooth connection from settings
- Scan for devices and make a connection with "HC-06" (pass:1234) - Pair device
- Open app and click on "Load Paired Devices" button
- Now click to yours
- Press the button ones to open your electrical device (e.g. desk lamp), press button twice to turn it off.
Note: This is the first version of this app and I have already test it but if you find any bugs you can leave a comment below.
Step 6: Well Done!
That's it! Now you have your own Wireless BT Power Socket device!
Keep in mind that relay can handle current up to 10A (AC 250V / DC 30V)!
I hope you liked this, let me know in the comments.
There will be more of them, so make sure to click Follow button :)
Participated in the