Introduction: Dancing RedBot
- No Redbot with sound processing using an android cellphone.
- No Redbot that uses a BPN (Artificial Intelligence) to learn when to move depending on the sound's threshold.
Step 1: Purchase a Redbot
You need to get the SparkFun RedBot Basic Kit. You won't be using all its components but you can save them for other projects you may have in mind.
You may want to visit their page to buy one (amazon sells the Redbot too). https://www.sparkfun.com/products/13166. There you'll be able to see its features and why it's easy to build and use.
Step 2: Purchase Bluetooth Adapter
I recommend you to use the Bluetooth Bee. It is fully compatible with the Redbot.
Bluetooth Bee is an easy to use Bluetooth Serial Port Profile(SPP) module compatible with existing Xbee sockets, designed for transparent wireless serial connection setup. Serial port Bluetooth module is fully qualified Bluetooth V2.0+EDR(Enhanced Data Rate) 3Mbps Modulation with complete 2.4GHz radio transceiver and baseband. It uses CSR Bluecore 04-External single chip Bluetooth system with CMOS technology and with AFH(Adaptive Frequency Hopping Feature). It has the smallest footprint of 12.7mm x 27mm.
Step 3: Android Cellphone
The Dancing Redbot is using the cellphone's microphone in order to do sound processing through software implemented in Processing IDE using libraries such as ControlP5 and Ketai.
- Processing : https://processing.org/download/
- Processing Android Mode: http://madrid.verkstad.cc/en/course-literature/pro..
- Ketai library: http://ketai.org/
- ControlP5 library: http://www.sojamo.de/libraries/controlP5/
- Arduino IDE: https://www.arduino.cc/en/Main/Software
The software enumerated up above was used to build the RedBotDance application, specifically its apk (android application). The app you can find it in https://drive.google.com/open?id=0B_Baa_5ted-dZ0tz...
If you want to build it yourself and do modifications to the app you will have to configure the environment and use the code located here https://github.com/jocan3/RedBotDance
For environment configuration you may want to visit this site http://madrid.verkstad.cc/en/course-literature/pro.... It will be helpful to set up the Android mode in Processing.
Step 4: Arduino IDE
You'll have to upload the redbot's logic trough the Arduino IDE. The program is used to make the redbot understand the signals sent by the cellphone. They could be 4. One for each movement: up, down, right or left.
The code can be found here: https://github.com/jocan3/RedBotDance
Step 5: BPN (Artificial Intelligence)
The ability of the human brain to think, remember and solve
problems has inspired many computer scientist to model this structure using hardware and software. As a result, nowadays we can encounter different models of artificial neural network that try to emulate the biologic behavior of organic neurons.
One of these models is the Back Propagation Network (BPN) which is compound of the following parts:
- Processing units (artificial neurons)
- Input layer
- Hidden layers
- Output layer
- Learning rules
If we want to retrieve a value a value based on a specific input, there is a feed forward function that calculates the value for each neuron as the sum of all the inputs to that unit multiplied by the link weight.
When the BPN is trained, the algorithm needs to specify the inputs and the expected output so the BPN obtains an error. By using partial derivations of the total error and the value of each link the BPN adjusts the value of the weights in a feed-backward manner (where the name comes from).
For the purpose of this project we used three layers: 1 input layer containing 1024 units mapped from the data vector received through the phone microphone, 1 hidden layer of 512 units and 1 output representing a boolean value of move or not to move.
More details about the code can be found on this repository: https://github.com/jocan3/RedBotDance
Step 6: Redbot Board and Bluetooth Board
The redbot's RXI can be connected to the bluetooth board’s TXO , and the bluetooth RXI to the redbot TXO.
Here's an image so you can see where this is located in the board http://i.imgur.com/tac7eD8.png. The labels are for the redbot board.
Step 7: Finally.. the Dancing RedBot
Here's a little demonstration. Enjoy
- Extract bpm from music so the Redbot learns to dance different rhythms
- Set logic into the Redbot board
- Add microphone to the Redbot board