Joy-it SBC-PIR User guide

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
INFRARED MOTION SENSOR
SBC-PIR
1. GENERAL INFORMATION
Dear customer, 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. USE WITH ARDUINO
Aer connecting the SBC-PIR, as shown above, we will now connect the Arduino to our PC using the included cable. Then we will open our Arduino DIE. If you don't have it yet you can download it here and install it. Aer that we select our Arduino under Tools > Port. Under Tools > Board we select
"Arduino Uno" and under Tools > Programmer we select "ArduinoISP".
Pin assignment
Sensor
Pin assignment
Arduino
Sig Pin 2
VCC Pin +3,3V oder
Pin +5V
GND Pin GND
2.1 CODE EXAMPLE ARDUINO
Aer the above steps we will now simply copy the following code into our IDE.
#define PIR_MOTION_SENSOR 2 //PIN für den PIR-Sensor
int sensorValue;
void setup()
{ // Pininitialisierung pinMode(PIR_MOTION_SENSOR, INPUT); pinMode(LED,OUTPUT); Serial.begin(9600); }
void loop()
{ sensorValue = digitalRead(PIR_MOTION_SENSOR); if(sensorValue == HIGH) { Serial.println("Bewegung erkannt"); delay(1000); } else { Serial.println("Keine Bewegung erkannt"); delay(1000); } }
Loading...
+ 3 hidden pages