Joy-it SEN-KY032IR User guide

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
INFRARED PROXIMITY SENSOR
SEN-KY032IR
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
3. USAGE WITH A RASPBERRY PI
1. Connection
KY-032 Raspberry Pi
GND Ground
(Pin 6)
V+ 3.3V
(Pin 1)
Signal GPIO24
(Pin 18)
Enable Pin
-
Jumper is
plugged
2. PIN ASSIGNMENT
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
This code reads the current status of the sensor and displays in the console whether an obstacle is present or not. If the sensor detects an obstacle, another LED (Sled) lights up. The sensor has two potentiometers with which the sensitivity of the receiver as well as the transmitter can be adjusted. You can also download this sample code here. First, you have to install this package:
wget http://sensorkit.joy-it.net/images/d/d8/KY-032_RPi_HindernisDetektor.zip unzip KY-032_RPi_HindernisDetektor.zip
2. Code example
# 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 ("No obstacle") else:
print ("Obstacle detected") print ("---------------------------------------")
# Reset + Delay time.sleep(delayTime)
# Clean up after the program has finished
except KeyboardInterrupt:
GPIO.cleanup()
sudo apt install python3-rpi.gpio
Now, you can either use the following commands to download and unzip the file :
Or you can create a new file with the following command and copy the example code described into it:
sudo nano KY-032_RPi_HindernisDetektor.py
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
Now, you have to save the file with CTRL + O and press Enter to confirm. Press CTRL + X to exit the editor again.
With both variants, the program will be performed as follows:
sudo python3 KY-032_RPi_HindernisDetektor.py
4. USAGE WITH AN ARDUINO
1. Connection
KY-032 Arduino
GND GND
V+ Pin 5V
Signal Pin 10
Enable Pin
-
Jumper is
plugged
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. Code example
This code reads the current status of the sensor and displays in the console whether an obstacle is present or not. If the sensor detects an
obstacle, another LED (Sled) lights up.
int Sensor = 10; // Declaration of the sensor input pin
void setup (){
Serial.begin(9600); // Initialization serial output pinMode (Sensor, INPUT) ; // Initialization of sensor pin
}
// The program reads the current status of the sensor pin and // displays in the serial console whether an obstacle is currently detected
// or if there is no obstacle in front of the sensor
void loop (){
// The current signal at the sensor is read out bool val = digitalRead (Sensor) ;
// If a signal could be detected, the LED is switched on. if (val == HIGH){ Serial.println("No obstacle"); } else { Serial.println("Obstacle detected");
}
Serial.println("------------------------------------"); delay(500); // Pause between the measurement of 500ms }
In this code example, the received data is issued on the serial Monitor. Make sure that the baud rate is set correctly (9600). Also make sure that you have set the right board and port in your Arduino IDE before uploading. You can also download the code example here. The sensor has two potentiometers with which the sensitivity of the receiver as well as the transmitter can be adjusted.
5. ENABLE - PIN
This sensor has an additional pin called Enable. This pin oers the possibility to activate o to disable the sensor via a controller. By default this is activated by means of a jumper. This means that the obstacle detection is always performed. If you want to deactivate the permanent detection, remove this jumper (EN) and connect the enable pin to a pin with which a control signal can be sent.
www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
PR
6. OTHER INFORMATION
Our information and take-back obligations according to the
Electrical and Electronic Equipment Act (ElektroG)
Symbol on electrical and electronic equipment:
This crossed-out dustbin means that electrical and electronic appliances do not belong in the household waste. You must return the old appliances to a collection point. Before handing over waste batteries and accumulators that are not enclosed by waste equipment must be separated from it.
Return options:
As an end user, you can return your old device (which essentially fulfils the same function as the new device purchased from us) free of charge for disposal when you purchase a new device. Small appliances with no external dimensions greater than 25 cm can be
disposed of in normal household quantities independently of the
purchase of a new appliance.
Possibility of return at our company location during opening hours:
Simac GmbH, Pascalstr. 8, D-47506 Neukirchen-Vluyn, Germany
Possibility of return in your area:
We will send you a parcel stamp with which you can return the device to us free of charge. Please contact us by e-mail at Service@joy-it.net or by telephone.
Information on packaging:
If you do not have suitable packaging material or do not wish to use your own, please contact us and we will send you suitable packaging.
7. SUPPORT
If there are still any issues pending or problems arising aer your purchase, we will support you by e-mail, telephone and with our ticket support system.
E-Mail: service@joy-it.net Ticket system: http://support.joy-it.net Telephone: +49 (0)2845 98469-66 (10-17 oclock)
For further information please visit our website:
www.joy-it.net
Published: 20.03.2020
www.joy-it.net
SIMAC Electronics GmbH
Pascalstr. 8, 47506 Neukirchen-Vluyn
Loading...