Maxwell B

Hello, I’m Maxwell and I’m a senior at Broomfield High School. My starter project is the Minty-Boost. The Minty-Boost charges phones and other devices with a USB cord and two AA batteries. My main project is an Arduino controlled Hexbug spiders, which can follow black electrical tape and be able to detect objects ahead of it with the use of ultrasonic sensor and be able to receive commands from a computer . While I have worked on other robots and electrical projects before (Boe-Bot by Parallax), they always have a book to guide you step by step, but this program challenges me by giving me limited information and making me figure out the how to build and program the robot by myself.

Final Project: Wireless Controlled Hexbug with Infrared Sensor and Ultrasonic Sensor

2014 Denver

Arduino Controlled Hexbug Spider Third Milestone:

For my third milestone, I built a second spider and connect XBees to the two of them to allow me to control them from my computer. This step in my project had me reorder all of my previous parts to build the second one and then I had to order three XBees plus one USB explorer board to have one interface with my computer. After receiving these parts I did some research on how to connect the XBees to my arduinos when I found out that I could not connect the XBees to my arduino’s because while the arduinos’ have a 3.3v pin, they operate on a 5v logic level. This means that even if the XBees are connect to the arduino 3.3v pin they can not “talk” to it. This prove to be a problem for me because I needed to talk to them. To get around this problem, we order XBee explorer regulated boards. These boards take the signal that the XBee sends to the arduino and boost it from 3.3v signal to a 5v signal and then takes the the arduino 5v signal and makes it a 3.3v signal so that the XBee can read it. The way the boards do this is somewhat complicated. The simpler one is the 5v signal to 3.3v signal, which is a voltage divider. A voltage divider takes the input signal and runs it through a resistor which then sends the signal to the output. From here it then send the signal to ground which passes through a resistor usually double the size of the first resistor. The second part which takes the 3.3v to a 5v signal. It starts at the input takes it and sends it through a MOSFET shifter to the output. At the same time it does this, it has resistor connecting to a 3.3v supply which also connects to the MOSFET shifter. It is also connected to the 5v supply with the same type of resistor connecting it to the input line. With these parts I was final able to connect physcal the arduinos and the xbees.

From the software side things were not going as well. The plan was to connect the XBees with X-CTU, the main software for XBees, from there we would use the built in serial monitor to send over small bytes of information to control the robots. The code use the syntax, which allows the arduino to read the letters I’m inputting and respond to them. I also included a “while” syntax which stated it will do nothing until the Serial monitor is ready. The problem that soon came to light was the fact that the robots wouldn’t turn on and do what I type in on the monitor. I knew that the bytes were being received by the remote XBees and that the XBees could send data to the computer. Judging from this information, I figure out that the XBee weren’t connecting to the serial monitor. When face with this problem I tried to research solutions online but found that many were base off an older version of X-CTU that was no longer available. From the resources that were available I found out two things; first that the Xbees weren’t configured right, and second that the new version of X-CTU was meant for API mode not AT mode. This was a huge setback because I needed the AT mode so that I could access the serial monitor. The configuration I thought to be easy but I realize that there was no information on what to configure just that they needed to configured. With these setbacks I was disheartened and worried that I wouldn’t be able to finish, but I found a new source to help me and told me how to work with the XBees and how to configured them correctly. This new source also pointed me to a new program that focuses on AT mode for the XBees, it was called Cool-term. With this new program I was able to connect the XBees together and talk to the computer and recognized the serial monitor and follow my code.

Link to the good source:


The inspiration for the main project:

Schematic: HexbugSchematic

Bill of Materials: Denver Maxwell Bill of Materials

Arduino Code: Ultrasonic Sensor: HexSpiderPing,  Infrared Sensor: IRsensor, Wireless control: XbeeMain

Arduino Controlled Hexbug Spider Second Milestone:

For my second milestone, I attached an infrared sensor to the Arduino Nano, and programmed it so that it can follow a black line. This project has the same parts as the previous milestone, but now has an analog IR sensor attach to it. My IR sensor works by having IR LED shine down at an object and when the infrared light is shine back to the sensor, the sensor uses a phototransistor to read the values of the returning light. Because darker colors bounced back less light, the phototransistor can tell the color of the object. The biggest problem I face hardware wise is that the IR sensor has an effective range of 1/8th of an inch or 3mm. This was a problem for me because I had to find an effective way to keep the sensor close to the ground while keeping it out of the way of the legs of the spider and making sure it is close to the head of the robot, so that when the robot turns the IR sensor wouldn’t be far off. In order to overcome this problem I made the wires extra long and position them to the left side of the robot’s head where it was close enough to the head that when the robot turns the IR sensor wouldn’t be far off and by being to the side allows it remind out range of the legs of the robot.

The code for this project was hard because I had to make it from scratch and had no reference. While there are other line following robots, most uses at least two IR sensors, or if they don’t, they use one IR sensor that has a bigger range and looks at a larger area than mine. In order to overcome the limits of my robot and sensor, I programmed the code to make the head of the robot turn in a scanning motion, whenever the IR sensor no longer detects black. Once I program this I found out that for some reason the robot wouldn’t use the data from one half of the scan. After digging into my code I found out that the way I was doing it wasn’t possible and I had to redo it. My new and final code uses the Switch…Case syntax of the Arduino. The way it uses it the Switch…..Case syntax is that the first case make the robot move forward until it doesn’t see the black line. when the line is no longer seen, it moves to case 2 which moves the robot back a little, turns the head and scans the left side. If it still doesn’t find the line, it turns to the right and scans there while staying in place. If it still can’t detect the line it goes back to case 2 until it finds the line.

Arduino Controlled Hexbug Spider First Milestone:

For my first milestone, I connected an Arduino Nano to the Hexbug Spider with an ultrasonic sensor connected to both, and programmed a code that allows the Spider to know that objects are in front of it and to avoid the objects with the use of the ultrasonic sensor. This project has five parts: the Hexbug Spider, a switch, Parallax Ultrasonic Ping, the power source, and the Arduino Nano. The Hexbug Spider is the body and main part for this project. The Spider when it came out of the box had a small processor, a motor board, and three 1.5 volt coin cell batteries. In order to start the project, I had to remove the processor that came with the Hexbug Spider. This was in order to allow us to connect the Arduino Nano to the motor board, so we can hack and reprogram the spider. The next part was to connect the Parallax ultrasonic sensor (also know as the Ping) to the Arduino. The ultrasonic sensor sends out a sound wave that when it hits an object it is reflected back to the sensor. By using this feature we can tell how far away an object is from the sensor. The last key parts are the switch, a 9 volt battery, and the battery pack. These parts allow for electricity to flow to the Arduino and power it. The key thing to note about this is that the project now has two switches: one to turn off power to the Hexbug Spider, and the other to the Arduino Nano. The reason I did this was so that when the spider was off, the Arduino Nano wouldn’t still receive the energy that the battery was producing.

The next part to this milestone is the code for the Hexbug Spider. The code for this robot is simple. I first define the variables. From there I built the code around the ultrasonic sensor where it converted microseconds to centimeters. We can do this because we know the speed of sound (340.29 m/s) and from that we can convert it to any measuring distances (inches, cm, feet, meters). With this information, I coded an If, Else statement that says if the distance from the newest ping was greater then or equal to twenty centimeters the Spider will move forward, else the spider will move backwards then turn left. The last part of the code tells the robot the different movements it can do, like move forward, turn left, turn right, move backwards, and stop moving altogether.

Starter Project: Minty Boost

I’m Maxwell Baird, and for my starter Project I did the Minty-Boost. The Minty-Boost allows for the transfer of electricity from two double AA batteries to your phone via a USB cord. The Minty Boost is made up of five resistors, two regular capacitors, two bypass capacitors, a diode, a power inductor, and a boost converter chip. The five resistors do different task for the Minty-Boost, four of the resistors allow the device that is plug in to understand the charger, while the other one is to improve the current capability of the boost converter. The capacitors help maintain the flow by storing electricity in them. The diode only allows the current to flow one way, and the power inductor stores and converts low voltage to high. The boost converter chip combines all these parts to make a boost converter to which converts the input voltage to a greater voltage.

A schematic of this can be found here:

Comments are closed.