# Need help in LED controlling

1. ## Need help in LED controlling

dear all

i want to control 10 leds using a switch
the switch may be spst or dpdt or any switch,
we can use any switch

the condition is
* only ten switch we have to use
* one switch for each one led

if switch on one switch corresponding led will glow, and if we switch on other switch corresponding led have to glow if we switch on third switch means all the led will be off...

maximum two led will be in on position, if we switch on third led all should go off...

by using switch only we have to control
* micro controller should not use.

kindly give me your valuable suggestions and ideas...

thanks and regards
kavin

2. ## Re: Need help in LED controlling

Hi,

What switches, what LEDs, what supply, voltages and currents....

Klaus

•

3. ## Re: Need help in LED controlling

A further question:
Do you want to do this using logic or an analog solution. If all the LEDs draw the same current there is a very simple way to detect a third being switched on by looking at the current they draw.

Brian.

4. ## Re: Need help in LED controlling

Originally Posted by betwixt
If all the LEDs draw the same current there is a very simple way to detect a third being switched on by looking at the current they draw
Speak and show, Brian... What are your ideas? :)

I'd thought logic too, needs a lot of thinking through to avoid clashes/undesired triggering, I think. I briefly looked at paralleled NANDs feeding into more NANDs and desisted as current sensing and summing amplifier(s) into a comparator with a reference controlling a PMOS switch seemed like an easier solution...

I got this far and then left the idea as a) The post sounds like you can only use switches to achieve the objective and it seemed wiser to wait for further info from the poster; b) Not enthused with idea of limiting it to one quad op amp (to limit parts count) as it makes the maths a cumbersome task (summing three, three, three, then four...); c) It's easier with 5 summing amps feeding into a 6th summing non-inverting; d) today not a superb day to sit down for a long period and do the gain maths and simulating over and over to get the right summing gains for it to work in foolproof manner.

This is a very, very preliminary rough draft so there a lot of mistakes in resistor values (but do still laugh freely at how not good it is)... and maybe it's just a bad basic idea.

5. ## Re: Need help in LED controlling

I'm not laughing - honest.

If kavin_eees will allow an analog solution it is very simple: add a series resistor to the whole feed to all the LEDs. The voltage drop across it will be proportional to the number of LEDs drawing current. If the limit reaches 3 x LED current, simply cut the supply and they all go out! It can be done with one comparator and a few resistors.

An 'any two out of n' logic approach is more complicated and better suited to software but there are several ways to do it with logic gates. For example, the simplest is a LUT with valid and invalid combinations produced from parallel inputs from the switches. Arrays of XOR gates using the 'one but not two inputs high' can be used and even cascaded parity generators will work. A further but rather complicated solution can be to use adders and simply sum the number of inputs together. A logic table would be a good place to start regardless of the solution.

Yet another rather simple solution as no supply has been mentioned it to wire all the LEDs in series and bypass each of them with a switch. If the supply voltage is greater then 2 *Vf but less then 3* Vf, only two can light up when their switch is open. Opening a third drops the available voltage need to light more LEDS. That is a one component solution - just a resistor to limit the LED current! I rather suspct the LEDS wouldn't completely go out with three switches open though, there may be some residual current.

Brian.

1 members found this post helpful.

6. ## Re: Need help in LED controlling

dear all
let me clear the idea of the concept

*consider 24v ac solenoid valves of 10 nos
*we have to operate these 10 solenoid valves using ten Toggle switch / Rocker switch
* The Toggle / Rocker switch may be SPST / DPDT
*but we wont use any gate ic
* maximum two solenoid valves can operate at a time
* if we switch on the third solenoid valve means all the valves should be off...

7. ## Re: Need help in LED controlling

Hi,

you try to confuse us:
* first there are LEDs --> then there are solenoids.. Why?
* "no microcontroller use" --> "no gate IC use"

The rest of your post is still repeating post #1 requirements.

d123 even made some effort to draw a schematic for you. Where is your effort? You didnīt even comment it.

Klaus

8. ## Re: Need help in LED controlling

hi d123
in this we should not use any gate ic /....

- - - Updated - - -

hi klaus
for easily understanding only i told its LED but the concept is Solenoid Valves...
* in this we wont use microcontroller / any gate ic..

9. ## Re: Need help in LED controlling

24V AC solenoids is a whole different ball game to 1.6V DC LEDS.

I can't see any method using the switches alone and it seems all digital techniques are banned so it has to be an analog solution. There is a way to do it that keeps AC out of the equation and therefore makes it simpler: The solenoids are powered at one end, have the NO switch contact at the other and the common contact goes to the AC return which for sake of argument we will call ground. That leaves the NC switch contact available for monitoring purposes, either open or grounded. With a resistor from each switch to summing node and a DC current supply it makes a voltage summing circuit in which the voltage is proportional to the number of switches opened (solenoid in operation) at any time. A simple comparator can check against a threshold and cut the supply if the voltage is between 0.2 and 0.3 or higher of the range.

Brian.

•

10. ## Re: Need help in LED controlling

Hi,

for easily understanding only i told its LED but the concept is Solenoid Valves...
To me personally it makes no sense.
I donīt see why "LEDs" is more easy to understand than "solenoids".
and if LEDs are more easy, why do you make it more complicated now by using solenoids?

I still ask myself why you donīt give the requested informations.

***
You donīt want a "gate IC" but in my eyes an OPAMP is no gate IC.

Next time someone provides a solution with a BJT, then you say you donīt want a BJT, then now resistor ... then no....

--> first give clear, useful and complete informations, show your own effort ... then there will be a lot of people helping you

Klaus

•

11. ## Re: Need help in LED controlling

hi betwit

i ill share my final views here once its finished...
thanks a lot for all your ideas,

12. ## Re: Need help in LED controlling

I am not good at analog circuit designing but I designed this circuit. Only one Solenoid (Lamp) Circuit connected to Switch 1 (1) is shown. You need 9 more such circuits and all the 10x A connections connect to Master TRIAC or SSR. If Master SSR is sued then no need for Master MOC3021. I guess same applied for other MOC3021's if say 240V AC 10 or 20A SSRs are used.

More experience analog circuit designers can simplify my circuit. I had to use TRIACs or SSRs because the OPs solenoid's are AC type.

Update 1.1 not tested fully.

In 1.1 if SSRs are used instead of all TRIACs then all MOC3021s can be ommitted.

In my Proteus MCP6001 model was not working fine. It was giving Gmin stepping error and so I have used MCP6002. In hardware you can use MCP6001. I have good experience in using Rail to Rail op-amps and so have used them in my designs. More experienced analog circuit designers can simplify my circuit using general purpose op-amp and reduce the cost of it.

13. ## Re: Need help in LED controlling

The schematics in post #12 are the method I proposed but there is no need to use a ground side resistor for each switch, they are all in parallel so they can be replaced by a single one. R21 can be left out as well. A comparator instead of an op-amp will work better. I'm not sure why so many regulators when the load current is only a few mA anyway, if the intention is to spread the heat (there shouldn't be any) they would need capacitors between them to ground. In any case, if a half wave rectifier is used instead of a bridge, the AC return can be used as ground to save using double pole changeover switches.

Brian.

14. ## Re: Need help in LED controlling

What is your solenoids current rating ? I have assumed it to be 5A per solenoid. Only two solenoids will be ON at a time and so total current is 10A. I don't know what current solenoid draws during switching. Maybe 7A ?

If yes, then you need a 240V AC Primary and say 24V AC 15A secondary transformer. If solenoid current rating is less (in mA) then use TRIACs with MOC3021 only.

@betwixt

Yes, I didn't calculated the low voltage current passing through voltage regulators. I first thought using just one 78L05 regulator but was worried about dropping 32V to 5V and heat dissipated by regulator and hence used successive regulators to get 5V.

It was a rough circuit and hence I had not added capacitors in regulator circuits.

I will simplify it more according to you method and clean up the circuit.

I am getting only 15V AC across 24V load. Why ? I should get 24V AC across load (lamp).

Are you telling that I have to replace all 10k resistors in switch circuit with one 10k resistor ? That didn't work for me.

15. ## Re: Need help in LED controlling

Hi,

wow, a lot of effort, baileychic.
(sadly I fear the OP has new requirements...)

I am getting only 15V AC across 24V load. Why ? I should get 24V AC across load (lamp).
I assume: R19 isnīt correctly calculated

Are you telling that I have to replace all 10k resistors in switch circuit with one 10k resistor ? That didn't work for me.
Please verify it again. 1k = 10 x 10k in parallel. The simulation should show the same result.

BTW: for the switches you used the "unregulated" 32V. But this voltage depends on a lot of parameters (mains voltage, load current, transformer impedance...), this may cause problems. You simply can avoid problems by using the regulated 24V or 12V.

Klaus

16. ## Re: Need help in LED controlling

@Klaus

I simplified the circuit but still getting only 20V across load (solenoid / lamp) for 100R. Even if I use 56R in MOC3021's output side circuit I still get 20V AC only across load. It is not further increasing upto 24V AC.

R46 is 200R 2W.

12V to 13V input to LM78L05.

SVC1.5 had some resistor values not named properly in switch circuit. I have fixed it in SVC1.6. Consider SVC1.6 circuit.

Edit:

In SVC1.6 change R23 to 100R.

17. ## Re: Need help in LED controlling

Hi,

but still getting only 20V across load
The value is "true RMS"?
Use a scope to check amplitude and waveform.

If the amplitude drops, it is cause by the drop in the triac.
If the zerocross_to_switchON_delay is too high, itīs the gate control.

Klaus

18. ## Re: Need help in LED controlling

I'm confused as ever, it gets easier to to confuse me as time goes by.....

What do all those triacs do?
If my original proposal is followed, the switches turn the solenoid on, there is no triac to each solenoid. Full voltage is applied to the solenoids.

S1-10 are the solenoids, R1-10 are one resistor per solenoid, all meeting together at the comparator, SW1-10 are the single pole change-over switches.
Ref could be a potentiometer to set the detection threshold.

Brian.

•

19. ## Re: Need help in LED controlling

Maybe it is some other problem as mentioned in this document. Triac switching at 13V ?

Used 33R as mentioned in above doc for triac output side circuits. Still 21V across load.

- - - Updated - - -

@betwixt

Explain the working of your circuit. How many relays or optos it have ? 1 ?

How do you turn ON individual solenoids with one relay or opto ?

Do you have 10x SPDT switches ? The main single 12V relay cuts of the 24V power supply if more than three switches not connected to op-amp circuit ?

20. ## Re: Need help in LED controlling

Explain the working of your circuit. How many relays or optos it have ?
Only one opto if a single triac is needed to cut the supply -or- one relay to do the same thing.
How do you turn ON individual solenoids with one relay or opto ?
The solenoids are turned on by the switches themselves, there is no control circuit to the solenoids.
Do you have 10x SPDT switches ? The main single 12V relay cuts of the 24V power supply if more than three switches not connected to op-amp circuit ?
Yes, the original specification calls for 10 switches. I did not show how to turn off the main supply, it can be by one triac or a relay. Relay is easiest.

Look at the switches in my schematic, in one position the solenoid is energized but the resistor is isolated, in the other position the solenoid has no power but the resistor is grounded. There is one switch and one resistor per solenoid, the input to the comparator sees a voltage proportional to the 10K pull-up and the number of switches opened or closed. The voltage rises as any solenoid it turned on so the comparator can tell if more than two are activated.

Brian.

--[[ ]]--