Can someone help a complete amateur with LED fading effect please? :-)

Discussion in 'The Projects Forum' started by Vlk, Apr 17, 2015.

  1. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    Hi folks!

    I just started a little project - a thing I need to do in order to finish up a gift for my fiancee. The problem is, I am totally new to electronics. :) I've never build a single thing and all my electronic experience starts and ends with charging up my phone or my camera... :-D
    So all these circuit plans I found on the web are really fun and nice, but I am very lost in them, although I can imagine they are as clear and simple as they can get.
    I found exactly the thing I need on Youtube:

    However, I started this project with exactly the same components needed for this project: http://www.instructables.com/id/LED-Cube-Night-Light/?ALLSTEPS

    Since I will be building something quite similar (it will be a small box), I need all the components to be quite small and 12v battery is not exactly the smallest and lightest.

    So my goal is to build fade in and fade out LED effect. Slow fade in, when the switch is pressed and slow fade out, when the switch is pressed once again. All this with 3x LEDs (LED 5mm blue; 40?; 2300 mcd; 3,3 V; 20 mA) and 2x CR2032 3V batteries (I might add up one more if it will be needed).
    Now I can see there is solution and I almost came to understand it, but I simply don't have enough engineering brain cells to grasp it completely. :-D I know I need capacitor, I need some resistors etc. But which kind of capacitor to fit my batteries and LEDs? Which kind of resistors? And when I will have all that, in which order to tangle them together? The Instructables project I linked above is easily understandable for me, because it is nicely visual. I am really quite lost in the circuit plans... And I know, I could go back to my high school years and try and learn it, but I don't really have tons of time to do it, since birthday of my fiancee is drawing near.

    Could please anyone help me with this and give me directions of what I should do? It would be really greatly appreciated!

    Have a great day guys!
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    First, welcome and kudos for having done your research before posting. It makes it a lot easier to get going and it's a rare commodity around here.

    So you want the light to fade in and then stay on until the button is pressed again? That makes it a bit more complicated than the example you found. Still doable, just another thing to work out. You need a flip-flop that changes from low to high with each button press.

    How much room do we have?

    Also, how much concern do you have about battery life? Those button cells don't have a lot of energy. They'd be fine for the intermittent use I think you need, but not for a flashlight.
     
    Dibubba likes this.
  3. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    Hi wayneh! Thank you very much for your reply! :) I am always doing a research when I seek to learn something, but this time I was really lost even after quite some time which I spent to figure it all out. I am a creative kind of guy, so all the technical things goes a little bit around me. :)
    Yes, exactly! What I want is that the LED's (all three at once) will slowly fade in once the switch is pressed and stay in the normal volume of light. And then again, when the switch is pressed once more, to make the LED's slowly fade off.

    Do you mean room in terms of time? I have to finish this in less than 3 weeks (4.5. it the deadline :) ).

    I think I don't need high power life. It won't be something that will be shining for hours, more like seconds to minutes and quite infrequently. :) It will be like a box to store nice little things (for example jewelery) and this will be there just for effect. :) So definitely something that will be turned on quite rarely. Do you think those CR2032 will be enough for my cause?
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    No, I was thinking about the space that everything needs to fit within.
    Yes, I think they'll be fine.
     
  5. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    I haven't worked up any details but what I'm thinking of is based off of what was linked. Eliminate R2, and replace the switch with the output of a flip-flop. The timing of the fades would depend on R1 and C1. I think there may be a better way to arrange Q1, R3 and the LED load, but we can get to that later.

    One thing I'm not quite sure how to handle is the "off" state of the flip-flop circuit. You obviously want a very low current when the circuit is not doing anything, to extend battery life. I'm not sure the answer is in Bill's Blog, but you should go read some of that.


    ledfadeinfadeout_1292750501.png

    That guy's "Circuit #2" does solve some of the problems of this very simple circuit, at the cost of higher complexity.
     
    Last edited: Apr 17, 2015
  6. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    Hehe, sorry, I don't know why I thought about time. :) Well, since I will be crafting the box myself, I will customize it's size according to the circuit, but smaller the better of course. :)
    Thank you very much that you brainstorm about how this could work! What is flip-flop by the way?
    I am really sorry and quite ashamed to say that, but I don't understand the Bill's Blog you've linked. :-( This is kind of where I got stuck earlier. I am sure it has to do with the fact that I am not a native speaker and combined with the fact that I am so so bad at all science stuff (I was literally failing at school, almost haven't passed the year because of mathematics, chemistry, physics and all these classes. Thank goodness for all the nice teachers I had...), it makes this all really hard for me to comprehend. I mean, looking at the circuit plan, I suggest that R1 is resistor and C1 is capacitor and I might imagine how to connect it all together, but this is pretty much where it ends for me...

    The tutorial from Instructables was really easy for me to fathom, because as I said, it is visual and let's say "dumbed-down" - stick this to there and tangle this around this and so... :-D Even the circuit plan is much more understandable for me.

    I don't want to sound stupid, it just doesn't go through me for some reason. :-( Physics and mathematics are really my weakest spot of all. Well, I picked the right project huh? :-D

    But above all that, I am really sure I can do this - I've done so many things before and I see this challenge as no different from the others. I am quite skilful when it comes to "hand-made" stuff - I think that is a good starting point at least. :)

    I know it must be annoying, but this why I came here - to get some "have you tried to turn it on and off" kind of advice, as I am a far away from my regular field of activity. And I don't really know to where else to turn, as in all the electronic's shops I tried to ask in looked at me with slight disgust and didn't help me at all. :-D
     
  7. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    Instead of a flip flop or equivalent circuit, consider an electromechanical solution. If you have time to order one.

    The trick is to remember the previous state of the pushbutton and toggle it. A latching SPST switch does that and is a drop in replacement for the pushbutton switch in the simple circuit. I found one on Mouser at
    http://www.mouser.com/ds/2/315/EVP-AJ_Datasheet.pdf-203156.pdf
     
    wayneh likes this.
  8. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    Excellent point, the switch IS the flip-flop.

    The circuit found by Vlk, that does the right thing, is from here. We can use a toggling switch for S1.

    The "off" current thru D1, R4 and Q2 is a question mark.
    ledfadeinfadeout_1292754841.png
     
  9. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    Thank you for your replies! I definitely have the time to get new parts for the circuit - there is shop with pretty much everything in my town, so I can get there by bus any time.
    I bought this switch for the project: http://www.gmelectronic.com/p-b1720d-smd-p630-12 - because it has this long button which can go through the wood of the box and it will be nicely hidden inside. Just the tip of the button would be visible from outside. But I guess this switch is not really suitable for what am I trying to achieve right?
    I was trying to find the switch you are refering to on the web of the local shop but I was unable to find something similar. It is weird, because this shop always had what I searched for. Maybe I am looking into a different section as I am unsure how this switch works. Is it like a switch which moves from side to side and stays where you currently move it? Maybe something like this? http://www.gmelectronic.com/p-esp101-p631-263

    So basically the circuit plan I linked works for me, but I just need to get a different switch and I suppose different resistors and capacitors, as I won't be working with 12V batteries?
     
  10. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    Yes, some thought about the components will be required for operation at a lower voltage. The capacitor doesn't matter so much because you can compensate for a wide range of values using different resistors, which are cheaper and easier to find. So see what the shop has that is close, and go from there.
     
  11. cirep

    New Member

    Apr 17, 2015
    15
    0
    Hi to you all,
    i was wondering if microcontrollers of the PIC types can be used on an old AKAI receiver to handle switching of the inputs.The original push to make switch is out of service and it is really a problem for selection of a source.The sound from such an old equipment is simply stunning and i want to give it a chance again to charm my ears a few years more.Any advice on how to tackle this project is welcomed
     
  12. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    No, it is a pushbutton switch. You press it once and it completes the circuit. Press it again and it opens the circuit. Also known as a push on push off, or mom on mom off. This is how you described the desired operation in an earlier post.
     
  13. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    This is known as hijacking someone else's thread. You should start your own.
     
  14. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    So something that is close to the linked PCBHeavens circuit plans? Can you please give me hint of which kind of resistors, capacitors and transistor should I get for the 2x3V batteries? I am not sure what kind of specifications should I watch while looking for these components. Or should I just get some and try different parts and choose which works best?
     
  15. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    So the switch I bought is the good one after all? I think that it works exactly this way. Or is it more like something like this http://www.gmelectronic.com/p-sw201-blue-p624-225 ?
     
  16. wayneh

    Expert

    Sep 9, 2010
    12,127
    3,048
    The capacitor, diodes and transistors can be as shown or replaced with similar parts as available.

    If you want to use 6V, you'll need to put the LEDs in parallel as in the Instructable, not in series as in the schematic above. But unlike the Instructable, each LED should have its own current-limiting resistor, even if it's just 10Ω. The Instructable seems to get away without it by relying on the internal resistance of the batteries, but it's not a robust design in my opinion. So there should be three R7s.

    To calculate the resistor, it's all about Ohm's law, V=I•R.
     
  17. cirep

    New Member

    Apr 17, 2015
    15
    0
    Ok,im a bit confused by all these postings.may be old age creeping in.believe it or not it's my first time on a forum and i'm a little lost.my excuses for the mistake.
     
  18. Vlk

    Thread Starter New Member

    Apr 17, 2015
    26
    0
    Ok, so to sum this up, I will follow this plan, except for the fact that I will have a different switch (will the one I bought work or should I get a different one?), diodes connected in the same way as in the Instructables plans and resistors and capacitors will be basically the same as from the plans bellow, so something like the following:

    Resistors: http://www.gmelectronic.com/ru-2r7-0207-0-25w-5-p119-280

    Capacitor: http://www.gmelectronic.com/ce-470u-10vt-jam-tk-6-3x11-rm2-5-bulk-p123-724 (I chose here the one with U=10 V, because I noticed that the PCBHeaven plan has 25 V, which is like double of the power of his 2x 12 V batteries, so maybe I need a capacitor with lower U?) Or something like this might be better? http://www.gmelectronic.com/ce-1500u-6-3vit-hit-exr-8x16-rm3-5-bulk-p123-667 It has a 3 times higher UF number, not sure if it something I want or don't want.

    Transistor: Found this one with lower V, might it be suitable for my cause? http://www.gmelectronic.com/2sc1417-p215-457

    Switch: I bought this one: http://www.gmelectronic.com/p-b1720d-smd-p630-125 Is this one not suitable? Should I get something like this instead? http://www.gmelectronic.com/p-esp101-p631-263

    Sorry for asking so many questions, I just want to be sure I am doing the right thing and there are so many types of resistors, capacitors and transistors and I am really lost in all those numbers (not sure if I did the right thing, looking for lower voltage parts, it just felt like the right thing, since I won't be working with 60 V etc.). I tried to calculate the resistors, but I don't know how to know my current and my resistance... Ehm, I know, I am horrible... :-(

    [​IMG]
     
  19. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    You have the supply voltage. Let's call it VS and pretend it is 12 VDC. Then, the LEDs have a forward voltage and a current rating. Let's say the VF is 2.5 VDC and the current is 10mA (or 0.01A). I am making these numbers up for this example. And you have three LEDs in series. The current limiting resistor R = V/I or

    R = (VS-3*VF/I). <-- voltage to drop after LEDs
    Or (12VDC-3*2.5)/0.01A <-- putting in your numbers
    Or 4.5vdc/0.01A = 4,500 ohms

    Remember, this is only an example. Your numbers will be different. Most of the information needed will come from the LED specs.
     
  20. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    That switch will work electrically, although it's not the type I envisioned. If it works operationally for you, then that's all that counts.
     
Loading...