Electronic Basics #4: Arduino+Bluetooth+Android=Awesome

**Using Bluetooth with Arduino: A Beginner's Guide**

Bluetooth is a great way to transfer data or control gadgets with a smartphone, and even Sheldon Cooper says so. Everything is better with Bluetooth, this little device here with only four pins connects super simple to your Arduino projects and lets you control all sorts of things.

For example, I built a little controller which I use to control different LEDs in my living room to light up, change the brightness or go through different animations. And I have to say that it looks freaking awesome! So, I'm going to show you an easy way to use this little piece of hardware.

**Where to Buy Bluetooth Modules**

First things first, where to buy one of those? You can get them inexpensively from Amazon or Ebay. I put a link in the description, but I have to say that those things are fragile objects. The first one I got from China simply was broken from the beginning, but Chinese people are very friendly, so they sent me a new one.

The second one I blew up while connecting to the Arduino. But no worries, I'm using an ultra nano today, yeah, it's pretty fancy. It uses the same microcontroller as the Arduino Uno and tests basically the same features, but it's pretty small, so perfectly for small projects.

**Connecting Bluetooth Modules**

Those modules will operate on 5-volt supply voltage, that's not the problem. But in comparison to the Arduino, which uses fivefold logic levels, this Bluetooth module uses 3.3 voltage levels. That means when you connect the transmit pin from the module to the receive pin of the Arduino, the Arduino will receive 3.3 voltage levels, which is totally fine with the Arduino because it's compatible.

But when the Arduino wants to talk to the module through the wire which is connected to the transmit pin of the Arduino and the receive pin of the module, there is a problem. At first, it worked perfectly fine, but then I send a lot of 5-volt data to the module, and it just stopped working.

So, we got to use a voltage divider to convert our 5-volt signal to a 3.3 volt signal. All you need are two resistors which are already calculated for you: 1/2 kilo ohm resistor and a 4.7 kilo ohm resistor. We get around 3.4 volts in the middle, which would work fine with the module.

Just connect TX of your 3 node to the 2k resistor and ground to the 4.7 kilo ohm resistor. The RX pin of your module goes in the middle of the resistors.

**Wiring RGB LED**

Let's get to the wiring. I use this common anode RGB LED, which has obviously one anode and three cathodes. The three cathodes each get a resistor of around 460 ohms and connect to the Arduino nano digital pin 8, 9, and 10.

And I already told you how to connect the module to the Arduino through the RX and TX pins.

**Using Android App**

To use an Android app, I really like using S2 Terminal because it's simple, and the ASCII conversion works really nice. So, I put a link in the description, and it's free by the way or just search S2 Terminal in the Play Store.

The Arduino code looks complicated at first, and I have to say that I did this one on my own, and I'm surprised that it works so well. You can just use my code and change the code word right here in my case. The words are red, green, and blue, and one line under there is written what will happen.

Just rewrite those two things, and you can turn on and off all kinds of cool things. Now it's time to upload, but always remember to cut the TX and RX connections to the module when you upload the code; it interferes with one another and will not work afterwards.

Reconnect those, and pair your Bluetooth module. My one is named HC-05, the pairing code is usually 1 2 3 4 or 0 0 0 0 or in my case, not existing because I already did that.

The LED now turns red, green, or blue depending on which code word you sent, and it even responds with ASCII text saying that read on. For example, you find the answer text here in the code.

I hope you enjoyed this video! Don't forget to like, share, subscribe, stay creative, and I will see you next time!

WEBVTTKind: captionsLanguage: enBluetooth is a great way to transfer data or control gadgets with a smartphone even Sheldon Cooper says so everything is better with Bluetooth this little device here with only four pins connects super simple to your Arduino projects and let you control all sorts of things for example I built a little controller which I use to control different LEDs in my living room to light up change the brightness or go through different animations and I have to say that it looks freaking awesome so I'm going to show you an easy way to use this little piece of hardware first things first where to buy one of those you can get those inexpensively from Amazon or Ebay I put a link in the description but I have to say those things are fragile objects the first one I got from China simply was broken from the beginning but Chinese people are very friendly so they sent me a new one the second one I blew up while connecting to the Arduino I went by the way I'm using an ultra no nano today yeah are pretty fancy it uses the same microcontroller as the Arduino Uno and test basically the same features but it's pretty small so perfectly for small projects ok moving on those modules will per 5 volt supply voltage that's not the problem but in comparison to the Arduino which uses fivefold logic levels this Bluetooth module uses 3.3 voltage levels that means when you connect the transmit pin from the module to the receive pin of the Arduino the Arduino will receive 3.3 voltage levels which is totally fine with the Arduino because it's compatible so don't worry about that but when the adrenal wants to talk to the module through the wire which is connected to the transmit pin of the Arduino and the receive pin of the module there is a problem at first it worked perfectly fine but then I send a lot of 5 volt data to the module it just stopped working so we got to use a voltage divider to convert our 5 volt signal to a 3.3 volt signal all you need are two resistors which are already calculated for you 1/2 kilo ohm resistor and a 4.7 kilo ohm resistor we get around 3.4 volts in the middle which would work fine with the module just connect TX of your 3 node to the 2k resistor and ground to the 4.7 kilo ohm resistor the rx pin of your module goes in the middle of the resistors let's get to the wiring I use this common anode RGB LED which has obviously one anode and three cathodes the three cathodes each get a resistor of around 460 ohms and connect to the arduino nano digital pin 8 9 and 10 and I already told you how to connect the module to the Arduino through the Rx and TX pins now to the Android app I really like using s2 terminal because it's simple and the ascii conversion works really nice so i put a link in description and it's free by the way or just search s2 terminal in the Play Store the arduino code looks complicated at first and i have to say that I did this one on my own and I'm surprised that it works so well you can just use my code and change the code word right here in my case the words are red green and blue and one line under there is written what will happen just rewrite those two things and you can turn on and off all kinds of cool things now it's time to upload but always remember to cut the TX and rx connections to the module when you upload the code it interferes with one another and will not work afterwards you reconnect those and pair with your Bluetooth module my one is named hc-05 the pairing code is usually 1 2 3 4 or 0 0 0 0 or in my case not existing because I already did that the LED now turns red green or blue depending on which code word I sent and it even responds with ASCII text saying that read on for example you find the answer text here in the code I hope you enjoyed this video don't forget to Like share subscribe stay creative and I will see you next timeBluetooth is a great way to transfer data or control gadgets with a smartphone even Sheldon Cooper says so everything is better with Bluetooth this little device here with only four pins connects super simple to your Arduino projects and let you control all sorts of things for example I built a little controller which I use to control different LEDs in my living room to light up change the brightness or go through different animations and I have to say that it looks freaking awesome so I'm going to show you an easy way to use this little piece of hardware first things first where to buy one of those you can get those inexpensively from Amazon or Ebay I put a link in the description but I have to say those things are fragile objects the first one I got from China simply was broken from the beginning but Chinese people are very friendly so they sent me a new one the second one I blew up while connecting to the Arduino I went by the way I'm using an ultra no nano today yeah are pretty fancy it uses the same microcontroller as the Arduino Uno and test basically the same features but it's pretty small so perfectly for small projects ok moving on those modules will per 5 volt supply voltage that's not the problem but in comparison to the Arduino which uses fivefold logic levels this Bluetooth module uses 3.3 voltage levels that means when you connect the transmit pin from the module to the receive pin of the Arduino the Arduino will receive 3.3 voltage levels which is totally fine with the Arduino because it's compatible so don't worry about that but when the adrenal wants to talk to the module through the wire which is connected to the transmit pin of the Arduino and the receive pin of the module there is a problem at first it worked perfectly fine but then I send a lot of 5 volt data to the module it just stopped working so we got to use a voltage divider to convert our 5 volt signal to a 3.3 volt signal all you need are two resistors which are already calculated for you 1/2 kilo ohm resistor and a 4.7 kilo ohm resistor we get around 3.4 volts in the middle which would work fine with the module just connect TX of your 3 node to the 2k resistor and ground to the 4.7 kilo ohm resistor the rx pin of your module goes in the middle of the resistors let's get to the wiring I use this common anode RGB LED which has obviously one anode and three cathodes the three cathodes each get a resistor of around 460 ohms and connect to the arduino nano digital pin 8 9 and 10 and I already told you how to connect the module to the Arduino through the Rx and TX pins now to the Android app I really like using s2 terminal because it's simple and the ascii conversion works really nice so i put a link in description and it's free by the way or just search s2 terminal in the Play Store the arduino code looks complicated at first and i have to say that I did this one on my own and I'm surprised that it works so well you can just use my code and change the code word right here in my case the words are red green and blue and one line under there is written what will happen just rewrite those two things and you can turn on and off all kinds of cool things now it's time to upload but always remember to cut the TX and rx connections to the module when you upload the code it interferes with one another and will not work afterwards you reconnect those and pair with your Bluetooth module my one is named hc-05 the pairing code is usually 1 2 3 4 or 0 0 0 0 or in my case not existing because I already did that the LED now turns red green or blue depending on which code word I sent and it even responds with ASCII text saying that read on for example you find the answer text here in the code I hope you enjoyed this video don't forget to Like share subscribe stay creative and I will see you next time