A simple exemple to create a line tracker or detect if a door is opened with only one KY-033 module and a raspberry PI, sensor from the "Elegoo37-1 Sensor Kit v2" that Elegoo sent me.
Elegoo did a very great job for the price of the components kit. I strongly recommand this kit for begineer's projects like this one.
This project is also compatible with the HW-006 v1.2 and some others tracker modules. This project includes a python code that is really simple to use.
Connect sensor through the GPIOThere is a very little manipulation to connect 3 pins of the sensor on the GPIO. Let's see :
S is for Signal got to GPIO24[Pin 18] , +V is for voltage go to 3, 3V [Pin 1],G is for ground and go to GND [Pin 6] (See shematic)
Install and start scriptPython is required. Install it before doing anything.
Clone code exemple in this gist where you want in your RPi.
git clone https://gist.github.com/2299af0b2fbace8994b9fb9e409bc3f5.git
Open your command line and launch the script :
python tracer.py
Your code should display "Line detected " when a dark line is near the sensor like in this exemple : https://streamable.com/e/gcu08m
Enjoy!
Comments