GBAmp3 Mod PCB Order Now
also available at retromodding.comand Deadpan Robot
Showing posts with label timer. Show all posts
Showing posts with label timer. Show all posts

Saturday, December 18, 2010

Litmer: finished device

I took pictures of finished working device. I have removed 12v regulator from circuit because my main power changed from 14.4V power adapter to 12V lead-acid battery. So I don't need this regulator anymore. 5V regulator is still there.
Then you can see 2 capacitors near crystal, they are compensation capacitors for that crystal. DS1302 rtc clock is designed for 6pf load crystals, but I have only 12pf load crystal, that's why I place another 6pf of capacitors in parallel with crystal.
There is a led indicating when lights are on or off without pwm.

I have printed this pcb mirrored that's why I placed attiny25 and ds1302 on copper side of pcb along with smd resistors :)

Firmware code is available in my repository: code.avrnoob.com/litmer
Compilled firmware size is 2046 bytes and attiny25 have 2048 bytes of flash, so I have 2 spare bytes for some futures to add :) Actually there are still some bugs, but there are no place to fix them. Some bugs already fixed in repository.

And here are the pictures:

Litmer project pcb

Litmer project pcb

Friday, December 17, 2010

Litmer: PCB design

The project is already done actualy. The Litmer timer works now in my chicken coop controlling lights inside coop, emulating sunrise and sunset with pwm. This is how pcb design looks like. It's pretty big pcb. The biggest part is lithium backup battery with holder.
DS1302 or lithium backup battery fail while temperature is under -10C or so. While Litmer is on main power nothing fail.

Friday, December 3, 2010

Litmer: DS1302 driver done

Done with DS1302 driver. Read/Write hours/minutes/seconds functions with bcd format conversion. Take a look at the test code (not tested with actual rtc chip yet):


Take a look at the driver code in repository: code.avrnoob.com/litmer/src it is ds1302.c

Litmer: 3 wire complete

Just added a write_byte function and some minor fixes to other functions. This is the test code:




And this is how the output looks like:


Channel 1 is SCLK pin, channel 2 is RST pin, channel 3 is IO pin.

Wednesday, December 1, 2010

Litmer: read eeprom and dev environment

So I call this project a Litmer.

Just done with my dev environment, it's Makefile, some scripts for read/write fuses, read/write eeprom, program script. I'm using avrdude programmer in Ubuntu 10.10.

I've set clock with fuses to 8MHz without CKDIV8 bit. And I've set EESAVE bit for preserving EEPROM erase while burning new firmware with avrdude.

Eeprom.bytes is default EEPROM bytes (128), which I will be using for time/timer setup for rtc.

Not much done for today.

All code revisions saved with Mercurial distributed revision control tool on bitbucket.org hosting.
Take a look at the code at code.avrnoob.com/litmer.

I wrote a test program which checks if first EEPROM byte is set to 0x01 and turn on led on PB0 if it is.


Monday, November 29, 2010

Fast project time!

I need to swith lights (led strip) on and off on defined time of day. For example turn on at 8:00 and turn off at 21:00. I need to make a device till this weekend.

What I have is attiny25 mcu, ds1302 rtc chip, some transistors, mosfet for supplying power to led strip, 1 meter led strip (30 5050 white leds I guess). It would be great if I can make a pwm so lights can slowly turn on to full brightness and then slowly turn off till fully off, by slowly I mean 5-15 minutes ore even more.

For power I have a 14.4V power supply. I need 12V for led strip, 5V for mcu and rtc chip, 3.3V battery backup for rtc, I'm going to use 3V lithium battery for that with holder taken from dead pc motherboard. So for power I should use 7805 regulator for 5V, LM317T ajusted for 12V.

For switching I could use some 5-6V rated relay, but I guess it's not good for pwm, so I chose F5305L mosfet (actually I have no relays anyway). This is maybe an overhead for 1 meter led strip which takes 0.6A at 12V but it's first I found in my parts bin.

Here is a first circuit:

Firmware day tomorrow.