Step One: Gather materials.
- K’nex parts.
- 1 Modified K'nex motor.
- 1 Half-size solderless breadboard (400 Point).
- 1 Modified 9-gram micro servo.
- 1 Adafruit Feather nRF52 Bluefruit LE - nRF52832.
- 1 L293DNE 4 channel motor driver.
- 1 Silicon NPN Phototransistor.
- 1 10K ohm resistor.
- 1 (optional) 3-pin male to male header [just snap apart a larger header].
- 1 3x AA Battery Holder (with switch) and 3 AA batteries.
NOTE: For the modified K'nex motor, the user will only need the two leads connected to the motor. The power and ground leads will be unnecessary for the purposes since the user will be using an external battery case.
If the user prefers to bypass this part, it is possible. They can purchase an assembled K'nex Bobble Car for $68, contact seller.
Step Two: Constructing the Bobble.
- Headers will need to be soldered into the nRF52832 so that it can be mounted on the half breadboard. Also mount the L293DNE motor driver chip as shown on the breadboard.
1. The left hand (+) bus rail will be 3V. The right hand (+) bus rail is attached to the Battery and USB outputs and will be between 4.5V and 5V depending on whether you have a 3AA battery pack or USB cable attached for power. The left and right (-) ground bus rails are wired together.
2. The servo will be attached as shown. However, the user may want to install a 3-pin male to male header on the lower part of the board and wire the pins to nRF528232 pin 11, Battery/USB power, and ground respectively. In this way, they can plug the servo directly into the header. The photo of the bobble shows this configuration.
3. The motor connection is where the modified K'nex motor will be attached.
4. The nRF52832 A0 analog input is wired to the NPN phototransistor and pull up resistor. The phototransistor's emitter (usually the long lead) is the one connected to ground.
To save time and energy on this and the next step, the user can purchase a pre-programmed Adafruit nRF52832 Feather with headers already soldered in for $35, contact seller.
Step Three: Load Bobble Firmware on the Adafruit NRF52832 Bluefruit LE.
1. Follow the directions for setting up Arduino IDE to work with the nRF52832 Bluefruit LE, contact seller.
NOTE: The installation process for the board is slow, be patient.
2. Download the Bobble code, contact seller.
3. Unzip the file after downloading it and remember where the user puts the unzipped directory ble_bobble52.
4. Connect the nRF52832 via USB cable to your PC's USB port.
5. Launch Arduino IDE and open ble_bobble52 from wherever the user stored it.
6. In the Tools menu, select the board Adafruit Bluefruit nRF8232 Feather.
7. No changes to the code should be required, so just Compile and Upload.
8. If everything works correctly, the user will see a blinking blue light on the nRF52832 meaning that it is waiting for something to connect to it. Opening the serial monitor window under the Tools menu will display something like:
Reach and Teach BLE Bobble
Step Four: Load the RTBLEBobble Application by going to the Google Play Store.
Loading the RTBLEBobble application is easy... Simply point your phone's browser to:
Alternatively, to view and download the application using App Inventor 2:
1. Go to the App Inventor website at MIT:
2. Under the Projects menu, select "Import project (.aia) from a repository..." which will bring up a popup window called "Create a Project from a Template"
3. Select "Add a New Template Library URL" in the pulldown menu at the top of this window. When asked for a URL, respond with http://www.reachandteach.com/dls/rtrepository/.
NOTE: Remember to put in the trailing slash after rtrepository. Also, the directory name is lower case DLS.
4. The user will see the RTBLEBobble application. Click OK at the bottom of the window and it will be loaded into the user’s projects list. Select this project to open it.
5. To use App Inventor 2 with your Android device and actually download this or any application, the user must load the MIT AI2 Companion application from Google Play.
6. Once they do that, the user can select AI companion under the Connect menu which will bring up a QR code.
7. Launch MIT AI2 Companion on the user’s Android device, click Scan QR Code, and point the user camera at the QR code on the screen.
8. The application will be downloaded and run.
Step Five: Test Out RT BLE Bobble Controlling the Bobble.
At this point, the Bobble's blue LED (light emitting diode) is blinking which indicates that it is waiting for a connection. The user has launched the RT BLE Bobble application on their Android and the user is ready to connect to the Bobble.
1. Click the Scan button to scan for Bluetooth devices.
2. Select RTBobble52 in the list that comes up.
3. Click Connect to establish the connection.
4. If everything is working, the Bobble's blue LED will be a solid blue and you will now see a control panel on the user’s Android.
5. Click Motor ON and OFF. The Bobble's red LED should turn on and off. In addition, if the user has connected the modified K'nex motor, it should also be turning on and off. Likewise, with the motor on, the FWD and REV buttons should control the motor direction.
6. If the user has the servo connected, clicking and dragging the Servo control will cause the servo to move.
7. Click on the button "Click and Say Something"
- When the user hears a beep, say "Motor ON". The Bobble's red LED should turn on and so should the motor.
- Try clicking the button again and saying "Motor REVERSE".
- Try clicking the button again and saying "Motor ADVANCE" (instead of Motor Forward).
- Try clicking the button again and saying "Motor OFF".
Step Six: Parts Needed for the Bobble Car.
Here are the parts the user needs to build the K'nex Bobble car. They have already discussed how to customize a K'nex motor for this project. They have also made a functioning Bobble based on the nRF52832 from Adafruit. The only other special part they need for this build is a micro servo motor which has been modified to work with other K'nex parts. That is the next step.
Step Seven: Build a K'nex Mounted Servo.
To make it easy to mount a micro servo into any K'nex project, contact seller or visit user’s local Ace hardware store. All they have to do is apply the activator to the sides of the servo and adhesive to the K'nex parts according to the instructions on the Loctite product and press the parts together. This results in a durably strong and water-resistant mount. In a similar way, attach an x-arm servo horn to the K'nex 8-way white connector, applying the activator to the servo horn and adhesive to the K'nex 8-way connector and carefully press these two parts together. After the K'nex horn assembly set, screw the part into the servo using the mounting screw included with the servo parts. The servo can now be easily mounted into any K'nex project.
Step Eight: K'nex Motor and Wheel Assembly.
Step Nine: Build the Bobble Carriage and Attach to the Motor-Wheel Assembly.
Step Ten: Add Mounting Hardware for the Bobble and Servo.
Step Eleven: Mount the Battery Holder Into the Bobble Carriage.
NOTE: The user will want to install their batteries into the battery holder before doing this step.
Mount the battery pack upside down so that the power switch is on the bottom and the power wires are extended out the rear of the Bobble carriage.
Step Twelve: Install the Bobble Into the Bobble Carriage.
The gray 2-way connectors at the front and back of the Bobble Carriage can be swiveled to easily allow the Bobble to be inserted and/or removed.
Attach the battery pack's power leads to the Battery and GND (ground reference voltage) pin.
Attach the modified K'nex motor leads to pins 11 and 14 of the L293DNE motor driver chip.
Step Thirteen: Attach and Install the Servo Motor.
After snapping the servo assembly into place, connect the red lead of the servo to the Battery/USB power rail, brown lead to the Ground rail and yellow lead to pin 11 of the nRF52832. Since the user has already wired these to a 3-pin male to male header on the breadboard, all they user need to do is just plug the servo into the header.
This completes the assembly of the Bobble Car.
Step Fourteen: Testing the Bobble Car.
Turn the power switch on the battery holder ON. The blue LED should start flashing to indicate that the Bobble is waiting for a connection. If this doesn't work, try checking the power connections... the Red power lead should be connected to the bus on the breadboard that is connected to the Battery/USB pins.
Repeat the testing in Step 5 of this tutorial except now user has the entire Bobble car ready to go.
If everything goes well, the user will be able to control the Bobble car with your Android device.
- If the user can't see the RTBobble52 device when they hit scan, make sure the blue LED is blinking on the Bobble. Try clicking Stop Scan and then the Scan button again and see if it works. The blue LED will stop blinking and become a solid blue if the connection is successfully made.
- If the ON/OFF buttons on the control panel turn the red LED on the Bobble on and off but the K'nex motor isn't working, try the following:
- Connect the K'nex motor directly to the battery pack and see if it works.
- Double-check the wiring between the nRF52832 board and the L293DNE motor chip:
- Pin 16 on the nRF52832 is connected to pin 15 on the L293DNE.
- Pin 15 on the nRF52832 is connected to pin 10 on the L293DNE.
- Pin 7 on the nRF52832 is connected to pin 9 on the L293DNE.
- Double-check that pin 16 and pin 8 of the L293DNE are connected to each other and the Battery/USB bus rail.
- Step Fifteen: Additional Control Functions.
- The RT BLE Bobble Android application has a number of functions:
- Motor ON/OFF will turn the attached motor on and off.
- Motor FWD and REV control the direction of the motor.
- The Servo slidebar will control an attached servo between 0 and 180 degrees in 20-degree increments.
- Read Sensor will read the voltage from any sensor attached to pin A0. In this case, it is coming from the attached phototransistor. The reading will be scaled between 0 and 1023. Low light should yield a high number in this configuration. Shining a flashlight on the phototransistor should yield a low number. If this is not happening, double-check the wiring for the phototransistor (it may be inserted backwards).
- Low / High / Digital / f(L) / f(H) / Trig ON-OFF let you configure a trigger that will control your Bobble based on sensor input:
- Low - The lower sensor threshold for the trigger will be set to the last sensor reading taken.
- High - The upper sensor threshold for the trigger will be set to the last sensor reading taken.
- Digital - The lower and upper sensor thresholds will be set to digital low and high so the Bobble can be triggered with a digital sensor input.
- f(L) - Sets the function for the lower threshold to the most recent command. For example, if you press Motor ON and then press f(L), the motor will be turned on when the sensor input falls below the lower sensor threshold.
- f(H) - Sets the function for the upper threshold to the most recent command. For example, if you press Motor OFF and then press f(H), the motor will be turned off when the sensor input goes above the upper sensor threshold.
- Trig ON-OFF - This will toggle the trigger function on and off.
- A typical application would be to shine a flashlight on the phototransistor and click Read Sensor and click Low to set the lower sensor threshold to that sensor reading. Now turn the flashlight off and click Read Sensor and click High to set the upper sensor threshold to that sensor reading. Click Motor ON and click f(L). Click Motor OFF and click f(H). You will now be able to control the Bobble car by shining a flashlight at it.
- Click and Say Something - This button is connected to Google Voice. The application is configured to respond to "Motor ON", "Motor OFF", "Motor Advance" and "Motor Reverse".