Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Need help with Light Switch Design

Status
Not open for further replies.

supremo

New Member
hi, i'm new here and hope I could get some help from the experts here. I've been searching the archives but I couldn't find the circuit I was hoping to build. As a background, I wanted to use this for my Marine Aquarium to control my blue LED lights which is supposed to simulate Moonlight. Now as we all know, there is around 30 days in a lunar cycle. So what I was hoping to do is to control 14 LEDs such that everyday, 1 more LED gets lit up (waxing), keep all lit for 2 days (fullmoon) and then 1 LED less switches on which simulates the waning phase. I'm using 3VDC
LEDs which is what is commonly available here in Singapore. I have a 24hour timer which I could switch on the whole unit at night only but currently, it's full moon everynight :lol:

Can anybody give me a design or schematic?

Thanks very much.
 
This would seem to be an application for a 74LS194, bidirectional shift register. It is 4 bits so 4 would be needed. When the 14th bit is set, latch a flip-flop and reverse the direction. A 74LS198 would be nicer, but does not appear to be in production.
 
Thanks for the reply, I'll look into some sample applications of the chip.
Or if there's any other solutions out there, they're most welcome here. Or instead of lighting the LEDs in sequence I could use a dimmer function, 14 step dimming.
 
A better solution would be a twisted ring counter.

These can be made in any length, so for your purpose, you could use either four 4 bit shift registers or two 8 bit ones such as the 74LS164.

The advantage of the twisted ring counter is that it provides exactly the pattern you want. For example, here are the states of a 4 bit one.

0000
1000
1100
1110
1111
0111
0011
0001

Then back to 0000

This is one of the Gray codes. Gray codes are such that only one bit changes at a time.

To make a 14 stage one, connect the 14th output to the input of an inverter and the output of the inverter to the input of the first SR. The last output of the first SR goes to the input of the second of course.

You also need a power on reset to ensure that it starts at 0000, otherwise it may start in a trap state and step in the wrong pattern.

See the drawing (Counter-Twisted Ring.gif) in my post https://www.electro-tech-online.com/threads/electric-skateboard.8328/

Binary & Gray Codes, 12 April, 2004
Len
 
hi, was looking up on the specs of shift registers but it seems that the max wait is only 100minutes. is there a way to increase this?
 
Yet another application for a PIC!, a 16F628 has enough I/O pins to feed 14 LED's - but you may need to use driver transistors for them, depending how much current you want to feed them with.
 
supremo said:
hi, was looking up on the specs of shift registers but it seems that the max wait is only 100minutes. is there a way to increase this?

I din't understand what you mean.

What SR were you looking at?

Do you mean that it will only hold the data for <100 minutes? That is surprising.

Len
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top