I would like to make a silent alarm which flashes an LED from 2100 hrs every evening until I press a button to reset the alarm (which could happen at any point from 2100 to 0100 so the flashing needs to remain active for as much as four hours). Would it be possible to program this DS1307 circuit to flash the light or at least turn on a flashing circuit? Or would it need a separate microcontroller? Thanks.
Edit: I note that it has something called EEPROM on it. What is that for if not to program it to do my bidding?
In a word, no. This is a real time clock module not a cpu. It is designed to give the current time (and perhaps a periodic alarm signal) via the I2C bus to a cpu and keep the current time (via the on board button cell) when the power is off that is all. The eeprom on board is for storing data that the cpu wants to keep through power cycles not for programming. The most usual way to do this would be to connect this to one of the Arduino family which uses this module to tell the time and is programmed to blink the led during the appropriate times I expect a google search will turn up a similar project on one of the arduino sites.
Thanks. However, I also read that the DS1307 has an alarm function. Would it be possible for that alarm function to trigger a thyristor to start the LED flashing? The thyristor could maybe be reset using a manual push switch. The DS1307 has a square wave output which I gather from a forum thread is not permanently switched on so maybe it is or could be related to the alarm function.
If that still isn’t possible, have you any idea what is the cheapest microcontroller I should use?
I can’t see anything about an alarm function in the DS1307 datasheet. The square wave output outputs a square wave (!) at a minimum frequency of 1 Hz, so that doesn’t help you much - you will need a microcontroller.
Microcontrollers don’t get much simpler than the PICAXE range, the 08M2 chip would do fine. For minimum hassle I would get something like this starter pack which includes the programming cable and a prototyping board, but once you’ve programmed the chip you can use it on its own - just tie its Serial In pin to ground.
The DS1307 is used in one of the PICAXE add-on boards so you should be able to get plenty of help on the PICAXE forum if you need it.
The PICAXE 08M2 is relatively expensive considering it needs a bunch of other parts to function. I can get an ESP8266 microcontroller for £1.40 and use it without an RTC or, alternatively, I can get a DS3231 module for less than £1 which definitely does have alarm functions. I can then use it’s square wave pin with a thyristor like I said earlier. You can use that pin to wake an Arduino so I don’t see why it couldn’t turn on a thyristor!
I would suggest an Arduino pro mini from ebay (around $2) you still need a wall wart to power it and (more importantly) a serial interface cable to program it if you don’t have one or can’t cobble one together but I expect that will be your cheapest option. Its hard to beat a board with reset circuit, crystal osc and programmer assembled for a couple of bucks. For me (because I have a PIC programmer) a 12f series PIC in 8 pin dip would be an option (internal oscillator) but the chip from digikey is almost as much (more with $8 shipping) than the nano from Ebay and the programmer is expensive. While you may be able to use the Ds3231, you still need a micro (at least at some point, and possibly at each power up, I haven’t ever used one in this type of application) to set the registers to start the alarm function working. I suspect the alarm function may not survive a power outage, time keeping does but I suspect all the other stuff shuts down to save power (but I’m not sure, you would have to experiment with one to see). If you can survive a power failure (or supply the mini from a cell phone charger type device using an 18650 lipo battery as a UPS again a couple of bucks on ebay) you could do without the rtc. No reason you couldn’t write code on the arduino to make your own rtc as long as you can keep it powered for long enough during a power failure for your application.
The PICAXE 08M2 doesn’t need any other parts to function once you have programmed it, and all you really need to program it is an RS232 port and two resistors - the Rev-Ed kit is just the most convenient and reliable way to get started. If you prefer a different chip, that’s completely fine.
Thanks for everyone’s responses. I found that I can get a mini or nano (?) Arduino for £1 which seems like the best solution since it’s got everything it needs and is so very cheap.