You're reading ...
Hardware, Project Progress

RGB LED Strip Control with Arduino and DCC

The RGB LED strip that is mounted above my layout (see this post) can be controlled via the remote. I thought it would also be nice when it can be controlled via the Traincontroller PC user interface, or via the command station.

The Arduino came to the rescue. It has 6 PWM outputs via which we can control the LED strips using nMOSFET’s to switch the 12V power.

RMR049With those 6 PWM outputs we can control either:
– 2 RGB LED strips
– 1 RGB and 3 one-color strips
– 6 one-color strips
Often a combination of a RGB strip with a (warm) white strip is used, this can perfectly be controlled with one Arduino.

The Arduino RGB_LED_Control software is available as a free download. It is included in the Arduino DCC / S88 software package which can be found on the Download page.

The software offers 3 modes of operation:
– Individual channel control. The intensity of each of the 6 channels can independently be increased or decreased.
– Selection of a preset. A preset is combination of 6 PWM outputs (0-255), a transition time (max 64 s) to gradually fade to the new preset color and a hold time (max 255 s) for use with the sequencer.
– Sequencer. Of the sequencer is switched on, it steps through the presets, using the per preset configured transition time and the hold times.

The software offers 3 options for control:
– The PC keyboard (via the Arduino Serial Interface)
– Digital inputs (connected e.g. to push buttons)
– DCC commands

A User Manual is included in the download. It explains the hardware needed and how to configure and to operate the software.

 

 

..

About RudyB

Hobbyist

Discussion

14 thoughts on “RGB LED Strip Control with Arduino and DCC

  1. Hi Rudy,

    When 10 meter of ledstrips is not enough.
    Is it possible to connect the end of the ledstrips to another mosfet print, with own power supply to be bron to an other 10 meter of ledstrips?
    So every module from our modulebaan is it the same time, every where dark, or day or evening…

    Thanks for your answer.

    Richard, nighttrain1 from BNLS.

    Like

    Posted by Richard | April 20, 2019, 11:27
    • First of all I doubt if 10m will have an even light output over the entire length … probably it’ll get darker the further away you are from the power feed point. Possible solution is to connect the power output of FET at multiple points along the length of the strip. If more current is going to be drawn than the specification of the FET allows, then it is very well possible to use a second (and third and … ) FET module, connected to the same Arduino output pin, to feed another strip. Color and light output may vary from strip to strip though.

      Like

      Posted by RudyB | April 20, 2019, 11:43
  2. Hi Rudy,

    Just a quick question about these led strips. Would this process work with a 24v RGBW strip? I quite like the sound of the rgbw strips and the 24v would suit me more due to needing 10+m of a strip.

    Cheers

    Like

    Posted by michaelhenfrey | March 27, 2016, 14:51
    • Yes, no problem … as long as the MOSFET’s you use can handle the voltage, the whole schematics stays exactly the same.

      Like

      Posted by RudyB | March 27, 2016, 16:06
      • cool thanks, I think I get what I need to do. Have you managed or think it’s possible to have it programed into train controller to allow you to have a day/night cycle that could then be linked to turning on and off accessory lighting on the layout?

        Like

        Posted by michaelhenfrey | April 26, 2016, 17:08
      • Yes, DCC control is already included in the software.

        Like

        Posted by RudyB | April 26, 2016, 21:24
  3. Hi Rudy,

    Thanks for sharing the program,

    1) What I notice from your program is you have used “pin A2 (=16)” and “pin A3 (=17)” from which I am able see only A2 and A3 on Arduino Uno board So when i write the program how will I define the pins Post A1,A2, A3 and A4 ?
    accessory[1].outputPin = 16; //solenoid 1 connection at pin A2 (=16)
    accessory[1].outputPin2 = 17; // solenoid 2 connection at pin A3 (=17)

    2) To control 25 PL-11 point motor do I need to make the circuit for each board or 1 circuit will take care of rest of the Ardiuno boards.(The schematics needed to get DCC signal into the Arduino pin 2 is also available on the Software page.)

    3) Since I will be using a separate power supply for PL-11 point motor Please let me know which color wire needs to be connected to I/O pins of Arduino Uno and which wire will be connected to laptop adapter output for powering PL-11 point motor.(Please share the schematics for the same)

    Like

    Posted by Viken | February 22, 2016, 07:22
    • Pins A0-A5 can be used as analog inputs. We use them as outputs, they can be named either A0-A5 or 14-19 … it’s the same.

      Theoretical just one optocoupler circuit is needed, which can be fed to pin 2 of all Arduino’s. The Arduino’s are mounted as close as possible to clusters of points they control. If this means they are separated over long distances it is advised to use more than one optocoupler circuit, closer to one or more Arduino’s. You coulf first try one,mwith long wires. If all works ok without problems you’re fine. If there is uncontrolled behavior, add an optocouples closer by.

      For wire colors you can use any color you find pleasant to the eyes. đŸ™‚ The GND of the point motor supply must he connected to the GND of the Arduino power supply. The FET switches are in between, according to the given schematic.

      Like

      Posted by RudyB | February 22, 2016, 09:23
  4. Hi Rudy,

    Request you to please help me for the below queries.

    1) I have a layout which has 25 points and I like would like to use PL-11 point motor using Arduino
    2) Can I use Arduino MEGA 2560 for switching the PL-11 point motor, if yes then how many point motor it will support, if not then which Arduino board can I use and how many Arduino board I need for the same
    3) Would it be possible for you to help me in writing the program which will help me in switching the points
    4) My layout is a DCC layout so is it possible to switch points using my DCC controller (I am using Roco Multimaus dcc controller) via connecting to Arduino
    5) I would be needing circuit diagram for connecting DCC controller to Arduino board, wiring of PL-11 point motor, wiring of Arduino board output which will help in switching the point

    Like

    Posted by Viken | February 18, 2016, 09:09
    • Personally I would use multiple Ardiino Uno’s. The software has proven to work with that. One Uno can control 8 PL-11 point motors. The PL-11 is a solenoid drive, it needs to be pulse switched using a power source that delivers enough current, using FET’s between the Arduino and the PL-11. The Arduino drives the FET gate, the source and drain switch the PL-11 current. The software you need is the ‘DCC solenoid’ sketch, which is included in the download package on the Software page. Pulse switch time can be set in the software. The schematics needed to get DCC signal into the Arduino pin 2 is also available on the Software page.

      Like

      Posted by RudyB | February 18, 2016, 18:59
      • Hi Rudy, Thanks a lot for quick response!!
        1) Since Ardiino Uno’s can control up to 8 PL-11 point motors then I would be needing 4 boards to control 25 PL-11 point motors, Please help me with schematic diagram showing connection between Arduino, FET and PL-11 point motors.
        2) In ‘DCC solenoid’ sketch

        accessory[0].address = 1; // DCC address for this accessory
        accessory[0].durationMilli = 250; //Duration of pulse in ms
        accessory[0].outputPin = 12; //solenoid 1 connection
        accessory[0].outputPin2 = 13; // solenoid 2 connection

        I am not clear with the above, point #2 so request you to please clarify more on this in terms of working. How can i switch between 1 point motor to another for e.g I switch point motor 10 and then i want to switch point motor 9 ? what needs to press on the DCC controller ?

        Like

        Posted by Viken | February 19, 2016, 10:52
      • The circuit to switch a high power device: http://bildr.org/2012/03/rfp30n06le-arduino/

        For every point motor you need to copy and confugure these 4 lines (don’t forget to increment the number [n]. The address is the DCC address you want this point to use.

        accessory[0].address = 1; // DCC address for this accessory
        accessory[0].durationMilli = 250; //Duration of pulse in ms
        accessory[0].outputPin = 14; //solenoid 1 connection at pin A0 (=14)
        accessory[0].outputPin2 = 15; // solenoid 2 connection at pin A1 (=15)

        accessory[1].address = 2; // DCC address for this accessory
        accessory[1].durationMilli = 250; //Duration of pulse in ms
        accessory[1].outputPin = 16; //solenoid 1 connection at pin A2 (=16)
        accessory[1].outputPin2 = 17; // solenoid 2 connection at pin A3 (=17)

        Like

        Posted by RudyB | February 19, 2016, 13:34
  5. Hi Rudy

    Request you to please help me for the below queries.

    1) I have a layout which has 25 points and I like would like to use PL-11 point motor using Arduino
    2) Can I use Arduino MEGA 2560 for switching the PL-11 point motor, if yes then how many point motor it will support, if not then which Arduino board can I use and how many Arduino board I need for the same
    3) Would it be possible for you to help me in writing the program which will help me in switching the points
    4) My layout is a DCC layout so is it possible to switch points using my DCC controller (I am using Roco Multimaus dcc controller) via connecting to Arduino
    5) I would be needing circuit diagram for connecting DCC controller to Arduino board, wiring of PL-11 point motor, wiring of Arduino board output which will help in switching the point

    Like

    Posted by Viken | February 18, 2016, 09:09
  6. You are an amazing man, this is the best web site I have found. Thank you so much for you efforts and generosity.
    Michael

    Like

    Posted by Michael Armstrong | February 4, 2016, 00:08

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Archive of all posts

Categories

%d bloggers like this: