Introduction: Bluetooth Controlled Switch (Android)
Having made an IR remote controlled switch for my house, I wanted to try the Bluetooth this time. So although I started to make a blue tooth controlled switch, I ended up throwing in a LCD display to see what was happening and finally added a distance sensor to turn on one light when a hand was waved in front of it.
I threw in a clock module so that the LCD display would not look blank when it had nothing to display.
Step 1: Materials Required
So for this project I required the following:-
4 relay module
16x2 LCD module
Bluetooth Transceiver module HC05
Distance sensor HC SR04
A small bread board
DS3231 clock module
Power source and
loads of wire of course.
Step 2: Issues Faced
Having made a shield in my previous project to operate the 16x2 LCD display with three wires, I ran into problems while trying to use the Lidquidcrystal595.h library originally written by Rowan Simms. When I Googled, I found there were others on the Arduino forum who had run into similar problems with code and hardware that had previously been proven.
Having made a shield, I was too lazy to make another one to work around the problem (especially after I established that my LCD display was in perfect working condition). The problem I faced is best summarized at https://forum.arduino.cc/index.php?topic=367676.0....
So for this project in order to display multiple characters, I have had to write a few lines of code to strip the string one character at a time and write it at different positions on the display.
Step 3: The Sketch and Future Improvement
The sketch is as attached.
Ideas for improvement:-
Yeah it works fine with the Blue tooth serial controller from Google Play (https://play.google.com/store/apps/details?id=next... I am now planning to incorporate voice control so that I can speak to my Android phone and control lights and fans at home.
Having tried IR and and RF control in my previous project to control lights at home, this introduced me to Bluetooth and using the distance sensor. Next logical step would be to put all I have learnt so far and take it to the next level.
Enjoy! Any constructive criticism would be most welcome.