Hi, I’m Margaret and here at Blue Stamp I made an autonomous, obstacle avoiding robot spider. I started out with a store bought robotic toy, the Hexbug spider, which could be remote controlled. I used an arduino and an ultrasonic sensor to get it to avoid obstacles on its own. My starter project was a theremin, I chose that project because I had heard of theremins before and thought it would be cool to make music with my project. The starter project was quite easy to make, but I learned how to solder through it, and then moved on to my main project. To learn about how the theremin works, scroll down to my starter project entry here on this page.
How my main project works is that the ultrasonic sensor tells the arduino the distance to the nearest obstacle, and the arduino decides based on that data to send one of two signals to the output pins connected to the motors: the one that will cause it to proceed, or the one that will cause it to reverse and change direction. The ultrasonic sensor first sends out ultrasonic sound waves, and then waits to hear the echo. Based on the time it takes for the echo to come back, the arduino can calculate the distance to what it echoes off of using the speed of sound. Then, the arduino will decide to send the signal to move forward if the distance is more than 5 cm, and move backwards if it is less. The forwards or backwards signal then goes through the H bridge integrated circuit, which will send the signal through to the correct side of the motor, and once the current goes through the motor, the H bridge brings it back through to ground. The turning direction is simpler because it is only necessary to make it turn in one direction (I chose left) so instead of using an H bridge there is only one output pin and one ground involved. Once the robot goes backwards for one second, the arduino just sends a HIGH signal to the output pin. This design was much easier for me to make than the one that I originally planned on, which involved reverse engineering the circuit board that came with the robot. The reason that I couldn’t do it that way was because the circuit board was very small and there were surface mounted components that were put on by a machine that I was expected to remove. When I tried that, I burnt the circuit board so it didn’t work at all. At that point, I had nothing to lose, so I tried taking out the circuit board, and found that I could control the motors directly from the arduino. That is how I got to having the project that I have now. Overall it was a very rewarding experience to have created my own project and have it work really well.

Bill of Materials:http://bluestampengineering.com/wp-content/uploads/2014/06/Screen-Shot-2014-07-23-at-9.56.26-AM.png


Code: https://gist.github.com/Margaretmcrawf/7d475f587152abdb924d

Milestone 3- Forward and Left Movement

The spider robot now moves to the left and forward. After struggling with the robot moving erratically, I discovered that the reason that it wasn’t following the commands set in the code was that the circuit board that came with the robot, from which I removed an integrated circuit and to which I soldered many wires, was damaged. It came to a point where all it would do was rotate its head in circles, even when I grounded the wires that controlled spinning and modified the code to only go forward. Then I tried disabling the turning function by cutting the wire attaching the circuit board to the turning motor, but then it wouldn’t move at all, so clearly the circuit board was very damaged. Finally I decided that since I had nothing to lose I might as well try cutting out the circuit board entirely, and trying to find a way to control it directly from the arduino. There are two motors in the robot, one that controls spinning and the other walking. Each motor spins in two directions to control left or right, and forwards or backwards. To start out I just attached the wires to numbered pins in the arduino and ground, so for now each motor is only able to go in one direction. However, it does the functions that it is supposed to do, which is forward if there isn’t an obstacle, and left if there is. My next step will be to build an H bridge to allow the motors to switch direction on command, so the robot can back up and turn right.

Milestone 2- Sensors Working

I got my spider to indicate when the sensors are working with an LED, and I am confident that they are working because of the light. When there is an object within 20 cm of the sensors, which is when the spider would decide to back up and turn, the LED turns on, and when the path is clear for that distance, the light stays off, and when the robot moves it would go forward. Since my last milestone, I have also improved the batteries, since the three 3 volt coin batteries that I was using were dissipating a lot of power to the electrical tape that was holding them together and causing the arduino to not function well. My next step will be to look in to the problems with the robot’s movement, and getting it to move properly in the correct directions.

Milestone 1- Robot Moving

I got my hexbug spider robot to move today. I connected all of the wires to the arduino and balanced the batteries, ultrasonic sensor and arduino on top of the robots head. It isn’t moving continuously or avoiding obstacles yet, but if you wave your hand in front of the sensor it scuttles to the right for a second or two, then stops. My next step will be to solder the wires where there are connector wires that aren’t soldered. The soldered wires will be more stable, so they don’t disconnect accidentally. They will also be shorter so that they don’t trip up the robot’s legs. I will also look at the code and see if there are any mistakes in it that are causing the spider to act weirdly.

Starter Project- Junior Theremin

For my starter project, I made a theremin. It’s a musical instrument which is controlled by the distance of the player’s hand from the antenna. This works because the wire’s magnetic field is disrupted by a person, whose body has a natural capacitance. The theremin produces a frequency from that sound, with a shorter distance causing a higher frequency. The sound is made by a piezoelectric buzzer, which converts electric current to sound. A higher voltage causes a higher frequency. There are also LED lights that light up when a persons hand is close. LED stands for light emitting diode, and they work by emitting light when electrons move in a semiconductor material. The lights and sound are controlled by the two integrated circuits on the board. Integrated circuits are circuits that are inside a chip and control different functions of the whole circuit. There are also capacitors and resistors, which both help to control the electricity going through the circuit. Resistors cause resistance in the circuit, so they cause a voltage drop in other parts of the circuit, which basically stops parts of the circuit from getting too much power. Capacitors store power, which they can store and then release when a part of the circuit needs a quick burst of power.
Through this project, I learned how to solder, which I had no experience with before. I also learned what many of the parts were. I learned how LED lights work and what piezoelectricity is. Now that I’ve finished this, I’m moving on to my main project, which is an obstacle avoiding robotic spider.

Leave a Comment

Start typing and press Enter to search