Connect with us

Flickering flame simulation with PIR motion sensor - mostly need help with transistor, I think

Discussion in 'Sensors and Actuators' started by seanspotatobusiness, Apr 4, 2016.

Scroll to continue with content
  1. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    Well slap my head and call me Sally! I didn't realise that was how it worked!

    This also doesn't make sense though! Now when I increase the voltage to the base of the transistor, the LEDs get dimmer. That's the opposite of what it should be?

    [​IMG]
     
    Last edited: Apr 5, 2016
  2. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
  3. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    You only have 1 transistor, there's simply not enough current flowing, add 2 transistors like in the schematic i posted, copy the darlington pair
     
  4. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    But it doesn't make sense - a low voltage means a smaller current yet the LEDs are lighting up more. It's backwards!
     
  5. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    What does not make sense?
     
  6. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    In this screenshot, when I lowered the voltage to the base of the transistor, the LEDs light up more instead of less. That makes no sense!:
    [​IMG]
     
  7. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    That's because lower the voltage the less saturated and less current flows from base to emitter allowing more current to flow from collector to emitter...

    EveryCircuit is a good learning aid

    (Limit the current via a 1k resistor to base)
     
  8. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    Oh I see. I was not aware of this either.

    I made a modification to your circuit which you can see here: http://everycircuit.com/circuit/6111272301494272 - I added a resistor to make the capacitor charge more slowly but it does not affect the speed that the LED turns on. Can you tell why?

    Edit: Actually it works but needs a really big resistor, like 2 Mohm.
     
  9. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    Here's my circuit which uses a lower voltage to represent the PIR output. It's 2.6 V after 0.7 V drops on the diodes. The problem is that the light takes about six seconds to start coming on and once it starts, it's at full brightness in about a second.

    Also, do you know how different the Every Circuit transistors are from 2N2222s? Thanks again.

    http://everycircuit.com/circuit/4523679919112192
     
  10. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    If I keep the capacitor precharged using a potential divider on the 6 V supply then I can eliminate the lag before lighting occurs. It means that the fade off takes quite a bit longer but that's acceptable to me. Do you think it's a stupid idea? http://everycircuit.com/circuit/6450830268432384
     
  11. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Better to take a screenshot, make your circuit public, so others can help you, from my mobile i can't view your circuit as it loads the browser version
     
  12. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    Sorry about that. I thought the circuits would be shareable across platforms.

    The second switch on this circuit is just to reset it without having to wait for the slow fade. The first switch simulates the PIR sensor circuit.

    [​IMG]



    When I add more sets of LEDs in parallel, the current gets shared across them and they don't get very bright.

    [​IMG]
     
    Last edited: Apr 6, 2016
  13. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Make the circuit public, i'll load it up and take a look, your usernane is the same as here?

    (@cjdelphi into the search box to find my circuits)

    I'll modify it to make it do what you need
     
  14. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Yeah the circuits are shareable, but android launches the browser and not the app (he needs an intent filter)
     
  15. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Found your circuit, let me take a look!
     
  16. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    The good news is i redesigned your circuit to do what you asked

    The bad news, unless you switch to two leds in series to reduce the voltage drop, you're simply not going to get the current needed for 20ma

    So i used a higher voltage, will that be a problem?


    If so you can only use 2 leds in series per row, up to you....

    Screenshot_2016-04-06-14-48-04.png

    http://everycircuit.com/circuit/5336705198981120
     
    Last edited: Apr 6, 2016
    seanspotatobusiness likes this.
  17. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    Thanks a lot, cjdelphi! The voltage increase is fine - I can just get a different power supply or, the one I'm thinking of getting lets you set it at various voltages including 6, 7.5 and 9.

    Can you tell me whether 2N2222 or BC337 is suitable for the NPN transistors? And what about the PNP transistor?

    Does the transistor arrangement you used have a name (like the Darlington pair) so I can maybe read a bit more about it?

    Thanks again!
     
  18. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    2n2222/bc337 is fine

    Any pnp that is capable of total current is ok as well

    Only the 2 npns out of emitter into base are in a darlington configuration...

    I don't think it has a name for what i did in the circuit
     
  19. seanspotatobusiness

    seanspotatobusiness

    193
    4
    Sep 11, 2012
    I added an extra transistor to increase the current I could get through more strings of LEDs. I will probably use 15-18 LEDs. I just need to order the PNP transistor and I'll be set. Thanks again. I'll post some videos in a few weeks if I get it working.

    Edit: Damn, I just noticed that adding that extra transistor causes it to switch on almost instantly and take way longer to turn off. Adding a resistor has at least slowed down the fading on, albeit increasing the time to fade off.
     
    Last edited: Apr 8, 2016
  20. cjdelphi

    cjdelphi

    1,096
    104
    Oct 26, 2011
    Welcome to the world of electronics lol
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-