How to Build a Infrared Sensor


This tutorial teaches you how to build a Infrared Sensor which is essential to line following robots? Making this yourself, would be much cheaper than buying one, and it’s not difficult at all! The result would be something like this:

Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

This instructable comes in two stages, Stage 1 is the prototyping stage, where you build the circuit on the bread board and debug it for design flaws. Stage 2 is fabrication where I’ll teach you how to create a strip board product that you can plug straight into your robot.

The good thing about this tutorial is you’re able to do many things with these sensors.

Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

  • 1x Arduino
  • 1x Bread board
  • 1x Strip board
  • 1x Wire reel, black
  • 1x Wire reel, red
  • 1x Wire reel, green
  • 2x Infrared LED (Maplin/Sparkfun)
  • 2x Phototransistor (Maplin/Sparkfun)
  • 2x Red 5mm LED (Maplin/Sparkfun)
  • 2x 1k Ohm resistor
  • 2x 220 Ohm resistor
  • Wire cutters
  • Wire strippers
  • Helping Hands
  • Heat shrink tube (Not used)
  • Heat source (Not used)
  • Soldering iron
  • Solder

Step 1: Let’s Get Started Build a Infrared Sensor

You want to take your bread board and your infra red LED’s and photo transistors and place them side by side (1 hole apart) in the bread board, repeat for the other infra red pair.

Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

Now let’s start wiring up the infrared LED’s first, place a 220 Ohm resister in the same row as the IR LED cathode then wire it to ground, and make sure to wire both. Next you need to wire up both of the IR LED anodes to the power rail.

Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

Step 2: Keep Going

Now we’re moving onto the photo transistors. Take the red LED’s and place the cathode in the photo transistors anode row, next we place a 1k Ohm resistor inside the photo transistors cathode.

Now we take a wire and connect the anode of the red LED to the power rail. We also need to ground the photo transistors do that now.

Demonstration of DIY Selfmade Infrared Sensor (line follower robots) Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

Now we just need to wire the photo transistors to the analogue inputs zero and one, to do this wire the cathode of the photo transistor before it goes to the 1k Ohm resistor, the left most wire should go to analogue zero and the one on the right should go to analogue one.

Step 3: Connect to the Arduino Board

Now if you wire in the power supply from the Arduino (+5v and Ground) if you wave your hand in front of the IR LED/phototransistor pairs, you should notice the red LED’s fading from dim to bright and back as you move your hand. If the LED’s are indeed facing back and forth congratulations you’ve completed the basic prototype, you can move onto the next step.

How ever, if you’re not getting any results from waving your hand back and forth you must check your wiring (Maybe your IR LED’s are either burned out or put it in backwards).

Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

 

Step 4: The Code

If you want to test out the circuit, upload the following sketch to your Arduino.

 

Full Source Code can be found in the link at the bottom of this post.

Demonstration of DIY Selfmade Infrared Sensor (line follower robots)

 

 

For More Info: www.instructables.com/id/DIY-Infrared-Sensor-Module/

Share Button

Leave a Reply