newbie guidance with a simple project

Hello everyone, I have an idea for a project, but am very much a new to the arduino world (I do have an UNO) - so I would greatly appreciate it if someone can tell me if what I have in mind is feasible and maybe a tip or two to get me started. I have done a lot of searching for very similar projects, but have not yet come up with anything.

It's very, very simple: I'd like to turn on an LED (maybe blink, maybe fade, etc.) on a certain day, at a certain time each year - the rest of the time it will be off. The twist is that I want the whole project to be as small as technically possible (think 1" small). I am wondering if I can achieve this simply by using a real time clock chip, an ATTiny chip (or any other type of tiny microcontroller), an LED, and one or two tiny button cells. What would be probably better is if there what a programmable chip around the size of an ATTiny that already had a real time clock in it...

I'd appreciate any feedback, thank you very much in advance!

Since you have a strict size limit you will rapidly be outside the normal Arduino range. You can use third-party 'cores' to program many of the ATtiny chips (I have a tube of 8-pin ATtiny85 chips I plan to use some day).

The ATtiny can keep good time (if you give it an accurate crystal) but most of the power savings come from shutting down the system clock as much as possible. If you want a fairly accurate clock you will probably want an external RTC. If you want to keep things really small you'll want to use surface-mount chips. Unfortunately those generally require custom circuit boards.

Thanks a lot John!

The clock certainly does not have to be very accurate - the LED would only have to blink on the correct day, minutes/seconds are not very important.

No matter how much accurary, what about power? Will it have mains connection + buffering or will it have battery power. If so you need to get power consumption down as much as possible. This implies sleeping the Arduino most of the time. This kind of design is pretty tricky to get done properly. I would recommend an RTC which is much simpler to deal with. The DS1307 is pretty popular. However the DS3231SN gives much better accuracy. You can get it even on populated boards like the "chronodot".

The DS3231 is a lot more accurate than the DS1307 and it also has 2x alarms that can trigger an interrupt so you could set the alarm time and then put the MPU into a deep sleep (keeping interrupts enabled though) and when the alarm time matches it would wake the MPU from it’s sleep.

this is great -thank you everyone

Yes, I'd like this to operate off of the smallest coin cell (in multiples would be OK) possible while still lasting years like a watch. So low power components - even the LED - is crucial. Maybe an N size battery would also be OK.

Yes, I've been reading about the chronodot and sparkfun's "deadon rtc" (because I like that it's square).

I will need the led to blink a couple times a year, maybe more - but on different days each year. So, based on what Riva said, maybe what I need is a RTC with LOTS of alarms. Has anyone heard of such a beast? I will keep looking, but I haven't found more than 2 on a chip so far.

Thank you so much everyone!

I will need the led to blink a couple times a year, maybe more - but on different days each year. So, based on what Riva said, maybe what I need is a RTC with LOTS of alarms. Has anyone heard of such a beast? I will keep looking, but I haven't found more than 2 on a chip so far.

You will only need one alarm. Set the alarm for first event and go to sleep, when it wakes you 'blink' then set alarm for next event and go back to sleep and so on.

Ohhhh' that's brilliant.

OK, my next post will be a parts post.

Might these be all of the parts that I'd need for this project?

ATtiny85 (program it using my UNO) AVR 8 Pin 20MHz 8K 4A/D - ATtiny85 - COM-09378 - SparkFun Electronics

DeadOn RTC

12mm 3v button cells (1 for RTC and maybe 2 or 3 for the attiny+LED) Coin Cell Battery - 12mm (CR1225) - PRT-00337 - SparkFun Electronics

3.3v LED (use only 1; not sure if I'd need a resistor or not...) LilyPad LED Micro - White (5pcs) - DEV-10753 - SparkFun Electronics

I think we are all curious about which day the LED must come on.. perhaps an " its my birthday badge for your kid/kids - various dates ? "

Astronomical events - like comet approaches.

Countdown to Dec21 2012? :smiley:

3.3v LED (use only 1; not sure if I'd need a resistor or not...)

Yes you will

I am also trying to build a dog treadmill which keeps him centered, by detecting his position using an ultrasound sensor and altering the speed of the treadmill accordingly: a) When he is centered, the speed is at a set point b) As he begins to tire and fall back, the speed of the treadmill will slow c) When he disappears from the treadmill, it will stop completely

Pls kindly advise: 1. For controlling the stepper motor, is it better to use a dedicated Stepper Motor Driver (like the EasyDriver from SaprkFun), or to drive it directly from Arduino through a transistor?

If it is the latter, is it better to use the the Stepper Motor Library , or use the analogWrite(9,ldr) PWM command or similar?

Do you think the following sketch will work? Driving stepper motor speed according to ultrasound distance


int ledPin 13; int v = 0; const int pingPin = 7; // Pin no. of the ultrasound sensor’s output Stepper myStepper(200, 8,9,10,11); // initialize the Stepper library

void setup() { Serial.begin(9600); // Initialize the Serial port pinMode(ledPin, OUTPUT); // set up the LED pin }

void loop() { long duration, inches, cm; // establish variables for duration of the ping, and the distance result in inches and centimeters

pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); // The PING))) is triggered by a HIGH pulse of >=2 ms. Give a short LOW pulse beforehand to ensure a clean HIGH pulse delayMicroseconds(2);

digitalWrite(pingPin, HIGH); delayMicroseconds(5); digitalWrite(pingPin, LOW); pinMode(pingPin, INPUT); // The same pin reads the signal from the PING))) duration = pulseIn(pingPin, HIGH); // a HIGH pulse, whose duration = time (ms) from sending of the ping to the reception of its echo off an object cm = microsecondsToCentimeters(duration); // convert the time into a distance Serial.print(cm); Serial.print(“cm”); Serial.println(); delay(100); if (cm < 50) v = v+10;
if (cm > 70) v = v-10;
if (cm > 80) v = 0;
myStepper.setSpeed(v); // set the motor speed at v RPMS }

// PING))) Datasheet : Speed of sound = 340 m/s (29ms/s) or 73.746ms/in (113’/s); /2 to get distance of obstacle.
long microsecondsToCentimeters(long microseconds) // See: { return microseconds / 29 / 2; // divide by 2 to get the distance of object }

Thanks for your kind assistance, in advance.

Sydney, Australia

Thanks for your kind assistance, in advance.

OK. Here goes. Your post has absolutely nothing to do with the thread you posted in. Don't do that again.

Thank you Riva. I’ve seen with some other super-simple setups that under certain conditions you can apparently getaway with a tiny microcontroller + an LED without using a resistor. Using one will not be a problem in my case.