Do you have a question about the RedBot and is the answer not in the manual?
Questions and answers
Summary of Contents for Sparkfun Electronics RedBot
Page 1
The RedBot is robotic development platform capable of teaching basic robotics and sensor integration! Based on the SparkFun RedBoard and programmable in the Arduino environment, the RedBot has all the I/O you need to make a small robot in no time at all. The RedBot family consists of the...
Page 2
Before you go any further, you should probably make certain that you're familiar with these other topics: What is an Arduino? - Since the RedBot is based off the Arduino platform, it's a good idea to understand what that means. Installing the Arduino IDE - If you don't have the Arduino software installed, this guide will help you out.
Page 3
LEDs, Sensors, or motors. It also has an integrated [H-Bridge Driver]( (https://cdn.sparkfun.com/assets/learn_tutorials/1/1/0/TB6612FNG.pdf) chip. While we have developed an integrated library for the RedBot, if you want to drive the motors manually - here are the pin outs for the Motor Driver: LEFT MOTOR: Control 1 - Pin 2...
Page 4
12. Power LED - A power LED will remain lit whenever the power switch is active. Here's a quick Example program to test your RedBot out with. It spins the left motor forward and reverse, and the spins both motors forward and reverse.
Page 5
/ This example requires no libraries to run, and has all of the pins used on the / RedBot Mainboard defined. / Before uploading this code to your RedBot, make sure that the RedBot is in a safe / place. It will start moving immediately after you upload the program. We suggest / placing the RedBot on it's end so that the wheels are up.
Page 6
// spin the left Motor CCW leftMotor(-255); delay(2000); leftBrake(); delay(1000); // wait for 1000 milliseconds // spin both motors (drive forward) -- left CW, right CCW leftMotor(255); rightMotor(-255); delay(2000); // wait for 2000 milliseconds leftBrake(); rightBrake(); // spin both motors (drive in reverse) -- left CCW, right CW leftMotor(-255);...
Page 8
65mm wheels and a caster. The chassis plates are cut from acrylic with a wide variety of mounting holes for sensors, controllers, power, etc. The chassis does require some basic assembly but detailed instructions are included. RedBot Line Follower Sensor Page 8 of 19...
Page 9
The Line Follower sensor is an add-on for your RedBot that gives your robot the ability to detect lines or nearby objects. The sensor works by detecting reflected light coming from its own infrared LED. By measuring the amount of reflected infrared light, it can detect transitions from light to dark (lines) or even objects directly in front of it.
Page 10
The Whisker Bumper is a very simple sensor comprised of a piece of music wire that closes a contact when bent and a circuit board to interface it to the RedBot. We ship the music wire straight, so you'll have to bend it to suit your application; the example shown above is only one way to do it.
Page 11
What's the fun of a robot that doesn't make beep-beep noises? We've made the RedBot Buzzer board to fit nicely on any header on the board, so you can integrate noise with your robot either just for fun or as a nice remote feedback function.
Page 12
Incoming data is not reliable above 38400bps. Data transmission still works at higher speeds. Since the incoming data reception shares an interrupt with the sensors on the board, incoming data may be missed if other inputs are in use. In particular, incoming serial data may interfere with bump sensor detection or encoder counts, and incoming encoder data and bump sensing may interfere with serial data reception.
Page 13
Brake actually effectively shorts the terminals of the motors together, causing them to stop turning much faster than the commands do. After a has been issued, the wheels will also be stop() brake() much harder to turn, allowing the robot to hold position against a slope. Line Sensor The RedBotSensor class supports the line following sensors...
Page 14
TI PCA9306 level shifter and is designed to attached directly to the A4/A5 header on the RedBot. In addition to normal accelerometer data collection, it can be used to detect bumps (as in collisions) or taps (for user input). RedBotAccel();...
Page 15
Example This example uses the RedBot kit hardware and the RedBot library to realize a simple line following robot. We'll break the code down, bit by bit, and analyze it. The sketch is included with the library located on the Github site, or you can download it here.
Page 16
// Instantiate a software serial port. Note that the regular Arduino // SoftwareSerial won't work! It steals resources that the sensor // inputs on the RedBot need. Also note that the RedBot version has // no input options- it automatically connects to the pins used for // the onboard XBee header.
Page 17
void loop() // These static variables will be initialized once, then remain valid // through each iteration of the loop. // Two loop timers; we have one loop that happens four times a second // and one that happens ten times a second. static unsigned long loopStart = millis();...
Page 18
if (loopStart + 250 < millis()) loopStart = millis(); servo.write(angle); if (angle + angleDelta > 120) angleDelta *= -1; if (angle + angleDelta < 0 ) angleDelta *= -1; angle += angleDelta; // All this line-follow-y stuff should only be invoked when we are clear to move; // if one of the bump sensors was set off, we should stay still until the user // intervenes for us.
Page 19
Resources and Going Further Get moving! Hopefully, this guide has given you enough information to get started with the RedBot. Look for more sensors, kits and content around the RedBot platform! Once you've mastered the art of line following robots, try you hand at other types of robots.
Need help?
Do you have a question about the RedBot and is the answer not in the manual?
Questions and answers