I’m trying to attach HC-06 Bluetooth module to my Zumo 32u4. Seems straightforward considering information I found:
The only difference I’ve made is that I connected to 5V (my version seems to allow it as mentions 3.6-6V power is allowed).
I’ve used LCD port and GND/PWR/RX/TX are connected there.
I’m able to find module and pair with it, but echo program doesn’t work (code exactly the same as in links provided above).
Do Zumo 32u4 serial interface need something more to work?
Appreciate any support!
The Zumo 32U4 uses an ATmega32U4 MCU like the Arduino Leonardo. Code that calls the Serial object will communicate over the USB virtual serial port and the Serial1 object is used to communicate using the TTL serial on pins 0 and 1. You might try to modify the code so it uses Serial1, to see if that works. There is more information about this on the Leonardo Getting started Guide web page.
Please can you comment on the behaviour I am seeing with my Zumo robots, Leonardo arduinos and HC-06 BT modules.
When the BT and Leonardo boards are connected via a bread board, separate from the robot/shield, I get reliable comms over BT up to 115k.
The module is connected to 5v, GND, 0 and 1 as per Serial 1 on the Leonardo.
I have soldered leads onto the Zumo Shield V1.2 at pin 0 and 1, and 5V and GND points by the left blade bolt hole.
When I transfer the Leonardo and BT module to the shield my comms over BT fails.
I can achieve comms at a lower rate of 19200 reliably when Leonardo and BT module are mounted on the shield. But 57.6 and 115.2 fail. 38.4 varies in robustness.
Having checked voltage supplied by the shield under Leonardo connected to USB and robot batteries is at equivalent levels of 5v, I’m led to believe the shield electronics is interfering with the comms. Please can I have your expert opinion? Are pins 0 and 1 utilised? The schema doesn’t show they are as far as I can see.
I have tested this across factory built and home built Zumo robots and shields. All V1.2. All show the same behaviour.
I have 9 Zumo V1.2 and 9 HC-06. All show the same behaviour - perfect high speed comms off the shield and 19200 only on the shield.
That does sound a bit strange. The expansion headers next to the pins are all that are connected to Pins 0 and 1 and there is a ground plane on the side of the Zumo shield board opposite those traces.
I would suggest breaking the change from the breadboard to the Zumo shield into smaller steps. You could try powering your breadboard setup from one of the Zumo shields. You might also try to do a test that only sends data to the Zumo and then one that receives data from the Zumo over the bluetooth interface to see if the fault is bidirectional or just one way.
If you post some pictures of your setup here, I can look to see if there is anything obvious there.
Update: I’ve discovered a couple of things:
- TX from the Arduino via the BT module to the PC works at all baud rates. Only data sent from the PC via the BT module failed at the Arduino.
- I put a 10k resistor across 5V and the RX pin 0 on the shield and now have reliable comms, bi-directionally at all baud rates.
Conclusion: have a poor connection somewhere across all the 9 shields/robots. Only consistent thing there is my soldered leads for the BT module as per attached picture.
Interested in any thoughts you have?
Were you using the same length of cable for the HC-06 in your breadboard setup? I have a sneaking suspicion that the logic voltage on the HC-06 module you have is only 3.3V. Although the logic voltage on the Arduino is 5V, 3.3V should be above the threshold for registering as high. It is possible that there is a slight bit of capacitance on the logic line in the cable or on the traces and that with the lower logic voltage, the threshold for transitioning from logic low to logic high on that pin was not occurring fast enough. I would expect the 10k pullup resistor to make the transition from logic low to logic high occur faster. If that is the case, you might benefit from a logic level shifter.