Author Topic: Timer to turn on based on time of day  (Read 849 times)

warlock

  • Newbie
  • *
  • Posts: 3
Timer to turn on based on time of day
« on: April 29, 2016, 10:35:39 am »
HI,  really new to this whole thing.. my son and I are migrating from our 200-1 experiment kit and snap circuits to this world.
We have picked up a few digispark dev with the tiny85.

We decided for our first project to modify a feeder we have.
I was looking at this project http://digistump.com/board/index.php/topic,68.msg422.html#msg422

i'm familiar with the basics of the RTC being able to independently keep time, but I'm wondering if the digi can do that on its own?

Basically the feeder uses a light sensor w/ delay to activate the feeder for a preset time (based on a switch setting) then turn off.
It does it at sunrise and sunset.

We want to change that to basically activate by two preset times (but flexible enough to expand to more than two times a day)
I was thinking to start get the digi to turn on the LED based on time presets.   Then go from there.

I'm not sure where to start.  So my first question is.

Can the digi keep time without an RTC?

Thanks. (I'll update this if I find a solution in the meantime.)

Cheers

warlock

  • Newbie
  • *
  • Posts: 3
Re: Timer to turn on based on time of day
« Reply #1 on: April 30, 2016, 05:16:03 am »
Ok so I did some research.  First I found this library.

http://playground.arduino.cc/Code/Time

I also pulled the datasheet for the atmel ATtiny processor (this one covers a couple iterations of the chip 25/45/85)

http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf

It would appear that this chip has internal oscillators which will allow it to keep time.  I now know I need to try and code this in software... gulp.

SO I dropped the time in the /libraries/ folder and have the instructions from the playground website.  I'm still not entirely sure what I'm doing and I have yet to get to actually writing anything yet.. but work continues.. I think my next move is to try and code a time and get the device to report the time to me... hmmm.. but how do I know if its actually tracking time.. how to we get feedback....  :-\  (I'll just have to set alarms and see if it triggers them at the right time.. like turning on my LED at a specified time)