Adafruit's Circuit Playground As a Robot Controller With Bluetooth

by otterbot in Circuits > Microcontrollers

4081 Views, 11 Favorites, 0 Comments

Adafruit's Circuit Playground As a Robot Controller With Bluetooth

2017-07-31 10.01.17.jpg

A friend gave me one of Adafruit's circuit playgrounds (developer edition) to use, and I wanted to see would it make a good robot controller. The circuit playground is packed full of features like sensors, neo-pixels and even an accelerometer.

I wanted to add a L9110 motor controller and create a small bot I could use to show some of the expansion possibilities. The circuit playground uses the standard Arduino IDE so its has a huge amount of libraries and examples on the web to use.

I also wanted to make something robust that wouldn't have a lot of wires exposed, so beginners or children could use my bot and learn to program.

Adding bluetooth was also a goal which I talk about later in this article.

Equipment Needed

  • A case for your bot, I used an old smoke alarm
  • 2 x Micrometal gear motors (I used 1:298 ratio but if you want something faster I would suggest 1:50-1:100
  • 1 x L9110 Motor control board
  • 1 x Adafruit circuit playground
  • A small board to mount your motors on unless you want to add them to the case.
  • Various jumper wires
  • A set of bolts and nuts that will go through the holes in circuit playground
  • Ends for jumper wire eyelets which need to be fitted
  • Solder and Soldering iron
  • Hot glue gun
  • Small drill / Dremel to produce holes for bolts in case

Putting It Together

2017-07-30 14.08.49.jpg
2017-07-30 15.25.03.jpg

First I took the insides out of my old smoke alarm which I was going to use as a robot body / case. I know its obvious but please don't use your working smoke alarm for this, get an old one or use something different as a case.

I placed the circuit playground on the smoke alarm case and marked out where to drill holes for my bolts to go through, these will be used to connect the motor driver board and anything else we want to in the future, keeping all the wires inside the case.

A nice modification to this would be to use wingnuts on the top so the playground board could be removed leaving everything else intact.

Making the Jump Leads With Eyelets

2017-07-30 15.12.32.jpg
2017-07-30 14.56.28.jpg
2017-07-30 15.12.22.jpg

I wanted to connect the L9110 motor driver board to the circuit playground using female jumper leads at one end and an eyelet on the other end to be used on the bolts with nuts as connectors.

I used eyelets that came in packs of 10 and cut off one end of my female to female jumper leads. I then crimped the eyelets on to the wires as shown in the pictures. I added solder to the crimped end to avoid them being pulled out during assembly or moving them around.

Once done I plugged the female ends into the L9110 motor driver board.

Now I was ready to connect the wiring inside the case.

Preparing the Motors and Rollerball

2017-07-30 14.03.28.jpg
2017-07-30 15.44.39.jpg
2017-07-30 14.03.20.jpg
2017-07-30 16.05.22.jpg
2017-07-30 16.10.34.jpg

I decided to use an old piece of circuit board to mount the motors and holders along with the roller ball. This required drilling in a number of places as shown. I then tested the L9110 motor driver worked by connecting up the wiring to the motors and to the bolt connector inside the case. I am glad I did this as it turned out the motor driver board was not working, this I tested with a multimeter.

Once replaced and tested with a simple arduino sketch I marked out where I wanted the wheels to go through the bottom of the case. Then using a dremel I cut these openings to allow my motors, wheels and rollerball assembly to sit on the bottom of the smoke alarm case.

Internal Wiring to L9110

2017-07-30 15.52.06.jpg

Next using the bolts as connectors I fitted the wires ending in eyelets to the following pins.

L9110 Adafruit Circuit Playground

B1A -----------> Pin 12

B1B -----------> Pin 6

A2A -----------> Pin 10

A2B -----------> Pin 9

GND -----------> GND

VCC -----------> VBatt

Adding Battery Power

Because of the small size available in the smoke alarm case, I decided to add a Lipo battery and add a small charging board. I have ordered this and so will update this section once fitted.

For all my testing I did this with a USB cable attached

Aduino Code

Screen Shot 2017-08-01 at 11.51.25 am.png

I wrote a simple sketch and added functionality so that pressing the left button on the Adafruit circuit playground started a simple control of the motors, forwards, back, spin left, spin right. This could easily be adapted for other use.

I have attached this code here.

Taking It Further Adding Bluetooth / BLE

2017-07-31 19.59.56.jpg
2017-07-31 20.37.19.jpg
2017-07-31 20.37.28.jpg

I added then a HC-06 bluetooth module.

The connections to the circuit playground are fairly simple and would be the same connections as a standard Arduino. I had to make up four more jumper wires which had the standard female ends, these kind pushed onto the pins of my HC-06 Bluetooth device. The other end of the jumper wires I added my eyelets and soldered them for security.
I the. attached these to the circuit playground bolts I had in place using the connections listed below.

Connections

Playground BLE device

RX ------------------> TX

TX ------------------> RX

GND ----------------> GND

VCC ----------------> VCC

Once connected power up the circuit playground and the Bluetooth device should show a power light, indicating you have the power correct coming from the circuit playground. There should also be another light which will be flashing. This shows the Bluetooth device is not connected / paired with a remote device. I initially tested this with my laptop, discovering the device and connecting to the HC-06 Bluetooth device. The default pin if prompted should be 0000 or 1234.

It should then be possible to provide control via an app such as https://appsto.re/gb/DDIR4.i

Conclusion

2017-07-31 22.11.23.jpg
2017-07-31 22.11.41.jpg
2017-08-01 10.20.58.jpg

This was fun, and creates a nice robust bot, its small and if you program the neopixels it really looks good. I really like the smoke alarm as a case as it allows me to open it anytime I need to using the original hinge and it keeps exposed wires safe.

Adding rechargeable power and BLE will really make a good plaform for small robot development, especially with the inbuilt sensors already part of Adafruit's circuit playground.