Introduction: Robotic Eye

Hello, This time I will show an application of the infrared sensor module with Arduino.

This module (composed of a pair of LEDs, a infrared transmitter and a receiver and an IC that generates a frequency modulated) is generally used to detect obstacles in robots.

This module has some advantages over a simple LED emitting LEDs with a photodetector. The principal, in this case is that the emission frequency is modulated, preventing ambient light makes the receiver detect the wrong signal. Also, the construction module that facilitates interconnection and didactic use with the Arduino.

Step 1: Materials

- An Arduino board

- A sensor shield board

- 3 infrared sensor modules

- A standard servomotor

- A Styrofoam ball

- wires


Step 2: Mounting

Cut the Styrofoam ball to hold the arm of the servomotor, paint the Styrofoam ball in the shape of an eye, fit the servo arm in the eye and fit them into the servo.

Step 3: Mounting the Shield and Connecting Sensors

Mounting the Shield in Arduino, install the sensors with the aid of wires.

Note: The receiver module has 4 pins.

- A 5V

- 1 GND

- 1 OUT

- Enable (works to enable the module when it is without the jumper)

* Be careful not to inveter wires.

How to connect the wires:

Shield  ->  Sensors
 
pin  12 ->  left sensor

pin  11 ->  center sensor

pin  10 ->  right sensor

Step 4: Mounting the Servo and Programing

After the sensors installed, install the servo on pin 9 of the shield, programming and testing.

The eye works as follows: to detect an object in front of each sensor (up to 40 cm, adjustable), the sensor changes state at the exit from Hi to Lo (of 5volts to zero) then the Arduino realize that there was a change state in one of its ports so, according to the software, the servomotor to rotate the eye to the preset position.

This was an application of the didactic use of infrared sensors. Many other applications are possible. The limit is your imagination. Hope you enjoy.

  Software:

#include <Servo.h> // include servo library
Servo pescoco; // create servo object to control a servo
int pos =0;
int irdireita = 10;
int iresquerda = 12;
int ircentro = 11;
int tempo = 50;

void setup (){
pescoco.attach(9); // attaches the servo on pin 9 to the servo object
pinMode (irdireita, INPUT); // set pin irdireita (pin10) as input
pinMode (iresquerda, INPUT); // set pin iresquerda (pin12) as input
pinMode (ircentro, INPUT); // set pin ircentro (pin11) as input
}
void loop(){
int valdireita = digitalRead (irdireita);
int valesquerda = digitalRead (iresquerda);
int valcentro = digitalRead (ircentro);

if (valdireita == LOW){
pescoco.write(180);
pos = (180);
delay (tempo);
}
else if(valesquerda == LOW){
pescoco.write (0);
pos =(0);
delay (tempo);
}
else if (valcentro == LOW){
pescoco.write (90);
pos = (90);
delay (tempo);
}
else {
pescoco.write (pos);
delay (tempo);
}
}

Comments

author
Leonegeek made it!(author)2015-09-26

Muito bom mesmo!! gostaria do manual, documento alguma coisa que me ajude com este sensor, você poderia compartilhar? Adquiri um igual porém não encontro informações relevantes para que funcione da maneira desejada :/

author
PeckLauros made it!(author)2015-09-26

Esse é o problema com esses eletrônicos da China. AS vezes encontramos na própria página alguma s dicas dos compradores.

author
LesPicard made it!(author)2014-10-08

MAneiro. Gostei mt

author
PeckLauros made it!(author)2014-10-14

Valeu!

author
J-Five made it!(author)2012-10-08

Great for Halloween!!!

author
J-Five made it!(author)2012-10-11

By placing it in a hallowed toy skull rig the eyes to move when someone tries to get some candy!!!

author
J-Five made it!(author)2012-10-04

I SEE YOU!!!!

author
PeckLauros made it!(author)2012-10-04

Hehehe..

author
J-Five made it!(author)2012-10-07

I meant to say "EYE SEE YOU!"

author
Nadr0j made it!(author)2012-10-05

Looks awesome and like a lot of fun. I'd love to give this a try.

As a beginner to Arduino, could you take some time to explain the code to me? It looks somewhat simple but includes some functions I may not be familiar with.

author
PeckLauros made it!(author)2012-10-05

Hi ! Welcome to Arduino's World!
Im a beginner too. I will try to explain it to you (inside the code above) but my english is a little poor.

author
temduke58 made it!(author)2012-07-25

I am trying to find the parts for this project. Was wondering where the parts could be found for reasonable prices. The sensors are difficult to find.

author
PeckLauros made it!(author)2012-07-25

Hi Below is the list of items I bought.

Arduino Board:
http://www.dealextreme.com/p/arduino-duemilanove-2009-atmega328-p-20pu-usb-board-blue-60cm-118078?item=50

Sensor Sheild:
http://www.dealextreme.com/p/jy-mcu-sensor-shield-v4-0-arduino-uno-2009-123623?item=32


BreadBord Wires:
http://www.dealextreme.com/p/30cm-breadboard-wires-for-electronic-diy-40-cable-pack-80207

Infrered Sensors:
http://dx.com/p/ir-infrared-sensor-switch-module-121517?item=1

author
temduke58 made it!(author)2012-07-25

I appreciate the info. Looking forward to building this project! Thanks!!

author
PeckLauros made it!(author)2012-07-25

OK. Then show us some pictures as soon as possible

author
temduke58 made it!(author)2012-07-25

Will do. Ordering the parts very soon.

author
Adambowker98 made it!(author)2012-07-11

You should put a wireless camera inside the eyeball!

author
PeckLauros made it!(author)2012-07-12

Good idea!

About This Instructable

17,925views

36favorites

License:

More by PeckLauros:El Chapulin Colorado Custom Stranger BitsPing Pong Larson Scanner
Add instructable to: