An Infrared Tracking Dog
![红外狗狗.png](/proxy/?url=https://content.instructables.com/F6X/ZELS/JR6OE2TA/F6XZELSJR6OE2TA.png&filename=红外狗狗.png)
![Homemade Infrared Tracking Machine Based On Maduino](/proxy/?url=https://content.instructables.com/FXM/WHYT/JR6OE2TB/FXMWHYTJR6OE2TB.jpg&filename=Homemade Infrared Tracking Machine Based On Maduino)
![微信图片_20190122160529.jpg](/proxy/?url=https://content.instructables.com/FUN/IN9D/JR6OE33X/FUNIN9DJR6OE33X.jpg&filename=微信图片_20190122160529.jpg)
Someday I found an interesting video at: http://arduinotr.com/cisim/?fbclid=IwAR22rYmiRQQJ0nqAusOLhBj_778gROseej6TUonvbOnAd65A-sl_wnyqrJQ&tdsourcetag=s_pcqq_aiomsg this is really a good video but, cheating…
At the first glance I feel It really strange, and then feet cheated, do not know what is the bottom reason for this designer made such a misleading story… it is Impossible by a simple IR sensor, or even without any controller but only simple triodes.
I do not know the guy and the whole story, I just try to make it by myself. I just made my own design, with very simple modules:
- Any Arduino compatible controller such as Maduino
- L298N motor driver
- 3x IR sensor
- Some common jumpers
Obstacle Detection.
![IMG_9025.JPG](/proxy/?url=https://content.instructables.com/FO0/AGTU/JR6OE0E4/FO0AGTUJR6OE0E4.jpg&filename=IMG_9025.JPG)
There 3 IR sensors are used to detect the obstacle, and the left/right sensor detected the obstacle, it should be rotate toward the clock/anti-clock direction, while the middle sensor detected, it is all right.
The 3 sensor detects if any obstacle in front. Connects the signal pin to Maduino input pins, such as Pin2/3/4;
As the software,simple check the sensor output status, to decide what the motor should do:
<p>if (IR1_STA == HIGH & IR2_STA == LOW & IR3_STA == HIGH)//If the middle<br>sensor detect the obstacle, motor stop</p><p> {</p><p> analogWrite(EN,0);</p><p> Stop();</p><p> }</p><p>if (IR1_STA == LOW & IR2_STA == HIGH & IR3_STA == HIGH)//if the<br>right sensor detect the obstable, motor reverse with high speed;</p><p> {</p><p> analogWrite(EN,highspeed);</p><p> Reverse();</p><p> }</p><p>if (IR1_STA == LOW & IR2_STA == LOW & IR3_STA == HIGH) //if the right& middle sensor detect the obstable, motor reverse with low speed;</p><p> {</p><p> analogWrite(EN,lowspeed);</p><p> Reverse();</p><p>}</p><p>……</p>
Motor Control
![IMG_9027.JPG](/proxy/?url=https://content.instructables.com/F6Q/EYWD/JR6OE1B6/F6QEYWDJR6OE1B6.jpg&filename=IMG_9027.JPG)
![IMG_9024.JPG](/proxy/?url=https://content.instructables.com/F74/PQBE/JR6OE1CM/F74PQBEJR6OE1CM.jpg&filename=IMG_9024.JPG)
And a motor driver to driver the motor, with high/low speed, depends on the sensor status.
Using an L298N module to drive the motor, with Maduino pin5/6 , and PWM pin(Maduino Pin9) to L298N Enable pin, and power the module with 9V:
<p>int EN=9; //PWM control</p><p>int highspeed = 80;//define the high speed</p><p>int lowspeed = 60;//define the low speed</p>
and then the motor speed can be controlled by :
<p>analogWrite(EN,highspeed);</p>
Install Something There, Such a Dog...
![红外狗狗.png](/proxy/?url=https://content.instructables.com/FYL/DIFK/JR6OE24X/FYLDIFKJR6OE24X.png&filename=红外狗狗.png)
Install the sensors and motors, and make something on, for me, I like a dog to play with my 1.5 years old daughter.
Donwload the Arduino code here....of free to contact me : service@makerfabs.com if any questions