top of page

Hardware

Public·109 members

Add bluetooth module for uploading sketches and communication

Back in February I wanted to teach Nybble some tricks on the high bar. It would involve intense experimenting and debugging in the air so I'd prefer program Nybble wirelessly. I knew it's doable to connect Bluetooth UART to the serial port on NyBoard, but didn't validate it myself.

ree

I mainly referred to this Instructable posts, the bluetooth module is HC-05, with a push button on it. Notice HC-05 allows uploading sketches seamlessly, while HC-06 can only be used for communication.


My soldering:

ree

Next follow the Intructable post to set up HC-05. Make sure you read the original post thoroughly.


First still use the FTDI uploader as serial port to program the baudrate, chip name and password of HC-05. Note some versions of the board may require CAPITALIZED tokens, like "AT" instead of "at".

ree

Then plug the bluetooth module into the 1x6 socket on NyBoard, and power on. You should be able to see its name on your computer's bluetooth list. Connect and type in your password.

ree

Now the device is connected to the bluetooth of your computer.

ree

In the serial port selection of Arduino IDE, you will see the device:

ree

Then you can communicate with Nybble through serial monitor. The list of supported commands is attached here.

ree

With the serial protocol, it's very convenient to have both high and low level control with Pi or other chips. Detailed instructions for communication are in section 4.2.5 of the documentation. It works with both Arduino IDE and my serial commander in Python.

Now Nybble can be programmed freely 360 degrees in the air!

ree

That's how Nybble plays on the high bar.

And do light painting.

Or follow voice commands if you have a voice server (either on or not mounted on Nybble)


----

Chico has made an app for Nybble:

https://github.com/codeandrobots/codeandrobots-app


ree
ree

After connecting Nybble with the app through bluetooth, you will be able to do remote controlling and motion scheduling.


I have validated it on Android phone because it supports bluetooth 2.0 with the previous HC-05 module. Any one knows how to wire some newer bluetooth module so that it can also support IOS phones?

3142 Views
Gero
Feb 26, 2021

Yes, you will have to install PySerial via pip install on your computer. Afterwards you have to implement the library with import serial in your code.


You can take a look at this post, which is a simple implementation of the library:

https://www.petoi.com/forum/software/make-nybble-do-random-stuff


So you can establish the connection via serial and assign it to the object e.g. ser to read and write to the serial port. Then you can use the write method to send a command: ser.write(str.encode('kwkF'))

This would make Nybble/Bittle walk forward.

Members

bottom of page