This is the first installment of what I hope will be a complete and easy to understand series of tutorials on remote control using Arduino, Bluetooth, and free software that allows you to control just about any electrical device from an LED all the way to 110 volt AC lamps, fans, etc.
A word of warning: WARNING 110 volts of alternating current can kill, maim, and otherwise ruin your day so if you're not comfortable working with mains (110VAC in the USA) voltage please use this circuit to remotely turn on and off an LED instead. It is possible you could safely wire up the 110 volt AC circuit and then forget the circuit is live with powerful and deadly voltage and grab a bare wire thinking it is turned off when actually it is not. So be warned. Should you get hurt I am not responsible - You are!
Ok now that is out of the way, let's get started.
Step 1: Components You'll Need
To build this project in its most basic version you will need:
- HC-06 or HC-05 Bluetooth Module - ebay search
Arduino Uno/Nano/Pro-Mini just to name a few
Relay Module - ebay search
Bread Board - ebay search
5 volt direct current source - I used a converted computer ATX power supply
Jumper wires - I use Dupont type - ebay search
3.3V - 5V Logic Level Bi-Directional Shifter Module - ebay search
3.3 volt direct current source - Again I used a converted computer ATX power supply
Step 2: Wire It Up
In the bread board layout I've included a Logic Level Converter (aka level shifter) which will take the 5 volt signal from the Arduino down to 3.3 volts before sending the signal on to the Bluetooth HC-06, which is reputed to like the 3.3VDC signal the best. But honestly I've never had any issues with sending a 5 volt signal to the Bluetooth module. I have written a tutorial on Logic Level Converters. Click here to see it. The link will open in a new tab.
I've made a video showing the setup and operation of the project if you'd like to watch it. The narration is rather rambling and you might even find it annoying, but it does show a working configuration.
One point of maximum importance is the TX and RX connections between the Bluetooth and the Arduino. Make sure your Bluetooth RX pin is connected to the Arduino TX (pin 1). And the Bluetooth TX is connected to the Arduino RX (pin 0). And since the configuration on whatever device you would like to turn on and off remotely can be done many different ways i will leave that ultimate decision up to you. It can be as simple as putting the positive lead of the LED into the 13 pin on the Arduino and the negative lead into the GRD pin. I have written a tutorial on how relays work and you can read it here as well as a video How a Relay Works. All the links open in new tabs.
A note on powering the configuration. You do not want to power the relay from the Arduino if you can avoid it. The Arduino's pins only provide 40mA of current and the relay might need more than that so be sure and use a separate 5VDC power source for the relay and also tie all the ground points together. The video shows how the 5VDC power supply powers the Positive and Ground rails of the bread board and the power into the Arduino 5VIN pin is also from the 5 volt bread board rail.
This is the code you will want to upload to your Arduino:
Step 3: Add and Pair a Bluetooth Device to Your Computer
The software you will be using to contact the Bluetooth module (actually there are several varieties of software you can use) in this article will be demonstrated as being installed on a computer running Windows 7.
First thing you will want to do is add the Bluetooth module device to your computer's group of Bluetooth devices.
The easiest way to do that is to click the Bluetooth icon in your system tray usually located in the lower right hand corner of your screen. You may have to click the tiny up arrow to see the icon. When you click the icon you should get a menu with "Add a Device" at the top of the menu so go ahead and click it. Or you can click "Show Bluetooth Devices" where you will also find an "Add a device" link it the upper left hand corner of the window that opens up. Clicking the "Add a device" link will take you to your "Add a device" screen where your computer will begin scanning for Bluetooth devices. Make sure your project is powered up at this point so your computer can find the HC-06.
When you see the HC-06 has been found and the icon is displayed click it and you will see the Bluetooth device pairing screen. You will want to choose "Enter the device's pairing code" and then click "next" where you can enter the pairing code, which is either "1234" or "0000". Then click "next" and you will see your device has been successfully added.
Important: Go back to the 'Show Bluetooth Devices" window. Right click on the new HC-06 icon and then click on "Properties". When the "Properties" window opens you will see four TABS. "General" "Hardware" "Services" and "Bluetooth". You will want to click on the "Hardware" tab. Now below "Device Functions" in the box you will see "Standard Serial over Bluetooth link (COMXX)" Make a note of the number that follows the word COM. That is your COM port number.
Find your Bluetooth's COM port (2nd method).
To find your Bluetooth COM port number we take it step-by-step starting with clicking the Start button in the lower left hand of your Windows task bar. In WIN7 it is blue and round. (see picture). Click it and in the start menu you will see the Control Panel shortcut link. Click it to go to the Control panel. In Control Panel click the words System and Security. Now that you're on the System and Security page you want to look at your choices in System and click the Device Manager link. Now when Device manager opens you will see a list of all the devices that make up your computer. Go down the list until you see Ports (COM & LPT) Click "Ports (COM & LPT)" and you will see what ports are in use. The COM port you will want to note is probably the bottom one on the list.
You're almost ready to start remote control.
Step 4: Installing and Using PuTTY Software for Remote Device Control
Download the PuTTY software. The software is available at: http://www.chiark.greenend.org.uk/~sgtatham/putty...
The PuTTY software download is only 519KB and is not zipped. I recommend downloading it to your desktop where you will have the icon to click on to run the program. There is no installation procedure to go through, you merely click the icon and PuTTY will run. After clicking the icon you will most likely have to click YES on a security warning asking if you want to allow the software to run. After opening the software you will see the configuration dashboard where you set up how you want the software to run. Your choices are Raw, Telnet, Rlogin, SSH and Serial. Select "Serial", and in the field below "Serial line" put your COM port number. For example COM17. Having done that click "Open". Now you will see the monitor interface for the PuTTY software.
Press the number 1 on your keyboard to turn on the LED, lamp, fan (or whatever device you have in your Arduino, Bluetooth, Relay configuration) and press 0 (zero) to turn it off. In the Arduino sketch you can change the code on lines 31 and 39, - Serial.println("LED: off"); - to "FAN: off" or "LAMP: Off" or whatever you would like the monitor interface window on your computer to display.
Thank you and I hope this is a complete and easily understandable tutorial. If you have any questions please post them below and I or members of the Instructable community will give you the answers you need.
Volthaus Electronics Laboratory
Next tutorial will cover voice remote control of the Arduino - Bluetooth - Relay using your Android phone. i realize others have done tutorials on these subjects. My hope is that these will cover the more complicated areas in depth.