Daily On/Off circuit?

My 15 year old 'Garden Lamps Unit' is switched on via an LDR, 4001 Schmitt, 4013 flip-flop and a relay. And switched off by an ancient mechanical clock closing a contact which delivers a +ve going 12V pulse to the SET pin of the flip-flop, switching off the lamp around 11 pm. (BTW, intuitively I'd have expected that to be called RESET?)

But not surprisingly the clock is unreliable, its hands often sticking, so it's time to replace it with an electronic equivalent. I'm thinking of a simple RC astable (4001 or 555) followed by a divider (4022/4536.etc) set for a 24 hour period.

Even better, as my LDRs characteristics change so fast (months), I'd like to design for the high-going edge of the astable to SET the flip/flop and the low-going edge to RESET it (switching the lamp back on again. To cover the seasonal variation for switch-on time, could I set the gap between on/off via a single pot?

Haven't found one yet but I bet there's also a no-brainer IC that delivers an exact 24 hour pulse?

Terry, East Grinstead, UK

Reply to
Terry Pinnell
Loading thread data ...

You could use an ESP8266 module reading the time via your WiFi..

--Spehro Pefhany

Reply to
speff

I have devices in my home that generate a pulse exactly once a day. These pulses are 24 hours wide. They are called batteries.

All kidding aside, to get *accurate* timing you need something accurately controlled. But do you really need much accuracy?

That said, if you don't want to use a programmable device like an MCU or an FPGA/CPLD you can use some very low tech like a couple of 555 timers also known as a 556 dual.

But you didn't really need us to tell you about the 555 timer did you?

Rick C.

Reply to
gnuarm.deletethisbit

No WiFi in my shed where the garden lamp circuit is located.

Terry, East Grinstead, UK

Reply to
Terry Pinnell

Not particularly, but it would be satisfying to get within 5 mins.

No ;-)

Terry, East Grinstead, UK

Reply to
Terry Pinnell

Well, then, how about a nice FPGA with a 32.768 kHz crystal oscillator and some rather simple logic? Essentially a custom watch.

I'd have to dig around a bit for the link, but someone has a very tiny unit that can be used for lots of tasks. Connect it to a relay and Bob's your uncle!

Rick C.

Reply to
gnuarm.deletethisbit

You can run a lot of the Arduino-class microprocessors (e.g. ATMega328 or ATTiny84) at very low current. They can be run using a 32 kHz watch crystal.

In this configuration, you can spend most of the time in power-save mode, with the watch-crystal oscillator providing a wake-up timer, and the rest of the chip stopped and many parts of it powered down. Typical current drain in that mode is around 1 micro-ampere, at voltages from 3 volts down to as low as 1.8 volts.

This sort of approach ought to get you to within a few seconds a day. Run the setup from a pair of 1.5-volt-nominal lithium primary cells (e.g. Energizer Ultimate) and you'll run roughly forever.

Reply to
Dave Platt

The problem with an RC timer is the drift (temperature and time) in the R and C. Rick's suggestion of a 32.xxx kHz X-tal and counter might be your best bet. If you don't like programming uC's then there are some counting IC's that will do 2^16 or more. I've forgotten all the digital IC numbers.

George H.

Reply to
George Herold

CD4060 if you want an oscillator and divider

LM8560 if you want reasonably acurate 24 hour time keeping, but it uses the mains frequency, so no good for battery operation. it's the chip in most old LED clocks and many automatic coffee machines etc. IIRC default alarm is 23 hours after power-on. The alarm pulse is one hour long if not reset manually.

There's also abunch of TCX0 RTC chips that can do 24 hour signals, but they have serial interfaces for setup, so you'd need a micro-controller.

--
  When I tried casting out nines I made a hash of it.
Reply to
Jasen Betts

Jasen Betts wrote

There are 2 main ways to get and set time first there is radio clock, and then there is GPS. I use a GPS in this

formatting link
the GPS is switched on manually, but can just as well be switched on by the micro for say 3 minutes a day to get lock and time. Without programming ability all this is an illusion.

ebay:

formatting link
If you need a cheap DCF77 or a multimode (more expensive) depends on where you are,

GPS modules are from 14$ upwards... If you cannot write code and figure out the systems then forget it.

Reply to
<698839253X6D445TD

Or you just use a tiny, low cost, low power FPGA and a 32.768 kHz crystal and be done with it.

Rick C.

Reply to
gnuarm.deletethisbit

He could do this, minus the crystal oscillator, in a Altera MAX part. Basically a clock and two alarms (ON/OFF) Just wire it up in Quartus.

Cheers

Reply to
Martin Riddle

There are many options. A photodiode to detect sunset plus basic timer might be accurate enough.

NT

Reply to
tabbypurr

s

r.

day

ver+module&_sacat=0

ere you are,

ght be accurate enough.

I was working for a military radio manufacturer and a small circuit was nee ded to receive commands over an SPI port to control a couple of relays in a n RF section. Rather than throw an MCU at it which would require not just programming in the sense of writing code, but I/Os for programming the devi ce. I putzed about a bit and got an SSI circuit down to half a dozen very tiny chips which was about the same size as the MCU that would have been us ed. The cost was lower, the power consumption would likely have been lower , the size was the same, but they wanted it done in software. So I threw a n MCU at it and let the programmers write code to run an SPI port and switc h two I/Os. I bet that was actually a ton more work than the little SSI ci rcuit. I should have simply said, "show me the requirement for an MCU". E verything came from requirements.

Rick C.

Reply to
gnuarm.deletethisbit

Of course, a guy asking about how to build a once-a-day circuit is totally on top of RTL for FPGAs. ;)

Starting from a 32768 Hz clock, the divisor to once-per-day is

32768*86400 = 2**22 * 5**2 * 3**3 = 2**22 * 200 * 216

The old-old-school method (circa 1975) would have been to use a couple of CD4040 12-bit ripple counters as /2**11, and a third jam-loaded CD4040 dividing by 675. The third one would be a little bit tricky. You'd need to reset it on the count of 676 = 2**9 + 2**7 + 2**5 + 2**2, which needs a quad 2-input AND gate and maybe a bit of delay for luck, to make sure that the resulting self-annihilating pulse reset all sections of the counter reliably.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

32768*86400 = 2**22 * 5**2 * 3**3 = 2**11 * 2**11 * 675

Cheers

Phil Hobbs

>
--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC / Hobbs ElectroOptics 
Optics, Electro-optics, Photonics, Analog Electronics 
Briarcliff Manor NY 10510 

http://electrooptical.net 
http://hobbs-eo.com
Reply to
Phil Hobbs

:

se

g,

g
k
e

your

ting IC's that will do 2^16 or more. I've forgotten all the digital IC num bers.

That can be a lot easier than trying to wire up a ripple counter with reset . The decoding involved is a lot more complex to analyze than just saying, this many gates. Every part of the circuit is a race condition, not just the end to end timing.

I think you slipped a cog here somewhere. Shouldn't it be more like 2^22 * 25 * 27 ? Or maybe 2^16 * 200 * 216 ?

More important is to not glitch on false triggers. Async counters are terr ible for that. While the internal path is progressing, the external path i s slowed by circuit capacitance, delays through gates, etc. You can get a false trigger as easily as not completely reset the counter chain.

Rick C.

Reply to
gnuarm.deletethisbit

Why worry with all that complication ( unless it's your hobby )? Get a time switch on ebay for a couple of quid and be done.

Reply to
Rheilly Phoull

2**11 * 2**11 * 675 = 2,831,155,200

But:

2^11 * 2^11 * 625 = 2,621,440,000

However:

(2^11) * (2^11) * 675 = 2,831,155,200

Why do brackets make the difference? I understand PEMDAS, but it doesn't seem to apply here.

google is no help.

Reply to
Steve Wilson

Cause you can't type? 675 is not 625

Rick C.

Reply to
gnuarm.deletethisbit

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.