BlueCArd - How to connect a Bluetooth BLE module (AT-09 or HM 10) to Arduino Nano - ep. 6
Вставка
- Опубліковано 10 вер 2024
- This tutorial is part of the tutorials how to build BlueCArd - a simple (and cheap) to build Arduino Nano RC car controlled from Android mobile device through Bluetooth.
Find more info and cool stuff in my blog: www.thinker-ta...
In the previous tutorial I shoed You hot to power the Arduno Nano with a DC DC Boost converter. If you haven't watched the video yet, you can find it here:
• BlueCArd - What is a D...
In this tutorial I'll show you how to connect and wire a Bluetooth Low Energy module to the Arduino Nano microcontroller on a breadboard. I'll show You then how to write a sketch to test the connection and how to configure the Bluetooth module.
For the BlueCArd project I used an AT-09 BLE module which is fully compatible with the HM-10 BLE module. BLE is very convenient for this project, because it doesn't need pairing of the devices and is relatively easy to use.
I also wrote a blogpost, where I explain in detail how exactly to connect the Bluetooth module and how to lower the voltage for the RXD pin using a voltage divider with two resistors. You can find this post on my blog here:
www.thinker-ta...
You can find the source code from this tutorial on github here: github.com/nen...
---
This video is part of the BlueCArd tutorials with an ultimate goal to build the BlueCArd. You can watch the BlueCArd in action in this video:
• BlueCArd - fully 3D p...
BlueCArd is an easy to make fully 3D printed (I printed it on my Prusa i3 MK3s 3D printer) Arduino based Bluetooth controlled (from Android phone) RC car.
#3dprintedrccar #bluetoothrc #hm-10
FUCK YEAH IT WORKS. USE THE FUCKING VOLTAGE DIVIDER FOR IT TO WORK
Hello 👋🏽 Can two AT09 be paired master/slave? If I missed it I do apologize.
I have a Problem: The AT command in the Serial Monitor doesn't reply anything. I already used all Baud rates and used also Both NL & CR. Can please someone help me?
İf you solve the problem. Write me please.
@@mehmetemin5479 You have to upload an empty Script to the Arduino and then open the Serial Monitor and type in the commands. I hope it helps you!
@@semmel911 I fixed the problem last night. Thank you so much. So, do you have any information how can i pair the mlt-bt05 module with my android phone?
@@mehmetemin5479 hmmmm, I commented last night and now it's gone? mmmm. Let's try this again.
Hi, I was wondering how did you solve it, because I have the same issue, no reply on the serial monitor. And I've tried everything, checked the code and wiring multiple times, swap components, change the suggested settings, every iteration of the AT command I could think of, etc.
Any advice?
@@Ro2006Ro I completely solved the problem. I am able to get all data from serial monitor. It is very difficult for me to understand where there is a deficiency in this way. If you find a way to contact me, I would be happy to assist you.
Hi, I have bought a ble device, but I can't connect it with my phone or anything else. I have tried password 0000, 1234, 000000 and 123456 but it's none of these. Do you know any passwords? Thank you in advance!
Normally You don't need to use password for BLE. You also don't need to pair it with your device...
Hello, I want to use HM-10 to control motor- so I want to be able to send float number like "154.34" which represent cm and mm, and to receive the location to the app.. I am stuck with the UTF-8 on every BLE app and I cant find a way to send float..do you know What to do??thank you in advance
There are literally countless possibilities to solve this! Some ideas:
* Don't use floats at all. Use integers (e.g. 154.34 are 15434mm)
* Convert float to byte array and vice versa
* Convert float to string and then to base 64
I don't know what is Your project, so this are some "brute force" solutions. With more information I'm sure You can come up with much more sophisticated solution...
@@undeadswarm Firstof all- thank you for your quick answer! This is my simple code:
#include
SoftwareSerial HM10(8, 9); // RX = 3, TX = 2
char appData;
String inData = "";
String FLOATxx;
float xx=0.00;
void setup()
{
Serial.begin(9600);
Serial.println("HM10 serial started at 9600");
HM10.begin(9600); // set HM10 serial at 9600 baud rate
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
HM10.listen(); // listen the HM10 port
while (HM10.available() > 0) { // if HM10 sends something then read
appData = HM10.read();
Serial.println(appData);
inData = String(appData); // save the data in string format
Serial.write(appData);
for (int i=0;i HM10 serial started at 9600
13:21:24.201 -> 4
13:21:24.201 -> 44.00
13:21:24.201 -> 5
13:21:24.201 -> 545.00
13:21:24.248 -> 0
13:21:24.248 -> 0450.00
13:21:24.248 -> .
13:21:24.248 -> .450.00
13:21:24.248 -> 6
13:21:24.248 -> 6450.60
13:21:24.279 -> 7
13:21:24.279 -> 7450.67
This is just a debbuging but as you can see....bad result
Hello, i set up the programm and everything, and i get an OK when i typen in AT. But if i type in AT+HELP, AT HELP, AT+COMMAND, etc. I dont get a response.
Hmm, check my blog post here: www.thinker-talk.com/post/bluecard-part-5-arduino-nano-bluetooth-module-how-to-at-09-or-hm-10
What you can try is to make sure that the first drop-down box at the bottom is set to "Both NL & CR" and the second to "9600 baud"!
Does the Bluetooth Initialization steps (setting up Role, Name, Password, etc) have to be done every time the unit is powered on? Or do they save do the module after the first time? So if we moved the HM10 to plug into another device, it would still use the same settings we set.
They are set with AT commands and don't need to be done through code, but where is the problem if they are?
Hello! Im using the Arduino nano, does RX of the Bluetooth is connected to the D3(RX) of the arduino nano? Its confusing since I'm reading alot of this RX/TX stuff and it says RX to TX and TX to RX is the right connection... Please correct me if I am wrong... I'm still new to this and still learning about the arduino and Bluetooth communications....
But somehow, its working!
If it's working it's good :). As far as I know, the RX and TX pins are also used for the USB communication and there will be a conflict if the Arduino is connected through a USB cable and You try to use the Bluetooth module...
Hello i am using hm-10 bluetooth module.
I am trying to connect from my phone (android) but I get the answer 'access denied'.
How can I connect? Can you help?
Check if the HM-10 is configured correctly. The AT syntax may differ for different modules (e.g. AT+COMMAND vs AT COMMAND).
Check this: www.thinker-talk.com/post/bluecard-part-5-arduino-nano-bluetooth-module-how-to-at-09-or-hm-10
@@undeadswarm thank you
I think the voltage divider is smart, but some people have told me this is a bad idea, as the voltage the bluetooth module can draw is variable depending on the amount of data it is transfering. How true is that? I was told to rather use a 3.3V linear regulator
First of all, I'm not an electrical engineer so take everything I say with a grain of salt!
With that said:
Voltage is constant and the circuit draws as much current as it needs. CMOS circuits draw current only when switched => more data => more switching => more current. But the current height is limited from the voltage (I = U/R).
Also, this is a digital circuit so the drawn current will be very low. A voltage divider should work just fine. Using a linear regulator or a logic level converter will also work of course, but for me, this is just overkill.
Hope this helps :)
Hello. I have done everything like you in the video, but when I type AT in the serial monitor it gives me an error. Is there a fix to this or did I mess something up?
Hi Matija,
too little information for me to be able to help. Did you check the linked blog post?
www.thinker-talk.com/post/bluecard-part-5-arduino-nano-bluetooth-module-how-to-at-09-or-hm-10
Also, different modules can have a slightly different format for the AT commands...
@@undeadswarm Im sorry for giving so little information. I checked the blog post but I still can't find the problem.
If it helps, here is the site I have purchased it from:
www.aliexpress.com/item/32861960887.html?spm=a2g0s.9042311.0.0.5f3f4c4dMSCKiI
Thanks in advance!
Edit: here is also the link of arduino nano i have bought:
www.aliexpress.com/item/32518770128.html?spm=a2g0s.9042311.0.0.5f3f4c4dMSCKiI
These are the same elements I used. What error did you get?
When I type AT in the serial monitor tab, the feedback is ERROR. If I unplug the bluetooth modle itself and than type AT, there is no feedback, so I think that there si no communication problems. I also tryed changing the arduino nano and the bluetooth module but the problem still remains, so I think there is not a problem with the modules, but I could be wrong.
What happens when you type "AT+HELP", "AT HELP" or "ATHELP"?
Also, check at the bottom of the serial monitor that the first drop-down box is set to "Both NL & CR" and the baud rate to 9600.
Hey, can you tell me what is the maximum range of HM10 and what is the transfer rate?
For exact range and possible transfer rates you can check the specs.
I use it in house (max 10m) and it works perfectly.
I use with with 9600 transfer rate. For RC this is more than enough (short commands send multiple times per second)
@@undeadswarm Thank you for your information, can you please tell me from where can I get the data sheet of HM10?
I hate arduino. This is my 3rd attempt and still doesn't work
AT command does nothing. followed EXACTLY
@@clashpolitics1665 The RX and TX pins he labelled are backwards. It should be RX then TX