Introduction: Arduino Bluetooth Controlled Desk Lamp - With Relay Safety Box

Today I will show you how to build your own Bluetooth controlled desk lamp with arduino uno.

For this project you will have to build the safety ralay box that you can find it here:

https://www.instructables.com/id/Arduino-Safety-Rel...

(Note: If you don't want to build a safety box you can just use one relay module but you must cut the cable of the desk lamp to connect it with it. And you will also have a risk of electric shock.)

If you have already built this box, the procedure is very easy!

Watch presentation video on YouTube:

If you are new to Arduino world, this tutorial will be the best (and safest) way to learn and play with a relay module.

So, let's get started!

Step 1: What You Will Need

For this project you will need:

  • Arduino uno
  • Safety Relay box
  • Bluetooth module HC-06
  • Breadboard Shield (optional)
  • Desk Lamp

Only for advanced users:

If you already know how to use a relay and how to take safety precautions for electricity you will need:

  • Arduino uno
  • Relay Module (5v Vcc)
  • Bluetooth module HC-06
  • Desk Lamp

Step 2: The Circuit

The connections are pretty easy:

  • BT module Vcc - Arduino 5v
  • BT module GND - Arduino GND
  • BT module RX - Arduino TX
  • BT module TX - Arduino RX
  • Relay module signal pin - Arduino pin 3

Step 3: The Code

Here's the code, embedded using codebender!

To program your arduino with this sketch you must first remove the RX-TX cables from it.

Try downloading the codebender plugin and clicking on the Run on Arduino button to program your Arduino with this sketch. And that's it, you've programmed your Arduino board!

Use the serial monitor below to test it, press connect button and try to send 'W' to turn on the lamp, send it again to turn it off.

Now you can connect again RX-TX cables and proceed to next step.


Step 4: The Android Application

You can download ours android application from here:

http://www.ardumotive.com/android-app.html

If you have any problem with this application - or you don't have an android device, you must find (or make) an app that when you press a button it sends "W" letter. If it's necessary, you can change this command ("W") into your code in previous step.

Step 5: Well Done!

That's it! Now you have your own Arduino Bluetooth Controlled Desk Lamp!

Make sure to click Follow button ;)

I hope you liked this, let me know in the comments!

Comments

author
KotPomojnyj made it! (author)2016-03-29

I've got a problem. It work's fine, but then it works from battery - relay switching on first. It is bad for smart house.

author
rfernandes18 made it! (author)2015-11-14

Hi!!

Awesome tutorial!

But can you switch it on and off in the bluetooth device AND in the power switch? For instance, turn it on on the power switch and off via bluetooth and vice-versa? That would be even better!