Connect with us

LED strips help required

Discussion in 'LEDs and Optoelectronics' started by TheSilverFox, Apr 23, 2016.

Scroll to continue with content
  1. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    Dear Sir,
    I am hoping you can help me with a circuit, not being a professional and only an amateur.
    I have a 00 gauge model train layout. On it is a lighthouse that I have attached a couple of LED strips.
    I have a few 555 timers and carriers and was wondering what it would take to make a slow flash, similar to what a lighthouse
    would be. The strips, as can be seen via the photograph enclosed, do contain components to allow to work via
    directional 12 DC or DCC omnidirectional voltage. Hope to get a reply. Anything appreciated.
    Best Wishes,
    Lee
     

    Attached Files:

  2. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    Hello
    Do you want the lights to fad on and off also or just on and off quickly?
    Adam
     
  3. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    Thanks Adam for your reply. I would like if possible for the light to come on then fade and then on again. Hope you can help.
     
  4. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    You will most likely need a PWM circuit to do this. There are other ways but they are not so efficient.
    Adam
     
    Anon_LG likes this.
  5. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013

    Is this the sort of thing you were after?
    Adam
     
  6. Anon_LG

    Anon_LG

    453
    117
    Jun 24, 2014
    It would not give you that bright flash in the middle, but you could use a 555 astable just with a capacitor between 0V and the output. This would smooth the action. Either you could do an RC time constant calculation or you could just experiment, I recommend the latter.

    Alternatively, you can do a little more work on the aforementioned circuit. You can take the output of your capacitored astable, feed it into a comparator and use the comparator output to fully turn on a bipolar or MOSFET to make your LED fully turn on. This should have the same effect as the video.

    But PWM would be more efficient.
     
  7. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    The video would be absolutely what I'm after. Brilliant. As I am a complete novice but have done a fair bit of soldering
    what would I need in the way of components and what would be the circuit diagram? I have never heard of some of the terminology used such as bipolar or MOSFET or PWM so I apologise but I can 'Google' the terms. I would like to say I appreciate the input from some very helpful chaps. Many thanks as I will have a fantastic model of a lighthouse on the train layout with your help.
    Best Wishes.
     
  8. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    And your name is? :) Let me think about this a bit. My initial thoughts are a micro, but I may be able to come up with something else. It might take a while as I have a few things to do this weekend.
    Adam
     
  9. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    My name is Lee. :)
     
  10. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    Nice to meet you Lee :)
     
  11. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    Nice to meet you too Adam. Hope Cornwall is having a little warmer weather than here in Scunthorpe.
     
  12. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    It's a nice day, sun is out but it's still quite cold in the wind :)
    Adam
     
  13. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    Ok so I thinking to get you going I would write some software for you and base it on an Arduino board. the reason is that you can then make some changes of your own with some guidance and all you will need is a little Arduino PCB and PC. The development environment is free and you program it via USB. How do you feel about that? I will need to order a little board but that's fine I could do with a few more, all mine are being used at the moment.
    Adam
     
  14. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    That sounds alright. Not being an expert I 'googled' 'Arduino' and saw many different types and prices. The PC part I'm OK and have a very good understanding. Hopefully with your guidance should be OK. Many thanks for your expertise.
    Best Wishes,
    Lee
     
  15. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    Let me see what I can do Lee.
    Adam
     
  16. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    Hi Lee. I ordered a little Arduino Nano PCB today, should arrive in a couple of days. I'll let you know when I get it and if you still haven't found anything I'll see if I can write some code.
    Adam
     
  17. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    Thanks Adam, very much appreciated
    Best Wishes,
    Lee
     
  18. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    Hi Lee. Board arrived this morning and I managed to put something together that might work. See link to video below and the code which runs on an Arduino Nano. It's in black and white because the LED I had was blue. Hopefully it gives you a rough idea. Part of the code is in the example code called fading. You access the examples by using the Arduino IDE and once installed and running you go to File, Examples, Analog, fading. You can then modify the code or just copy and paste the code below.

    The code basically has two loops, the up and down loop. These gradually increase and decrease the PWM. The +=1 and the -=1 adjust the magnitude of steps from min to max timings, i.e. how big a jump in brightness you will get. the lower the number the smoother the fade in and out will be. The delay(10); is how quickly it cycles through the PWM up and down. Both can be changed separately.

    The delay(100) is the delay that the high output flash is on for. All delays are in ms by the way.

    At the bottom is the basic circuit I used just to quickly get something working. You will have to use a different circuit in the final design because of the extra current needed for the brighter LEDs and also to add a bit more drive to make the flash at the end a bit more noticeable.

    Hope this helps

    Adam



    Code:
    int ledPin = 9;    // LED connected to digital pin 9
     
    int ledPin_high_pulse = 10;    // LED connected to digital pin 10
     
      
    void setup() {
     
      // nothing happens in setup
     
      pinMode(ledPin_high_pulse,OUTPUT);
     
    }
     
     void loop() {
     
      // fade in from min to max in increments of 1 points:
     
      for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 1) {
     
        // sets the value (range from 0 to 255):
     
        analogWrite(ledPin, fadeValue);
     
        // wait for 10 milliseconds to see the dimming effect
     
        delay(10);
     
      }
     
     
      digitalWrite(ledPin_high_pulse,HIGH);
     
      delay(100);
     
      digitalWrite(ledPin_high_pulse,LOW);
     
     
     
      // fade out from max to min in increments of 1 points:
     
      for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 1) {
     
        // sets the value (range from 0 to 255):
     
        analogWrite(ledPin, fadeValue);
     
        // wait for 10 milliseconds to see the dimming effect
     
        delay(10);
      
      }
        
        delay(1000);
     
    }
    
    PWM LED.PNG
     
  19. TheSilverFox

    TheSilverFox

    15
    2
    Apr 23, 2016
    Many thanks Adam. I am in awe, seriously. I have never had the ability to do this sort of thing.
    Just what I required. I cannot express how grateful I am. Will load a video of finished lighthouse when completed.
    Very much appreciated.
    Very Best Wishes,
    Lee
     
  20. Arouse1973

    Arouse1973 Adam

    5,165
    1,087
    Dec 18, 2013
    No problem Lee. Let me know what LED you are going to use and I'll get to work on a circuit to drive it.
    Adam
     
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

-