+ Post New Thread
Page 1 of 2 1 2 LastLast
Results 1 to 20 of 24
  1. #1
    Member level 2
    Points: 1,613, Level: 9
    Achievements:
    7 years registered

    Join Date
    May 2012
    Posts
    51
    Helped
    2 / 2
    Points
    1,613
    Level
    9

    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. #2
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    Re: Need help in LED controlling

    Hi,

    what about a truth table?

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

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  3. #3
    Super Moderator
    Points: 82,046, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,458
    Helped
    4488 / 4488
    Points
    82,046
    Level
    69

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  4. #4
    Advanced Member level 5
    Points: 9,792, Level: 23
    d123's Avatar
    Join Date
    Jun 2015
    Posts
    1,726
    Helped
    402 / 402
    Points
    9,792
    Level
    23

    Re: Need help in LED controlling

    Quote Originally Posted by betwixt View Post
    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.

    Click image for larger version. 

Name:	10 SWITCH 3 LED OFF.JPG 
Views:	12 
Size:	103.0 KB 
ID:	150777



  5. #5
    Super Moderator
    Points: 82,046, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,458
    Helped
    4488 / 4488
    Points
    82,046
    Level
    69

    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.
    Last edited by betwixt; 15th January 2019 at 22:44. Reason: further thoughts...
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  6. #6
    Member level 2
    Points: 1,613, Level: 9
    Achievements:
    7 years registered

    Join Date
    May 2012
    Posts
    51
    Helped
    2 / 2
    Points
    1,613
    Level
    9

    Re: Need help in LED controlling

    dear all
    thanks for your reply
    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. #7
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    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.

    Did you answer one of your questions / requests?

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

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  8. #8
    Member level 2
    Points: 1,613, Level: 9
    Achievements:
    7 years registered

    Join Date
    May 2012
    Posts
    51
    Helped
    2 / 2
    Points
    1,613
    Level
    9

    Re: Need help in LED controlling

    hi d123
    thanks for your reply
    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. #9
    Super Moderator
    Points: 82,046, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,458
    Helped
    4488 / 4488
    Points
    82,046
    Level
    69

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



    •   AltAdvertisement

        
       

  10. #10
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    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
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Member level 2
    Points: 1,613, Level: 9
    Achievements:
    7 years registered

    Join Date
    May 2012
    Posts
    51
    Helped
    2 / 2
    Points
    1,613
    Level
    9

    Re: Need help in LED controlling

    hi betwit

    i agree with your points, and thanks for sharing your views..
    i ill share my final views here once its finished...
    thanks a lot for all your ideas,



  12. #12
    Advanced Member level 2
    Points: 3,310, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    658
    Helped
    50 / 50
    Points
    3,310
    Level
    13

    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.
    Last edited by baileychic; 18th January 2019 at 09:28.



  13. #13
    Super Moderator
    Points: 82,046, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,458
    Helped
    4488 / 4488
    Points
    82,046
    Level
    69

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  14. #14
    Advanced Member level 2
    Points: 3,310, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    658
    Helped
    50 / 50
    Points
    3,310
    Level
    13

    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.
    Last edited by baileychic; 18th January 2019 at 10:04.



  15. #15
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    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
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  16. #16
    Advanced Member level 2
    Points: 3,310, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    658
    Helped
    50 / 50
    Points
    3,310
    Level
    13

    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.
    Last edited by baileychic; 18th January 2019 at 11:35.



  17. #17
    Super Moderator
    Points: 79,246, Level: 68
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,081
    Helped
    3643 / 3643
    Points
    79,246
    Level
    68

    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
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  18. #18
    Super Moderator
    Points: 82,046, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,458
    Helped
    4488 / 4488
    Points
    82,046
    Level
    69

    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.
    Click image for larger version. 

Name:	20190118_103819a.jpg 
Views:	7 
Size:	17.1 KB 
ID:	150821
    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



  19. #19
    Advanced Member level 2
    Points: 3,310, Level: 13
    baileychic's Avatar
    Join Date
    Aug 2017
    Posts
    658
    Helped
    50 / 50
    Points
    3,310
    Level
    13

    Re: Need help in LED controlling

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

    https://www.uploadarchief.net/files/download/gate_r.pdf

    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 ?



    •   AltAdvertisement

        
       

  20. #20
    Super Moderator
    Points: 82,046, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,458
    Helped
    4488 / 4488
    Points
    82,046
    Level
    69

    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.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.



--[[ ]]--