Dimmer mod for icetubeclock
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- daveparker
- Posts: 10
- Joined: Sat Jan 03, 2009 11:46 pm
Dimmer mod for icetubeclock
I made use of the hax0r expansion port (R4 and the two holes next to the speaker) to add a dimmer to my Ice Tube Clock. A modified version of the Sept 30th firmware is available here .... use at your own risk etc....
The dimmer's operation is pretty simple. If the room is pretty dark, the display is at minimum brightness. If the room is light, the display is at the brightness set by the user. There is a menu option to turn the dimmer on and off. For extra credit I could add some sort of sensitivity option to the menu or but I figured I would start simple and see how well it works. If you need to adjust the sensitivity, there is a constant DIMMER_THRESHOLD in iv.h. The dimmer checks the room's brightness every second. It is turned off while the clock is running on battery backup. The dimmer is disabled while in the set brightness menu.
The hardware is just a 10K resistor in the R4 position and a CdS photocell in the sensor position. My photocell's resistence varied between ~0 Ohms in sunlight and around 11K in the dark.
The dimmer's operation is pretty simple. If the room is pretty dark, the display is at minimum brightness. If the room is light, the display is at the brightness set by the user. There is a menu option to turn the dimmer on and off. For extra credit I could add some sort of sensitivity option to the menu or but I figured I would start simple and see how well it works. If you need to adjust the sensitivity, there is a constant DIMMER_THRESHOLD in iv.h. The dimmer checks the room's brightness every second. It is turned off while the clock is running on battery backup. The dimmer is disabled while in the set brightness menu.
The hardware is just a 10K resistor in the R4 position and a CdS photocell in the sensor position. My photocell's resistence varied between ~0 Ohms in sunlight and around 11K in the dark.
-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Dimmer mod for icetubeclock
yay! great work there, i'll try this out 

- schnee72
- Posts: 46
- Joined: Fri Sep 04, 2009 7:40 pm
Re: Dimmer mod for icetubeclock
Thanks a lot for the information, I just finished my clock and I am off to do this mod now.
- len17
- Posts: 394
- Joined: Sat Mar 14, 2009 7:20 pm
Re: Dimmer mod for icetubeclock
Great! I've been planning to do this, just didn't know if someone else would do the hard work before my kit arrives. 

- daveparker
- Posts: 10
- Joined: Sat Jan 03, 2009 11:46 pm
Re: Dimmer mod for icetubeclock
Oh, I forgot to mention that the modified firmware also removes the leading '0' in the time if the region is set to the US (so 2:34 instead of 02:34). The leading '0' bugged me so I changed it. Gotta love open source projects! 
Incidentally: As someone who is just learning the in's and out's of gcc-avr I found looking through the firmware code quite educational. There is code to make use of the serial port, an example of using pin change interrupts to detect button presses, and how to switch to battery backup. Great stuff. Thanks Limor!

Incidentally: As someone who is just learning the in's and out's of gcc-avr I found looking through the firmware code quite educational. There is code to make use of the serial port, an example of using pin change interrupts to detect button presses, and how to switch to battery backup. Great stuff. Thanks Limor!
-
- Posts: 25
- Joined: Sun Nov 23, 2008 4:33 pm
Re: Dimmer mod for icetubeclock
Freaking awesome!! I was just about to go buy a USBtinyISP just so I could start tinkering with my clock... unfortunately it looks like Adafruit is out of em' at the moment... bummer, now I'm gonna have to wait a week!! 

-
- Posts: 12151
- Joined: Thu Apr 06, 2006 4:21 pm
Re: Dimmer mod for icetubeclock
we'll have more usbtinys tomorrow. we sold out today! 

- schnee72
- Posts: 46
- Joined: Fri Sep 04, 2009 7:40 pm
Re: Dimmer mod for icetubeclock
The dimmer mod works great. I adjusted the DIMMER_THRESHOLD to 225 because it was kicking in when the room wasn't that dark. Thanks again for the great information and the firmware changes.
- caitsith2
- Posts: 217
- Joined: Thu Jan 18, 2007 11:21 pm
Re: Dimmer mod for icetubeclock
Located a photocell/10K resistor. As a result, now implemented my test mode in with the dimmer code.
Test mode is entered by holding menu and +. 3 beeps are made to confirm entry.
Menu makes a low beep, and advances the display through one segment at a time.\
Set makes a low-med beep, and turns dimmer mode on.
+ makes a med beep, and tuns dimmer mode off.
When Dimmer mode is on, darkening/brightning the room makes a med-hi beep. Twice if dark, once if light. This confirms photo cell is working. When it is off, it has no effect.
Alarm switch makes the highest beep, once if set off, twice if on.
Holding menu and + while in test mode, for 5 seconds, exits test mode.
Test mode is entered by holding menu and +. 3 beeps are made to confirm entry.
Menu makes a low beep, and advances the display through one segment at a time.\
Set makes a low-med beep, and turns dimmer mode on.
+ makes a med beep, and tuns dimmer mode off.
When Dimmer mode is on, darkening/brightning the room makes a med-hi beep. Twice if dark, once if light. This confirms photo cell is working. When it is off, it has no effect.
Alarm switch makes the highest beep, once if set off, twice if on.
Holding menu and + while in test mode, for 5 seconds, exits test mode.
- Attachments
-
- icetube-fw.zip
- Test mode including dimmer.
- (29.3 KiB) Downloaded 366 times
- len17
- Posts: 394
- Joined: Sat Mar 14, 2009 7:20 pm
Re: Dimmer mod for icetubeclock
I've got my own version of this up & running, with continuously variable brightness instead of two brightness levels. I'll post my changes after some more testing & cleanup.
- len17
- Posts: 394
- Joined: Sat Mar 14, 2009 7:20 pm
Re: Dimmer mod for icetubeclock
Here's my version of Ice Tube firmware with auto-dimming. It's based on daveparker's version, but with some differences:
- CdS photocell is the one from the Adafruit store and R4 is 1kΩ. This is a combo I've used before and it gives a good range of values between dim room light and sunlight.
- Instead of switching between dim & bright, the display brightness varies continuously based on the ambient light.
- Auto-dimming is turned on by selecting "au" (automatic) in the brightness menu.
- I've also incorporated BANNED's button interrupt fix.
- Also I changed the "9" digit so it looks like every other 7-segment display I've ever seen.
- Added features can be enabled separately at compile time. Look at the top of iv.h.
- Attachments
-
- IceTube.lmp.25.10.2009.zip
- (29.28 KiB) Downloaded 418 times
- caitsith2
- Posts: 217
- Joined: Thu Jan 18, 2007 11:21 pm
Re: Dimmer mod for icetubeclock
And my features incorporated into it.
[*]Daylight Saving Time
[*]Test Mode
Additionally, Ladyada's set snooze timer feature was turned into an optional define along with the above two features.
[*]Daylight Saving Time
[*]Test Mode
Additionally, Ladyada's set snooze timer feature was turned into an optional define along with the above two features.
- Attachments
-
- icetube-fw.zip
- (32.28 KiB) Downloaded 352 times
- schnee72
- Posts: 46
- Joined: Fri Sep 04, 2009 7:40 pm
Re: Dimmer mod for icetubeclock
Thanks for all the mods!
- len17
- Posts: 394
- Joined: Sat Mar 14, 2009 7:20 pm
Re: Dimmer mod for icetubeclock
Wow, that was quick!BANNED wrote:And my features incorporated into it.

- daveparker
- Posts: 10
- Joined: Sat Jan 03, 2009 11:46 pm
Re: Dimmer mod for icetubeclock
Sweet! The constantly varying dimmer seems to work pretty well.... and it doesn't have the threshold value to fiddle with like the original code did.
So what's next? I'm thinking of making it display tweets.
So what's next? I'm thinking of making it display tweets.

Please be positive and constructive with your questions and comments.