Joy-it SEN-KY033LT User guide

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
LINE TRACKER
SEN-KY033LT
1. GENERAL INFORMATION
Dear costumer,
thank you very much for choosing our product. In following, we will introduce you to what to observe while starting up and using this product.
Should you encounter any unexpected problems during use, please do not hesitate to contact us
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. PIN ASSIGNMENT
1. Connection
3. USAGE WITH A RASPBERRY PI
KY033 Raspberry Pi
GND Ground
(Pin 6)
V+ 3,3 V
(Pin 1)
Signal GPIO24
(Pin 18)
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. Code example
This sample code shows in the console whether the sensor is above a line or not. This is done by infrared, because if the sensor is on the line, the
transmitted infrared signal does not reach the receiver.
# Required modules are imported and set up
import RPi.GPIO as GPIO import time
GPIO.setmode(GPIO.BCM)
# The input pin to which the sensor is connected, is declared here.
GPIO_PIN = 24 GPIO.setup(GPIO_PIN, GPIO.IN, pull_up_down = GPIO.PUD_UP)
# Pause between the output of the result is defined (in seconds)
delayTime = 0.5
print ("Sensor-Test [druecken Sie STRG+C, um den Test zu beenden]")
# Main loop of the program
try:
while True: if GPIO.input(GPIO_PIN) == True: print ("LineTracker is above the line") else: print ("LineTracker is out of a line") print ("---------------------------------------")
# Reset + Delay
time.sleep(delayTime)
# Clean up after the program has finished
except KeyboardInterrupt:
GPIO.cleanup()
You can also download this sample code here.
Furthermore, the sensor has a potentiometer with which the sensitivity can be adjusted. A LED also lights up when the sensor receives an infrared signal, i.e. leaves the line.
But first you have to install this package:
sudo apt install python3-rpi.gpio
Now, you can either use the following commands to download and unzip the file :
wget http://sensorkit.joy-it.net/images/c/cf/KY-033_RPi_Trackingsensor.zip unzip KY-033_RPi_Trackingsensor.zip
Loading...
+ 4 hidden pages