PROJECT GOLF: I.R. Sensor Autonomous Arduino Car

Introduction

The assignment proposed was to create an autonomous artifact which transports a ping pong ball from point A to point B through 2 different courses, following specific directions.

To achieve this goal, infrared receiver/emitter technology is used to actuate an arduino based car. The car is the receiver of IR signals, which are emitted by beacons strategically placed on the proposed course, navigating the vehicle to its target.


Objectives:

  • Create an autonomous object to transport a ping pong ball to a specific target.
  • The vehicle should self-orient to an endpoint on 3 proposed courses.
  • Using IR technology, autonomous car should be able to receive a specific signal from a beacon, move towards it, stop and do a 360º scan to search and find another beacon signal and move towards it following the given track.
  • When the vehicle reaches the end of course, it should be able to deliver the ping pong ball at the end point.

Components Used  

IRarduino-MotorServo

In order to create an autonomous vehicle that receives specific IR signals from fixed beacons and move towards them accordingly, we required the following components:

Primary Arduino (Riri)

– Arduino Uno
– IR Receiver 

Secondary Arduino (Rob)

– Arduino
– Solderless breadboard
– H-bridge
– DC Motors 5V (2x)
– Wheels to fasten onto DC motors (2x)
– Servo for middle wheel
– Wheel for middle wheel servo
– Custom bracket for middle wheel
– 5V regulator for servo middle wheel
– Servo for trapdoor containing ping pong ball.

See Bill of Materials here

BeaconEnd

 IR_emitter

– Arduino Duemilinova
– Breadboard
– IR LED
– Resistor for IR LED (330 ohm)
– Ultrasonic Sensor
– Baltic fir plywood box

Beacon1 (can be repeated ad infinitum)

– Arduino Duemilinova
– Breadboard
– IR LED
– Resistor for IR LED (330 ohm)
– Ultrasonic Sensor
– Baltic fir plywood box

See Bill of Materials here

 Runway Course

– 6 circuits of 3 or more LEDs
– 100k resistors

 Chassis

– Laser cut wood (Baltic Birch Plywood)
– Balsa wood


 

Dividing the workload

In the beginning, we divided the creation of our soon-to-be autonomous, self-driving robot into separate tasks of movement and sensing:

Egill drew initial sketches for a dummy chassis to test out ideas of what components we might include.

initial-sketch-build-1

Egill created the working engine using 2 DC motors  powered wheels at the sides of the car. A third servo powered wheel was added later at the front of the vehicle to turn and steer the car through the courses.

Initially we decided to create a line-following robot using an IR array.

At an early stage, an Ultrasonic Sensor was  used to prevent the vehicle from colliding into obstacles. That way, the servo guiding the front wheel would turn to the left until the ultrasonic sensor found no obstacle, then the servo would  turn back to the right and the car would drive straightforward.

 

Transporting the ping pong ball

In stages, a 12V fan was suggested to create a vacuum that would suck up the ball from the start point, letting it drop at the end point. The idea was discarded because the  fan required a lot of power and other fans were not strong enough.

Finally, a servo powered trap door was used to carry the ball inside the vehicle’s chassis and release it at the end of the course.

Getting everything together

Testing and assembly included tweaking of the motor functions, changing Beacon IR i.d.s, conceptualizing a theme, and troubleshooting after assembling the separate parts.

After a few changes were suggested, we began working on a final prototype. Initial beacons were created, which each comprised of an IR emitter and an arduino, eventually used in conjunction with Ultrasonic sensors, all housed in a wooden box.

IMG_9694

 At three separate points throughout the process, we gave ourselves until the end of the day before giving up on using IR LED emitter/receivers.  If we had stuck to other of our initial plans, whether line-following or obstacle avoiding, we may have had a perfectly autonomous, self-guiding robot on the day of the presentation.


Movement

For agility purposes, we decided to go with an H-bridge IC chip for the DC motors. That way we could affect the turning direction of the motors, giving us a range of movement options; forward, backward, spin clockwise/counter-clockwise on the spot.

IMG_9575

Early  the robo was going to be a tripod where a middle wheel or a ball would essentially serve only as a stability function.  This  static middle wheel was later replaced for a servo and a custom bracket to hold a 3rd wheel.

Initial tests with the DC motors and servo had power issues, we divided power sources into two sections based on our robot’s vision (sensors) and movement (actuators). A micro servo was used to swing open a trapdoor at the bottom of the chassis to release the ball.


Voiceshield

To make things more interesting and fun, we thought of including a voiceshield, an arduino shield that allows you to record and playback up to 4 minutes of audio, to have audio samples  played on certain parts of the course; and have the robot narrate its own behaviour.


The two headed beast – Introducing a 2nd arduino

After programming and testing a voiceshield,  we assembled it onto our robot’s arduino but an unexpected error occurred. The voiceshield  interferred with the H-bridge so that only one of the DC motors was receiving either enough power or logic to run. Since a voiceshield depends on using digital pins 2-5, we moved the h-bridge pins to other pins but we ran out of digital pins.

A separate arduino  was used for “doing the talking” with the voiceshield a primary arduino would do everything else – including sending signals over to additional arduinos via the Wire.h library telling it to play samples at certain touch points. 


More issues

 With two motors and servo running smoothly together, an IR receiver getting programmed signals from different IR LEDs, testing was done on how the sensing parts of the robot affected the moving parts.

We sadly realized at a really bad timing that the IR receiver was interfering with the DC motors was one example, and also the voiceshield interferred with the DC motors as well.

 Prioritizing

Since the voiceshield was making other communications lag and switching places did not help either,  we sadly decided to drop the voiceshield in favour of the ultrasonic sensor and the IR on the additional arduino.

 Where we had figured out how to Wire.h a signal between the two arduinos, we had little luck in sending over plural signals, i.e. one for recieved IR signal and another one for distance sensed via ultrasonic sensor.

We had the idea of “why not just put the ultrasonics on the IR LED beacons themselves“? So they would send out a certain signal to begin with and when the robot would be within a certain distance, the IR LEDs would send out a different signal where the robot would then stop and drop the ball.


Behaviour Relationship

Course 1

  1. IR Receiver on Riri (primary arduino) looks for BeaconEnd’s signal 1. While it’s not receiving that, send a default x=0 over to Rob (secondary arduino) so Rob will spin his wheels in opposite direction with the middle wheel turned sideways.
  2. When IR Receiver on Riri gets to BeaconEnd’s signal 1, Riri sends to Rob x=1 which makes Rob go forward by spinning both wheels forwards and rotating the middle wheel forward.
  3. When BeaconEnd senses distance being less than 15cm, it will send out signal 2. Riri receives it and writes x=2 to Rob who now stops for 3 seconds, turns the trap door 90° effectively dropping the ball. In 3 seconds time, Rob will turn sideways, go forwards and then stop, signaling he’s happy and done for the day.

 Course 2

  1. IR Receiver on Riri looks for Beacon1’s signal 3. While it’s not receiving that, send a default x=0 over to Rob so Rob will spin his wheels in opposite direction with the middle wheel turned sideways.
  2. When IR Receiver on Riri gets Beacon1’s signal 3, Riri sends to Rob x=3 which makes Rob go forward by spinning both wheels forwards and turning the middle wheel into a forward position.
  3. When Beacon1 senses distance being less than 15cm, it will send out signal 4. Riri receives it and writes x=4 to Rob who now will spin his wheels in opposite direction with the middle wheel turned sideways.
  4. This will keep going until Riri now gets BeaconEnd’s signal 1. Riri sends to Rob x=1 which makes Rob go forward by spinning both wheels forwards and turning the middle wheel into a forward position.
  5. When BeaconEnd senses distance being less than 15cm, it will send out signal 2. Riri receives it and writes x=2 to Rob who now stops for 3 seconds, turns the trap door 90° effectively dropping the ball. In 3 seconds time, Rob will turn sideways, go forwards and then stop, signaling he’s happy and done for the day.

Course 3

 In theory, we would simply connect two additional beacons, place them on the appropriate places on the course and the robot would do its thing. Unfortunately, we ran into problems which prevented us from arriving at this solution in real life. We are currently still not 100% certain that there is a way to make this system work without spending months doing it.


Final thoughts

Even though it didn’t work as well as we had hoped, we advanced our knowledge of arduino and our understanding of robotic constitution. We learned to cut our losses sooner, and not feel bad about going to plan B when plan A is a relentless impediment.