Vinz68 / NeoPixel-Stair

Stair LedLights, using NeoPixel Ledstrips and an Arduino
9 stars 1 forks source link

LDR - seems to be useless even I calibrated it by uncommenting the section. #6

Closed AndreiBurdea closed 2 years ago

AndreiBurdea commented 3 years ago

Also - can you modify the code for use with two ultrasonic sensors instead of pir ? That can be fine tuned and oriented more precise to detect the persons. Good job, congratulations !

Vinz68 commented 3 years ago

Hi, I understand that you could not manage to get the LDR working ? How can I help ?

You say you uncommented the section ; but there is one setting to use (or not use) the LDR as documented: bool useLDR = true; // flag, when true the program uses the LDR, set to "false" if you don't have a LDR sensor.

Note: that depending the LDR you are using ; and its resistance (ohm) changes , the analog value read from it might be different. That is why it is important to use the serial monitor; where you can see the value which was read. By changing the light on the sensor you could determine on which value it is dark enough to enable the lights. This value is also a setting (configurable): long LDRThreshold = 600; // Only switch on LED's at night when LDR senses low light conditions => you may have to change this value for your circumstances!

Good luck; I hope that this info helps you ? Plz let me know if you need further help.

AndreiBurdea commented 3 years ago

Hi! Thanks for reply. I set the value of useLDR=true I uncommented the section for serial print the value of sensor. I covered the sensor to obtain a reference value dor dark. Then I uncovered the LDR to get a value for light. I set the threshold between that 2 values for testing. Then the stairs run continuosly with or without simulated daylight, even when is no move in front of PIRs. Just turning on and off the stairs. When I set the useLDR to false... all is running normally. I connected the GND of atmega2560 to GND of led strips. I powered the Atmega2560 with a PSU (5v 1A) and the led strips with 5v 72A (I use 18 led strips with 144 leds each). And a second question please: how can i change the breating leds color ?

Vinz68 commented 3 years ago

Hi Andrei, starting with your last question about the breathing leds color:

About the first part; it is good to monitor the LDR values during normal operation in the serial output window during your test when lights stayed on.

AndreiBurdea commented 3 years ago

Thank you for clarification. I will try to have patience between each setting on LDR. What kind of arduino do I need for a 18 stairs x 144 leds (each) ? I see on internet discussions that one pixel needs 3 bytes of sram...

AndreiBurdea commented 1 year ago

Hi again ! Can you help me to change the color of the stair leds ? (when all turned on) Thank you !

Vinz68 commented 1 year ago

Hi, you need to change line 195: strip.Color(255, 255, 250) . Which determines the RGB colour.