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

Quote:
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):

Code:
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 
      LCDPowerOn();
      break;
    case 34:   //DJT
      LCDPowerOff();
// ... 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   Reply With Quote