Yes, I had done that on one iteration of my board and it provided a stable 5.0 v. I don't recall why I decided to go back to the mini.... Maybe the others can chime in on that ?? I will remove R2.R2 is not needed and would suggest replacing the mini 360 with a linear regulator since the load is miniscule.
I don't know why R2 is there.R2 might be a remnant from the hysteresis circuit. Maybe ericgibbs or eetech00 can verify that.

Hi Eric. My code is actually working perfectly (lacking hysteresis), but here is what happens:hi john,
As posted earlier:
While the LDR senses that it is Daylight in the monitored area, the main section of the unit will be dormant
Let's assume that it becomes Dark and the PIR is enabled, what sequence of events are triggered in the unit?
Then the PIR detects movement, what sequence of events are triggered in the unit and for what duration?
I am trying to build an idea of a flow chart for the unit coding.
E
Sounds like there is some hysteresis in the code presently.My code is actually working perfectly (lacking hysteresis),
hi,When motion is detected, RA LEDs blink at 255 PWM several times over 5 seconds, then return to solid at 150 PWM. Then the 3UP LED slowly brightens over 90 seconds to 243 PWM brightness.
No. My current code and original schematic does not address hysteresis. That was the initial reason for this thread.Sounds like there is some hysteresis in the code presently.
Folks will watch wild game at night.....hi,
What is the purpose of this lighting sequence, who is going to see it?
You did say earlier that the project was to deter hog poachers.
E
Not in my current code. The LDR energizes the unit and enables the PIR at dusk and disables it at dawn. The PIR going HIGH initiates the code sequence outlined earlier.Maybe it does.
The code tells when to activate the PIR when getting dark, it must have a line of code to deactivate when it gets lighter outside.
/*
LDR Analog Input
LDR GL5528 Jan 12 2025 ESP
Bench testing the LDR >> ADC >> PIR enable limits
*/
int ldrPin = A0; // ADC input
int adcCount = 0;
int adcAvg = 0;
int enbPIR = 0; // PIR detection Enabled when = 1
void setup() {
Serial.begin(9600); // used for IDE testing
Serial.println("ADC Counts for LDR Resistance");
}
void loop() {
// read the ADC count value created from the LDR voltage
// take the Average of 10 readings, set readings delay to suit project
for (int i = 0; i <= 9; i++) {
adcCount = analogRead(ldrPin);
adcAvg = adcAvg + adcCount;
Serial.print(adcCount); // test only
Serial.print(" "); // test only
delay(200);
}
Serial.print("adcAvg= "); // test only
adcAvg = adcAvg / 10;
Serial.print(adcAvg); // test only
// hysteresis
if ( adcAvg > 600) { // dark
enbPIR = 1;
// Serial.print(adcAvg); // test only
}
if (adcAvg < 550) { // light
enbPIR = 0;
// Serial.print(adcAvg); // test only
}
adcAvg = 0; // clear AVG Count
// Select if PIR is enabled or not
if (enbPIR == 1) {
Serial.println(" Dark"); // test only
} else {
Serial.println(" Light"); // test only
}
}
Are you referring to Eric's test code?Yes I understand that.
I don't fully understand the code posted as I'm not an Arduino user but it appears to me in the code posted that it simply enables the PIR when the LDR input pin is a digital High and disables the PIR when a digital Low which provides the hysteresis.