AllenPitts
Member
Hello ETO forum,
The object of the project is to control seven groups of six LEDs with seven PIR sensors.
The endeavor was begun using 555 timers to turn on the LEDs for ten seconds.
This circuit is thoroughly tested and works well.
Some complexity was added to the project as to how the LEDs react to the sensors
and an Arduino was added to allow some logic to be provided as to how the sensors
controlled the LEDs.
This circuit works but there is a delay which has been timed with a stop watch at between 2.6 and 2.8 seconds.
In the 555 circuit above the reaction of the LED to movement at the PIR is instantaneous. But the reaction of
the LED to the PIR is delayed almost three seconds.
To be sure the signal from the PIR in the second schematic must go thru the input and output of the Arduino
to get to the transistor but it was not expected that it would take three seconds.
The Arduino sketch (program) is simple (copied herewith below). And the part of the code that is looping and polling the sensor
is six lines long.
The Staircase... schematic controls one sensor/LED pair and the plan was to add six more. And so it is feared that the
latency will only increase.
Have done several projects using PIRs and Arduinos and have never seen this inertia. Maybe it is the mini PIR
used in this project. Whereas previously a larger HC SR501 was employed.
Any ideas?
Thanks.
Allen in Dallas
The object of the project is to control seven groups of six LEDs with seven PIR sensors.
The endeavor was begun using 555 timers to turn on the LEDs for ten seconds.
This circuit is thoroughly tested and works well.
Some complexity was added to the project as to how the LEDs react to the sensors
and an Arduino was added to allow some logic to be provided as to how the sensors
controlled the LEDs.
This circuit works but there is a delay which has been timed with a stop watch at between 2.6 and 2.8 seconds.
In the 555 circuit above the reaction of the LED to movement at the PIR is instantaneous. But the reaction of
the LED to the PIR is delayed almost three seconds.
To be sure the signal from the PIR in the second schematic must go thru the input and output of the Arduino
to get to the transistor but it was not expected that it would take three seconds.
The Arduino sketch (program) is simple (copied herewith below). And the part of the code that is looping and polling the sensor
is six lines long.
The Staircase... schematic controls one sensor/LED pair and the plan was to add six more. And so it is feared that the
latency will only increase.
Have done several projects using PIRs and Arduinos and have never seen this inertia. Maybe it is the mini PIR
used in this project. Whereas previously a larger HC SR501 was employed.
Any ideas?
Thanks.
Allen in Dallas
Code:
/*
* From
https://create.arduino.cc/projecthub/55845/innovation-lab-11-pir-motion-sensor-with-led-43420e
Innovation Lab #11: PIR Motion Sensor with LED © GPL3+
----------------------------------------------*/
int led = A0; // the pin that the sensor is attached to
int sensor = 2; // the pin that the sensor is attached to
void setup() {
pinMode(led, OUTPUT);
pinMode(sensor, INPUT);
Serial.begin(9600);
}
void loop() {
int sensorval = digitalRead(sensor);
Serial.println(sensorval);
if (sensorval == HIGH) {
digitalWrite(led, HIGH);
}
delay(1000);
digitalWrite(led, LOW);
}