An Infrared Tracking Dog

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:

Step 1: Obstacle Detection.

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>

Step 2: Motor Control

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>

Step 3: Install Something There, Such a Dog...

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

Share

    Recommendations

    • Faux-Real Contest

      Faux-Real Contest
    • Epilog X Contest

      Epilog X Contest
    • Warm and Fuzzy Contest

      Warm and Fuzzy Contest

    Discussions