Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Dimmer mod for icetubeclock
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Dimmer mod for icetubeclock

by daveparker on Thu Oct 08, 2009 6:26 pm

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.

IMG_0819.jpg
IMG_0819.jpg (99.22 KiB) Viewed 9734 times
daveparker
 
Posts: 10
Joined: Sat Jan 03, 2009 11:46 pm
Location: San Francisco

Re: Dimmer mod for icetubeclock

by adafruit on Thu Oct 08, 2009 6:47 pm

yay! great work there, i'll try this out :)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Dimmer mod for icetubeclock

by schnee72 on Thu Oct 08, 2009 6:48 pm

Thanks a lot for the information, I just finished my clock and I am off to do this mod now.

schnee72
 
Posts: 46
Joined: Fri Sep 04, 2009 7:40 pm

Re: Dimmer mod for icetubeclock

by len17 on Thu Oct 08, 2009 6:59 pm

Great! I've been planning to do this, just didn't know if someone else would do the hard work before my kit arrives. :)

len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: Dimmer mod for icetubeclock

by daveparker on Thu Oct 08, 2009 8:20 pm

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!
daveparker
 
Posts: 10
Joined: Sat Jan 03, 2009 11:46 pm
Location: San Francisco

Re: Dimmer mod for icetubeclock

by mos6502 on Thu Oct 08, 2009 11:52 pm

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!! :cry:
mos6502
 
Posts: 25
Joined: Sun Nov 23, 2008 4:33 pm

Re: Dimmer mod for icetubeclock

by adafruit on Fri Oct 09, 2009 12:22 am

we'll have more usbtinys tomorrow. we sold out today! :(

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Re: Dimmer mod for icetubeclock

by schnee72 on Fri Oct 09, 2009 2:02 am

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.

schnee72
 
Posts: 46
Joined: Fri Sep 04, 2009 7:40 pm

Re: Dimmer mod for icetubeclock

by caitsith2 on Mon Oct 12, 2009 2:56 am

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.
Attachments
icetube-fw.zip
Test mode including dimmer.
(29.3 KiB) Downloaded 356 times

caitsith2
 
Posts: 217
Joined: Thu Jan 18, 2007 11:21 pm

Re: Dimmer mod for icetubeclock

by len17 on Sat Oct 24, 2009 9:24 pm

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

by len17 on Tue Oct 27, 2009 8:10 pm

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 caitsith2'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.
Compiled firmware and source code are attached.
Attachments
IceTube.lmp.25.10.2009.zip
(29.28 KiB) Downloaded 407 times

len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: Dimmer mod for icetubeclock

by caitsith2 on Tue Oct 27, 2009 10:13 pm

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.
Attachments
icetube-fw.zip
(32.28 KiB) Downloaded 348 times

caitsith2
 
Posts: 217
Joined: Thu Jan 18, 2007 11:21 pm

Re: Dimmer mod for icetubeclock

by schnee72 on Tue Oct 27, 2009 10:39 pm

Thanks for all the mods!

schnee72
 
Posts: 46
Joined: Fri Sep 04, 2009 7:40 pm

Re: Dimmer mod for icetubeclock

by len17 on Tue Oct 27, 2009 10:52 pm

caitsith2 wrote:And my features incorporated into it.

Wow, that was quick! :)

len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Re: Dimmer mod for icetubeclock

by daveparker on Wed Oct 28, 2009 2:52 am

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. :)
daveparker
 
Posts: 10
Joined: Sat Jan 03, 2009 11:46 pm
Location: San Francisco

Please be positive and constructive with your questions and comments.