Light-Controlled Robot

by cmundi in Circuits > Robots

892 Views, 1 Favorites, 0 Comments

Light-Controlled Robot

opener.jpg

In this tutorial, you will be making an autonomous robot that will move towards a light source! Here, each motor is connected to a sensor that causes the motor to speed up when exposed to light.

Parts List

parts_tot.PNG

Be sure to have these parts on hand before starting your project!

General

  • Breadboard
  • Wires
  • Supplies for body and wheels
    • 1/8" Plywood & Access to laser cutter
    • Access to 3D printer
    • Marble

    • O-rings for traction

    • Zip-ties

Circuit Elements

  • One 556 timer
  • Six Diodes
  • Four 10 nF capacitors
  • Two 1kΩ resistor
  • Two photoresistors
  • Two motors
  • One 9V battery, with holder

To buy your own parts, a list of purchasing links can be found here.

Looking at the Circuit

circuit.png
simu.PNG

This image shows the circuit diagram of what we are trying to build. Creating this circuit will allow for the operation of the two motors.

To see what this circuit looks like in action, check out this simulation (keep in mind shining a light on the photoresistor will decrease its resistance).

This circuit utilizes a 555 Timer to affect the motor's output. In this Instructable, we will be utilizing a 556 timer in order to save space on the breadboard. For more information about these two timer chips as well as how this circuit works, check out this document.

This diagram has all the necessary connections, but now we have to translate it to the breadboard.

Getting to Know the Breadboard

breadboardbox.jpg

Each hole in the breadboard has a connection to other holes that allows us to connect circuit elements simply by placing them in adjacent holes.

To read more on the set-up of a bread board, check out this short article: http://wiring.org.co/learning/tutorials/breadboard/

To learn more about making proper connections: http://wiring.org.co/learning/tutorials/diagrams/index.html

Time to Start Our Build!

bb.PNG

Now that we know how the breadboard works, lets try making some connections! The above image shows what our final project is going to look like. It may seem complicated, but let's break it down:

Setting Up the Breadboard With the 556 Timer

556chip.jpg

First, we're going to add the 556 timer to the breadboard. Place the chip close to one end of the bread board, as shown. This will allow us plenty of room to make all the necessary connections.

The 556 timer has eight pins, each with a different function. This data sheet has more information on how the chip works.

Easy Connections to the 556 Timer

2step6.PNG
easyconnections.PNG

Looking back at the circuit diagram (left), we see that many of the pins are connected to each other. Let's connect those first.

  • Wire 1 shows the connection between the Power (Vcc) and Reset of one side of the 556 chip.
    • Highlighted in green on circuit diagram
  • Wire 2 shows the connection between the Threshold and Trigger
    • Highlighted in blue
  • Doing the same for the other side of the chip, Wire 3 shows the connection between pins 2 & 6, the threshold and trigger pins.
  • These are all shown with yellow wires.

Adding the Power Supply

addingpower.jpg

Connect your battery holder to the positive and negative sides to the breadboard. The red wires connects to the rail marked in red. The black wire connects to the blue rail.

Then, for easy access on the breadboard, connect the corresponding rails of either side of the breadboard with wires (shown in red on the left side of the breadboard). Here the negative (blue) rail was connected with the other blue rail on the other side. The same connection goes for the red, positive rails.

Connecting the Chip to Power

2step8.PNG
1_pwr_grd.jpg
  1. We also have to connect the power (red rail) to Pin 14.
  2. Then we have to ground the chip, connecting pin 7 to the blue rail.
    • These two are shown with orange wires.

It may also be helpful to push two wires connecting the rails off to the side, as shown, so that way we have full access to the pins on the left side of the breadboard.

Adding Photoresistors

2step9.PNG
photoresis.PNG

Here we are adding the photoresistors to our circuit.

In the top half of the breadboard, we connect one side of the photoresistor to pin 14, the power supply (Vcc). This is show in the blue wire and the connection is shown in the blue highlight on the left diagram.

On the bottom half, however, connecting the photoresistor to Vcc is not as easy, but since that pin is connected to the positive side of the battery, we can connect the photoresistor there instead. This connection is shown with the yellow wire and the yellow highlighted connection.

Connecting Resistors

2step10.PNG
3_resis.jpg

Following along on the circuit diagram, we see that one of the connections that follows the photoresistor is to connect a 1kΩ resistor. On the breadboard, we can connect one end of the resistor beneath one end of the photoresistor. The orientation of the resistor does not matter.

Adding Diodes

2step11.PNG
20190506_133736.jpg

After the resistor, we are going to connect a diode in series (directly following the resistor).

*** Be sure to check the direction of the diode. The gray line on the diode corresponds with the line perpendicular to the wire on the circuit schematic. For more information on how diodes work, go check out this link!

More Diodes

2step12.PNG
20190506_133846.jpg

In parallel with the diode we just added, we are going to add a second diode. This means that we are going to add another branch off of the photoresistor. We do this by putting one end of our new diode in the same row as the end of the photoresistor not connected to a power supply. We also want the other end of the diode in line with the end of the diode we previously added.

Connecting the Diodes

2step13.PNG
20190506_134040.jpg

Now, we are going to connect the two diodes together, making a connection to a new row. On the top half of the breadboard, an orange wire is used and on the bottom half, a yellow wire was used.

This is shown in the orange-highlighted connection on the circuit diagram.

Adding Capacitors

2step14.PNG
20190506_134132.jpg

Now we are going to add some capacitors, branching off the connection we just made.

The other side must be grounded, connecting back to the negative terminal of the battery.

More Diodes...

2step15.PNG
diodeR.PNG

Moving over to the other side of the breadboard, we are going to add some more diodes, connecting from the corresponding output pins on either side.

Connecting Diodes to Power

2step16.PNG
diodecOnn.PNG

The diodes you just added connect back to the positive side of the battery. These connections are shown in the rightmost yellow wires, circled in red.

More Capacitors...

2step17.PNG
caps.PNG

Here the capacitors connect to the control pin on the 556 timer. This helps control the amount of noise delivered to the motor.

On the top half of the breadboard, the two connections are shown in green wires. On the bottom half, the vertical green wire connects the capacitor to ground and the rightmost purple wire connects it to the control pin.

Final Connections

2finalcon.PNG
20190506_134257.jpg

Here, we are going to make our last connections. We have to connect the junction between diodes on the left with the threshold pins on the 556 chip. These connections are shown with the long red wires.

Additionally, in the lower half of the breadboard, we need to connect pin 4 to power, shown in the yellow wire.

Connecting the Motors!

2step18.PNG
20190506_134540.jpg

Connect the red wire of the motor to the positive (red) rail and the black wire to the output pin. This should be done on both sides of the chip.

We're almost done...

Let's Test It Out

Testing the Circuit

Before going any further in the build, let's check to see if our circuit works.

First, lets connect the battery. The motors should start to spin a bit, especially if you are testing this in a bright room (you can also hear the motor begin to buzz).

Then, try shining a light directly onto one of the photoresistors. The corresponding motor on that side should begin to spin much faster. Alternatively, you could try covering one of the photoresistors to see if the corresponding motor slows down, or even stops.

If your motors aren't working as they should, check out this document for some troubleshooting tips.

Moving On...

Now that our circuit is done, let's move on to the rest of the build!

Making the Body

frame_parts.jpg
complete_frame.jpg

Using 1/8 inch plywood, laser cut the above 4 pieces using available files. Then, using wood glue, the three pieces on the left can be attached to the largest piece on the right, following the guides etched into the large piece. It may be helpful to apply the glue with a brush for more precise application.

The right image shows the final result.

3-D Printing the Wheels and Caster

3Dprints.jpg
oring.jpg
caster.jpg

Using the available files, 3-D print these three parts!

Then wrap the o-ring around each wheel for traction and force the marble into the caster.

Putting It All Together!

bottombuild.jpg
top build.jpg

Secure the motors on the wooden rails (here painted yellow) with zip-ties. Also glue the battery holder and caster on this side of the body.

Attach the wheels onto the side of the motor.

On the top of the body, use double-sided tape to secure the breadboard.

Thread the motor and battery wires through the rectangular hole.

First Test Run

Moving towards light

Let's try it out!

Re-plug the battery and motor wires into the breadboard, and grab a light source. Also bend the photoresistors in the direction(s) you want the robot to be sensitive to.

  • Then try switching the directions the photoresistors face to either make them move towards the light or away from the light!

You Have Finished the Build!

hotstuff.jpg

Now is the time to add your finishing touches and show your robot off!