Simple, electronic, 24 hr timer - Page 1
Forum section: electronics / beginners

author: soldar
author_rank: Super Contributor
timestamp: October 26, 2023, 08:44:14 am
content: I have a bunch of lights each on a 24 hr timer, those simple, mechanical ones that have a round face that turns once every 24 hrs. I need them to turn of at, say, midnight and turn on any time between 6 and 12 hrs earlier, this is flexible and does not really matter. In other words, a 24 hr timer with a duty cycle between 25% and 50% with, say, 33% being ideal.The cheap mechanical ones are working fine for me but I was wondering if there might be a simpler electronic solution so that I can get the timer out of the electric outlet and out of the way. The electronic equivalent of a cam wheel that turns once in 24 hrs.I cannot think of anything but maybe someone will have some idea.

author: radiolistener
author_rank: Super Contributor
timestamp: October 26, 2023, 08:50:30 am
content: I think the simple and cheap solution is to use some STM32 blue pill board. Also there is STM8 boards which even cheaper than STM32 blue pill, they have much less resources, but it is good enough to implement what you want, it also allows to add some display and buttons for monitoring state nad configuration, but you can do it through serial port from PC

author: Psi
author_rank: Super Contributor
timestamp: October 26, 2023, 09:26:36 am
content: You can get 8 channel opto-isolated mains relay PCBs pretty cheap.But it does mean doing mains wiring and putting everything safely in a nice enclosure.

author: BeBuLamar
author_rank: Super Contributor
timestamp: October 26, 2023, 10:11:08 am
content: I don't know what you mean by out of the outlet. How can you power the light without outlet? For an electronic solution I would use a PLC. Why? because that what I use often for a lot of stuff.

author: SmallCog
author_rank: Frequent Contributor
timestamp: October 26, 2023, 10:24:31 am
content: Given you want to go to some effort I’m assuming it’s a permanent thing?You could get your electrician to put a proper industrial timer in your breaker board to switch your outlets rather than use a cheap plug in thing“Din rail timer” should give you a bunch of results in your favourite search engine

author: soldar
author_rank: Super Contributor
timestamp: October 26, 2023, 11:36:46 am
content: Thanks all for your posts but none seem simpler than what I already have.I have thought of one other aspect I had not thought of. With the mechanical timers if the power fails for 10 mins then the timer is running 10 mins late, which is not of much importance, and can be reset easily. With an electronic timer I would need to have a battery to ensure the timer keeps going when the power fails.

author: BeBuLamar
author_rank: Super Contributor
timestamp: October 26, 2023, 11:42:29 am
content: Yes using your mechanical timers is the simplest. I can't think of anything that can do the same with fewer parts count.

author: coromonadalix
author_rank: Super Contributor
timestamp: October 26, 2023, 11:49:45 am
content: you have electronic timers on Ali Fleabay etc ... some does a 24H period, some can do a week,some people are hacking their internal supply, to include a backup battery with a diode in serial or super capacitor to maintain the clock running ??some duino projects can do this too

author: Kleinstein
author_rank: Super Contributor
timestamp: October 26, 2023, 02:57:07 pm
content: There are also electronic versions with a small LCD display, a frew bottons with a similar function as the simple mechanical one. The programming is still more intuitive with the old mechanical style.

author: Terry Bites
author_rank: Super Contributor
timestamp: October 26, 2023, 03:59:21 pm
content: Most modern time swtiches will give you 6 or more periods per day. Comonly 16!It will cost far more to make than to buy. $3 on aliexpress.Most of them have battery backup as standard, no worries there.Search for "Programmable Timer Switch"

author: themadhippy
author_rank: Super Contributor
timestamp: October 26, 2023, 05:03:57 pm
content: QuoteNot if you use one that has a battery back up,or the old clockwork samangos that a small motor to wind themselves up

author: SmallCog
author_rank: Frequent Contributor
timestamp: October 26, 2023, 09:45:23 pm
content: If you want to stay with a plug in option then this is the digital style others referred to above.They have a battery in them to maintain their clock and aren't affected by power outagesYou can set them to do the same thing every day, or you can set them to do different things on different dayshttps://www.bunnings.com.au/click-24hr-7-day-digital-timer_p0255500

author: AG6QR
author_rank: Frequent Contributor
timestamp: October 26, 2023, 10:06:54 pm
content: If you have a WiFi network at home, there are many inexpensive switched outlets that use an ESP32 chip to control a relay that can switch a device on and off. These are typically marketed for use with some proprietary cloud provider, but you can easily reflash them to run the free open source Tasmota firmware. You can set it up to set its time using NTP, so it keeps correct time even after power failures. You can connect to the device via a web interface and program it to have various timed on/off events. It can also be set to go on or off at sunrise or sunset. You can have different schedules on different days of the week.A starting point ishttps://tasmota.github.ioAs you might expect, searching YouTube for "tasmota" will show a bewildering array of videos to explain various ways of getting started.There are many things you can do with things like MQTT so that devices can communicate with each other and orchestrate complex behaviors in reaction to various sensor inputs. But just turning lights on and off via a 24 hour schedule is really easy, and requires only a one-time setup via a web interface.

author: Smokey
author_rank: Super Contributor
timestamp: October 26, 2023, 10:10:20 pm
content: Ya, go home automation wireless.

author: soldar
author_rank: Super Contributor
timestamp: October 27, 2023, 07:10:55 am
content: Again, thanks to all but I am looking for something simpler than what I already have.I already have those timers installed and working. I have both types, the mechanical ones and the electronic ones. They are plugged into an outlet and the cable to the light is plugged into the timer. They do the job but I was just thinking maybe there was some tiny device which could be inserted in the cable itself and would do the switching. Something the size of a matchbox or very slightly bigger. That way it would just be dangling on the cable and not taking up space at the outlet.No need for several timing periods. Only one on, one off in 24 hrs. On at 4 (or 6) pm then off at midnight.Probably what I am using now is the simplest and cheapest even though it can do more than I need.And for further clarification. The timer turns on at say 5pm but the light has a dusk LDR sensor so the light turns on at dusk and turns off at midnight. I do not reset the timer for summer time so in summer it turns on at 6 and turns off at 1 am. But the lights always turn on at dusk so the turn on time does not matter.

author: EPAIII
author_rank: Super Contributor
timestamp: October 27, 2023, 09:22:58 am
content: They make all sorts of timers to cycle the lights in an unoccupied house to deter burglars.https://www.google.com/search?client=firefox-b-1-d&q=light+timer+for+empty+houseAnd then there's timers for watering your lawn.https://www.google.com/search?q=timer+for+sprinkler&client=firefox-b-1-d&sca_esv=577090324&sxsrf=AM9HkKkmiygYhQtW74pbHZDwWyjRF85oiQ%3A1698392466757&ei=kmk7Zc_XLfG5qtsPp7W6oAU&oq=timer+for+sprink&gs_lp=Egxnd3Mtd2l6LXNlcnAiEHRpbWVyIGZvciBzcHJpbmsqAggAMggQABiKBRiRAjIIEAAYigUYkQIyBRAAGIAEMgYQABgWGB4yCBAAGBYYHhgPMgYQABgWGB4yBhAAGBYYHjIGEAAYFhgeMgYQABgWGB4yBhAAGBYYHki0XFD8CVjdSXABeAGQAQCYAcQCoAGTG6oBCTEyLjE0LjIuMbgBAcgBAPgBAcICChAAGEcY1gQYsAPCAgQQIxgnwgIIEAAYigUYhgPCAgoQABiABBgUGIcC4gMEGAAgQYgGAZAGCA&sclient=gws-wiz-serp#ip=1I had one when I lived in Florida and used well water for the lawn. But mine was based on an electric clock and it had a wheel with keys that could be pushed in or pulled out. They were in positions that represented 10 or 15 minute intervals (I can't recall exactly which) and you programmed a week's watering with them. But today they seem to be electronic. Not sure if that is better or worse.Oh, and some would do a two week cycle. That was handy when the powers that be declared a water shortage and insisted on watering on odd or even days. Mine only did one week and I had to reset it every week when that happened. As my Florida neighbor always said, "It's always something. Always something!"

author: BeBuLamar
author_rank: Super Contributor
timestamp: October 27, 2023, 09:42:51 am
content: You said you have more than 1 light but do all lights turn on and off at the same time?

author: soldar
author_rank: Super Contributor
timestamp: October 27, 2023, 10:58:15 am
content: Quote from: BeBuLamar on October 27, 2023, 09:42:51 amEach light has its own timer on its own outlet and I program them roughly to turn off at midnight but it does not really matter. And each one has its own dusk LDR switch that turns it on at dusk which does not happen at exactly the same time for all.

author: BeBuLamar
author_rank: Super Contributor
timestamp: October 27, 2023, 11:46:30 am
content: If you want all of them on and off at the same time you can use just 1 timer for all of them.

author: donlisms
author_rank: Frequent Contributor
timestamp: October 27, 2023, 02:23:58 pm
content: If the real problem is space at the outlet, I think I'd be looking for some little six inch extension cords or something like that. Could be you're trying to solve the wrong problem!

author: BeBuLamar
author_rank: Super Contributor
timestamp: October 27, 2023, 02:34:52 pm
content: That is what I think. If the op wants all the lights on and off at the same time he can use one timer on an outlet and then plug a 6 outlets power strip into the timer outlet.

author: soldar
author_rank: Super Contributor
timestamp: October 27, 2023, 02:50:34 pm
content: I think I have explained the situation well enough. Everything is working fine as it is with the timers I already have. From the timer the cord goes to an LCD dusk switch which is like the size of a matchbox and I thought it would be nice if the timer could be integrated in the cord in the same way. That is all.Since we do not seem to be able to find such a device then the best option is to leave things as they are.

author: AG6QR
author_rank: Frequent Contributor
timestamp: October 27, 2023, 03:52:04 pm
content: Quote from: soldar on October 27, 2023, 02:50:34 pmIt sounds to me like you're looking for the Sonoff BasicR2 module.https://sonoff.tech/product/diy-smart-switches/basicr2/I have several of these in my home, wired into extension cords, or into IEC-320-C7 cords (used for supplying AC mains power to phone chargers and laptop power supplies, among other things). I've flashed them with the open source Tasmota firmware I described earlier in this thread.It does switching at dawn or dusk if you like, or at a fixed time, or at a random offset from a fixed time (to make it look less like the light is machine-controlled). You can even switch at a random offset from dawn or dusk, or a fixed offset from dawn or dusk. For example, you could make a light go on at 12 minutes before dusk, +/- 20 minutes, and turn off exactly at midnight. I don't know why you'd want to do precisely that, but you can do it if you want to.Time is maintained by NTP, and when you tell it your time zone, switching between summer/winter time is automatically handled. Time stays synchronized within a fraction of a second, and it is quickly re-synchronized after power failures. Dusk and dawn are calculated based on your latitude and longitude (which you enter via the web interface), combined with the NTP time. There is no connection to any cloud, so you aren't giving any information to outsiders.

author: soldar
author_rank: Super Contributor
timestamp: October 27, 2023, 04:10:33 pm
content: Quote from: AG6QR on October 27, 2023, 03:52:04 pmThanks but that is overkill for what I need. And I do not know if it is the case in this case but many, most, of those devices are powered by a capacitive dropper and are only for 120V whereas I have 230V. I have modified some in the past by changing the dropping capacitor but I rather not. In any case, those look like interesting devices and I will be having a closer look. Thanks.