The Planted Tank Forum - View Single Post - Guide: Arduino based LED controller for Current Satellite LED+
View Single Post
post #392 of (permalink) Old 11-26-2013, 04:28 AM
Tiger Muskie
Join Date: Nov 2013
Location: Colorado
Posts: 2
Method to turn off LCD at night

Originally Posted by zodduska View Post
I was looking into dimming it, I think you can use a PWM pin and some code to do it but I'm not sure how. I'm personally adding a resistor to the default hookup tonight to reign in the brightness a little.

Edit: I put a 1k ohm resistor between the backlight 5v, red wire—second from the right in my pic, it's no longer annoyingly bright. Use a higher value resistor if you want it even dimmer.
Thanks Zodduska, I also tried a few resistors found found one that gave a pleasing brightness.

Also I worked out a way to turn it on and off with alarms: I used Pin 13 as the power source for the backlight, and controlled it like this (with new "cases" for testing):

void SetAlarms()
// ... later ... 
  pinMode(13, OUTPUT); //DJT 11/25/13 for LCD screen power on and power off
  LCDPowerOn();        //DJT 11/25/13 Turn on LCD when program initializes
  Alarm.alarmRepeat(6,00,0, LCDPowerOn); 
  Alarm.alarmRepeat(7,00,0, M1Custom);
//... later ... end of day alarms
  Alarm.alarmRepeat(21,00,0, Moon2);
  Alarm.alarmRepeat(22,00,0, LCDPowerOff);
//... later ... cases for testing
    case 33:  //DJT 
    case 34:   //DJT
// ... later ... the functions:
void LCDPowerOn() //DJT
{digitalWrite(13, HIGH);}
void LCDPowerOff()  //DJT
{digitalWrite(13, LOW);}
This works so far - now my fish won't stay up all night watching the LCD!
Tiger Muskie is offline  
For the best viewing experience please update your browser to Google Chrome