The Troyka Motion Sensor is an electronic device designed to detect motion in its surrounding environment. This sensor is commonly used in applications such as security systems, automatic lighting, and interactive installations. By integrating this sensor into an electronic circuit, users can automate responses based on the detection of movement.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply input (3.3V to 5V DC) |
2 | OUT | Digital output signal (High/Low) |
3 | GND | Ground connection |
// Define the pin connected to the motion sensor's output
const int motionSensorPin = 2;
void setup() {
// Initialize the motion sensor pin as an input
pinMode(motionSensorPin, INPUT);
// Begin serial communication at a baud rate of 9600
Serial.begin(9600);
}
void loop() {
// Read the state of the motion sensor
int sensorValue = digitalRead(motionSensorPin);
// Check if motion was detected
if (sensorValue == HIGH) {
// Motion detected
Serial.println("Motion detected!");
// Implement your response to motion detection here
} else {
// No motion detected
Serial.println("No motion detected.");
}
// Small delay to avoid overwhelming the serial output
delay(100);
}
Q: Can the sensor be used outdoors? A: The sensor can be used outdoors but should be protected from direct sunlight and water.
Q: How can I adjust the sensitivity and delay time? A: The sensor typically has onboard potentiometers for adjusting sensitivity and delay time. Rotate these potentiometers to fine-tune the settings.
Q: What is the output signal when motion is detected? A: The output signal goes HIGH (logic level 1) when motion is detected.
Q: Can the sensor differentiate between types of motion? A: No, the sensor only detects the presence of motion, not the type or speed.
Remember to always follow safety guidelines when working with electronic components and consult the sensor's datasheet for detailed information.