LDR settings

More
3 weeks 3 days ago #11469 by khg_rap
LDR settings was created by khg_rap
Hello all,

I just finished my Arduino Uno clock and everything works as it should. I ended up installing the LDR on the rear side of the case to keep the front clean and simple. This is causing the maximum LDR reading to be about 750 in a bright room (instead of 999). I see how I can adjust the low minimum dimness, and I was wondering if there was a way to change the LDR point at which the tubes reached their maximum brightness. In other words, if the dim level is linear between 100 and 999, can I change the maximum brightness point such that the dim curve is linear between 100 and, say 750, then maintain maximum brightness between 750 and 999? I'm comfortable modifying the firmware if someone can point me to the relevant section and values?

Thanks,
KHG

Please Log in or Create an account to join the conversation.

More
3 weeks 3 days ago #11470 by khg_rap
Replied by khg_rap on topic LDR settings
Hi. I just finished building my Uno clock and everything works as it should. I ended up putting the LDR on the back side of the case. On full brightness, it's only registering about 750 (instead of 999). Is there a way for me to adjust the firmware to have the tubes reach maximum brightness at a lower LDR value?

Also, where in the firmware should I look to adjust the lowest LED setting / brightness. I'd like a very soft glow, but even at a setting of "1" it's still a bit too bright.

Thanks for the help!

-KHG

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago #11471 by Ian
Replied by Ian on topic LDR settings
The sensitivity is set by these defines in the code:

#define SENSOR_LOW_MIN 0
#define SENSOR_LOW_MAX 900
#define SENSOR_LOW_DEFAULT 100 // Dark
#define SENSOR_HIGH_MIN 0
#define SENSOR_HIGH_MAX 900
#define SENSOR_HIGH_DEFAULT 700 // Bright

If you change the SENSOR_HIGH_DEFAULT value to something lower, you can adjust the sensitivity. Note that the value is persisted to EEPROM, so you need to factory reset to make it pick up a changed value.

Let me know how it goes!

Please Log in or Create an account to join the conversation.

More
3 weeks 2 days ago #11478 by khg_rap
Replied by khg_rap on topic LDR settings
Thanks! That worked perfectly!

On my other question -- to try getting the lowest LED backlight setting even lower -- I experimented with the "rgb_backlight_curve[]" argument in the following lines (around line 950 in v57)...

analogWrite(RLed, getLEDAdjusted(rgb_backlight_curve[redCnl] / 8, 1, dimFactor));
analogWrite(GLed, getLEDAdjusted(rgb_backlight_curve[grnCnl] / 8, 1, dimFactor));
analogWrite(BLed, getLEDAdjusted(rgb_backlight_curve[bluCnl] / 8, 1, dimFactor));

I tried dividing them by 8 (arbitrary number) as noted above to get the result scaled down a bit. I didn't work as I had hoped. It seems as if there's a minimum threshold to have the LEDs illuminate, and that threshold was crossed as the "dimFactor" was adjusted. So, with a LDR reading of ~500+, the LED backlights would be on, and under ~500, the LEDs would turn off. I can see a use for this, so I may leave it set this way for a bit.

Thanks again for the quick reply! Here are some pictures of my build...







Please Log in or Create an account to join the conversation.

More
3 weeks 11 hours ago #11485 by Ian
Replied by Ian on topic LDR settings
Nice clock!

So, there is going to be a minimum you can run the LEDs at - you can easily see the steps when they are very low. The back light curve is probably needs to be more "exponential" than it is, so the steps are closer together at the very low end.

The other option is to cover the LED with some light diffusing or reducing layer. You might have more luck "going physical" on it. I'm thinking like a partially transparent plastic covering.

Please Log in or Create an account to join the conversation.

More
2 weeks 3 days ago #11517 by khg_rap
Replied by khg_rap on topic LDR settings
Thanks. I'll see if I can find a suitable material or method. Either a transparent covering as you mention, or perhaps a "lens" of sorts. Perhaps a thicker opaque material with a pin-hole allowing just a small amount of light through? Thanks again for the help. It was a fun project.

Please Log in or Create an account to join the conversation.

Moderators: AccutronTy_EeberfestIan
Time to create page: 0.177 seconds

Search

Tube Suppliers

Go to top
JSN Boot template designed by JoomlaShine.com