Introduction: LED Control With Arduino
This i'ble will help you control an LED with an app over bluetooth from your smartphone.
Step 1: Things You'll Need...
An Arduino board.(An UNO would do, mine is a clone :p)
An LED.
A bluetooth module (HC05 or HC06).
A smartphone.
Step 2: Hook Things Up...
Connect the LED to the 13th pin of the Arduino and ground.
Connect the Tx of the module to the Rx of the Arduino and the Rx of the module to the Tx of the Arduino.
Connect the 5v pin of the modue to the 5v of the Arduino and the ground of the module to the ground of the Arduino.
Step 3: Coding...
Upload the given sketch bluetoothlights.ino to your board.
Remember to remove the Tx and Rx pins before uploading.
Attachments
Step 4: The App...
Download the apk and install it.
Make sure bluetooth is turned ON on your phone and that the bluetooth module is already paired with your device.
If it asks for a passkey it's 1234.
Step 5: Great! Finished.
Now you're good to go.
Open the app, connect your module, and enjoy!
18 Comments
5 years ago on Step 3
How to write broken pipe
Show in app when I tab on any block
Why can u solve my problem please
7 years ago
"This i'ble will help you control an LED with an app over bluetooth from your smartphone."
And why would I want to do this? Did I miss the real world application?
Reply 7 years ago
Just to learn blueooth interfacing... :P
7 years ago
Well... I wanted to upload the source code of the apk but unfortunately I don't know how to do so.
The apk basically sends a text over the bluetooth serial when any of those buttons are pressed.
For example pressing ON would send a "0" over bluetooth.
The arduino has a Serial.Read command which executes the given operation when it receives the specified text.
7 years ago
you forgot something!
Reply 7 years ago
Please tell me what.
Reply 7 years ago
There's usually a resistor in series with the LED to limit current flow.
Reply 7 years ago
Well...this led has a forward resistance enough to limit the current.
The case may be different for you..
Anyways.. it's always better to keep a Res.
Reply 7 years ago
Okay, looks like this LED works for your setup. Other LEDs will have a different forward voltage and current rating, so you may need a resistor in those cases.
Reply 7 years ago
Ya, you're right.
7 years ago
For Arduino Uno Pin 13, No resistor is required. For Other pins Yes, it is required.
Reply 7 years ago
Hi guys, PIN 13 DOES require a resistor..... Thanks John... :)
Reply 7 years ago
I suppose that's not correct..I bricked my previous Arduino only because I kept a 'green' led without a CLResistor...
Or maybe you're right?
7 years ago
source code apk ?
Reply 7 years ago
Do you want the source code of the apk?... I did not understand your comment.
Well I made it from the MIT app inventor.
Reply 7 years ago
on behalf of your fans .... 'Yes Please to Supplying Code'
Reply 7 years ago
How do I supply the code if I used the AppInventor?
7 years ago
Good & Instructive.