Adamphillip Posted September 4, 2019 Share Posted September 4, 2019 so me and a friend were looking at using an arduino for doing a lighting set up that cycles through day and night with 8 channels of control via relays for the woodland scenics lighting hubs, this way we can have street lights that come on at the correct times and shop/house lights that turn on and off. Is there any way to make a program for a computer than can update the arduino to make it easier to use for getting the correct colour of light? something with sliders or a GUI to make setting the times on each out put easier. Link to post Share on other sites More sharing options...
AMJ Posted September 4, 2019 Share Posted September 4, 2019 If you have a look at TinkerCAD there you can prototype your circuit and also create and test the program. See the TinkerCAD/Arduino topic I created the other day. It would be feasible to have certain outputs dedicated to certain lights and there are code samples also for if you want to change inputs and what will happen. https://www.tinkercad.com/ It is also an ideal way to share your circuits and any program that is associated with it. Have a look at the simple samples for inspiration of things that could be done by "bolting together" different ideas. 2 Link to post Share on other sites More sharing options...
Theakerr Posted September 4, 2019 Share Posted September 4, 2019 Several questions. Are the woodland Scenics LEDs or bulbs? Are the relays part of the Woodland package or will you be getting your own? Do you mean brightness or colour tone (wavelength)? Do you want the light to fade in and out or on and off?. Basically controlling relays on/off is pretty easy if you use 5V power, i.e. direct from the Arduino. Arduino friendly relays are pretty cheap from China. You can use 12V relays but that complicates the set up a bit. Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted September 4, 2019 RMweb Premium Share Posted September 4, 2019 Any reason not to use dcc to control the lighting? Link to post Share on other sites More sharing options...
Adamphillip Posted September 4, 2019 Author Share Posted September 4, 2019 20 minutes ago, Theakerr said: Several questions. Are the woodland Scenics LEDs or bulbs? Are the relays part of the Woodland package or will you be getting your own? Do you mean brightness or colour tone (wavelength)? Do you want the light to fade in and out or on and off?. Basically controlling relays on/off is pretty easy if you use 5V power, i.e. direct from the Arduino. Arduino friendly relays are pretty cheap from China. You can use 12V relays but that complicates the set up a bit. If you look at the Woodland Scenic's hubs they have a control port that takes a switch but if you replace that with a relay the arduino can switch the just plug lights. Also I'm planning to use an individually addressable RGB strip for the 'sky lighting' Link to post Share on other sites More sharing options...
Adamphillip Posted September 4, 2019 Author Share Posted September 4, 2019 1 minute ago, melmerby said: Any reason not to use dcc to control the lighting? how and with what? I want to do full RGB lighting for the sky/sun/moon and then have other things turn on in sequence with the day cycle 1 Link to post Share on other sites More sharing options...
Robin2 Posted September 4, 2019 Share Posted September 4, 2019 9 hours ago, Adamphillip said: Is there any way to make a program for a computer than can update the arduino to make it easier to use for getting the correct colour of light? something with sliders or a GUI to make setting the times on each out put easier. Any PC program that can communicate over a Serial port (i.e. 99% of them) can send messages to an Arduino to tell it what to do. However writing a GUI program is not trivial if you have no experience. And if the only purpose is for a one-off adjustment of settings I suspect it would take more time to develop the GUI program than it to adjust the settings using the Arduino Serial Monitor to enter values. ...R Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted September 4, 2019 RMweb Premium Share Posted September 4, 2019 2 hours ago, Adamphillip said: how and with what? I want to do full RGB lighting for the sky/sun/moon and then have other things turn on in sequence with the day cycle 1) Something like this for a start: (High end kit!) https://www.opendcc.de/elektronik/opendecoder/opendecoder_sw_dmx_e.html DMX is a standard for lighting control 2) Or maybe this: (More basic) Arduino as DCC accessory decoder with the outputs controlling lighting, say Mosfets fed by PWM to get the varying brightness. If you have a computer control program you could then have lighting controlled by the clock, which could be in real time or a set time or speeded up. e.g. 0600 sunlight slowly increases, 1800 sunlight slowly fades. etc. Link to post Share on other sites More sharing options...
Nigelcliffe Posted September 5, 2019 Share Posted September 5, 2019 11 hours ago, Adamphillip said: how and with what? I want to do full RGB lighting for the sky/sun/moon and then have other things turn on in sequence with the day cycle I suggest a short diversion into the addressable LED strips which are available (start by looking up "neopixels"). With those, its a three-wire connection (12v, ground and data signal). The processor, an Arduino will do it, can set the RGB of any individual addressable "pixel" (typically a group of three RGB LEDs on an addressable strip) to any value at any time. Strips of addressable LEDs are not massively different in price to the plain RGB strips where there are three inputs (all reds, all blues, all greens). Moving out from the addressable strips, the small processor used in the strips can be bought individually (last I saw was direct from China for about £10 for 100 of them), and individual LEDs added to the three outputs, thus different LEDs can be controlled via the addressing scheme ( on that device, "Red" controls LED1, "Green" for LED2, etc.). That opens up a one-wire addressing setup for building lighting or even colour light signals. I'm in the process of assembling a LED lighting setup for a large layout, using the addressable strips to control the colour balance and intensity of the lighting. For the future, we've ideas for changes in light due to weather and time of day: those are all "just" software once we've got the hardware and basic colour balance sorted. Watch the power consumption of the strips, and don't power anything other than short test strips via the Arduino's regulators. The large layout I mentioned requires multiple 12v 5A power supplies for the LEDs. - Nigel 2 Link to post Share on other sites More sharing options...
RAF96 Posted September 5, 2019 Share Posted September 5, 2019 Just had this advert in an email recently from hlzmleds.com Link to post Share on other sites More sharing options...
Adamphillip Posted September 5, 2019 Author Share Posted September 5, 2019 (edited) 4 hours ago, Nigelcliffe said: Watch the power consumption of the strips, and don't power anything other than short test strips via the Arduino's regulators. The large layout I mentioned requires multiple 12v 5A power supplies for the LEDs. I'm going to use an old computer PSU to power the lighting and I have been contemplating using individually addressable LED strips Edited September 5, 2019 by Adamphillip Link to post Share on other sites More sharing options...
Adamphillip Posted September 5, 2019 Author Share Posted September 5, 2019 after some fiddling I've got the start of some code, still need to make a fade function and work out why pin 3 won't cycle on the 2nd digital write. Quote #include <Adafruit_NeoPixel.h> #define LED_PIN 2 #define LED_COUNT 60 Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800); uint32_t midnight = strip.Color(25,25,112); uint32_t sunrise = strip.Color(245,68,0); uint32_t midday = strip.Color(255,255,251); uint32_t sunset = strip.Color(250,214,165); uint32_t dusk = strip.Color(38,83,141); uint32_t dawn = strip.Color(243,233,229); uint32_t magenta = strip.Color(255, 0, 255); void setup() { pinMode(3, OUTPUT); // sets the digital pin 13 as output strip.begin(); strip.show(); // Initialize all pixels to 'off' } void loop() { digitalWrite(3, HIGH); // sets the digital pin 13 on strip.fill(midnight); strip.show(); delay(5000); digitalWrite(13, LOW); // sets the digital pin 13 on strip.fill(midday); strip.show(); delay(5000); } Link to post Share on other sites More sharing options...
AMJ Posted September 5, 2019 Share Posted September 5, 2019 For GUI based testing and prototyping see the TinkerCAD site above. You can try out any circuit and develop your program online without the necessity to do any complex GUI based front end. Plus as it's a FREE web based the software is already installed on your machine. Link to post Share on other sites More sharing options...
Adamphillip Posted September 5, 2019 Author Share Posted September 5, 2019 14 minutes ago, AMJ said: For GUI based testing and prototyping see the TinkerCAD site above. You can try out any circuit and develop your program online without the necessity to do any complex GUI based front end. Plus as it's a FREE web based the software is already installed on your machine. yeah I'm currently using tinkercad, I'm scrapping the GUI side of the project and just hard coding the colour values now, was able to fix the relay cycling issue, it was accidentally set to pin 13, now I just need to have some sort of simple cross fade between colours Link to post Share on other sites More sharing options...
RudyB Posted September 20, 2019 Share Posted September 20, 2019 Have a look at these links that show how to build Arduino controlled LED strip lighting for your layout. https://rudysmodelrailway.wordpress.com/2016/01/24/rgb-led-strip-control-with-arduino-and-dcc/ https://rudysmodelrailway.wordpress.com/2016/02/23/rgb-led-strip-control-via-dcc/ https://rudysarduinoprojects.wordpress.com/2019/01/13/fun-with-arduino-05-connect-multiple-leds-with-a-relay-or-a-fet/ https://rudysarduinoprojects.wordpress.com/2019/02/17/fun-with-arduino-15-led-dimmer-with-pulse-width-modulation-analogwrite/ https://rudysarduinoprojects.wordpress.com/2019/03/21/fun-with-arduino-23-neopixel-addressable-leds-with-ws2812-ic/ Link to post Share on other sites More sharing options...
Adamphillip Posted September 24, 2019 Author Share Posted September 24, 2019 On 20/09/2019 at 11:27, RudyB said: Have a look at these links that show how to build Arduino controlled LED strip lighting for your layout. https://rudysmodelrailway.wordpress.com/2016/01/24/rgb-led-strip-control-with-arduino-and-dcc/ https://rudysmodelrailway.wordpress.com/2016/02/23/rgb-led-strip-control-via-dcc/ https://rudysarduinoprojects.wordpress.com/2019/01/13/fun-with-arduino-05-connect-multiple-leds-with-a-relay-or-a-fet/ https://rudysarduinoprojects.wordpress.com/2019/02/17/fun-with-arduino-15-led-dimmer-with-pulse-width-modulation-analogwrite/ https://rudysarduinoprojects.wordpress.com/2019/03/21/fun-with-arduino-23-neopixel-addressable-leds-with-ws2812-ic/ thank's me and a friend have been working on the code and we've been able to make it work Link to post Share on other sites More sharing options...
Jon Harbour Posted October 30, 2020 Share Posted October 30, 2020 I've just found this thread. I recently produced my own Arduino sketch to do this for a strip of addressable LEDs. It include multiple on/off times for each light. It's designed for a bank of ten low relief terraced houses. Each terraced house kit is two houses and each house has an upstairs light, a downstairs light and a downstairs fireplace. With the right interval and a judicious change of colours, I've managed to get a flickering effect for the fireplaces. It's far from elegant code but it works and is robust and expandable, so there is potential for multiple strips of LEDs working independently. I've also got a sketch that displays the time on an oLED 128 x 32 display and runs a clock approximately 8 times faster (one 'scale' day = three 'real' hours) and will be looking to combine the two. The Arduino on its own doesn't have enough oomph to power both LEDs and the display, so I will be using a 5V power supply to provide the juice and just run the control cables from the Arduino and have some sort of bus arrangement to fan the 5V out to various destinations. 1 Link to post Share on other sites More sharing options...
RMweb Premium QWILPEN Posted October 30, 2020 RMweb Premium Share Posted October 30, 2020 sounds good, can you share the sketch anywhere? Link to post Share on other sites More sharing options...
RMweb Premium melmerby Posted October 30, 2020 RMweb Premium Share Posted October 30, 2020 1 hour ago, QWILPEN said: sounds good, can you share the sketch anywhere? *.ino files can be uploaded to RMWeb. Link to post Share on other sites More sharing options...
Jon Harbour Posted November 1, 2020 Share Posted November 1, 2020 I'll tidy it up a little - needs more comments and then I will upload it. It's not the most elegant code though - I'm struggling with getting pointers to arrays working as I like. My monolithic code works fine, but when I tried to compartmentalise it with functions, it basically stopped working! Link to post Share on other sites More sharing options...
m.levin Posted November 10, 2020 Share Posted November 10, 2020 Hi I have used Neo pixel rings and mounted them in spot light housings, then runs it off an Arduino uno. it simulates sunset and sunrise, simulates a moon moving across the sky with a white glow and a random thunder storm thrown in. To activate it I have it switched via a point decoder and relay, which is activated buy the fast clock on RR&Co, 9pm sunset and 6am sunrise. A high relay signal activates the sunset and when it drops low it activates the sunrise. The moon is on a random cycle, left side of the room, right side or non, when non its a 1-100 chance of lightning. this video shows it in action 2 3 Link to post Share on other sites More sharing options...
Adamphillip Posted January 28, 2021 Author Share Posted January 28, 2021 wow I've been away a while and thought I'd update things here, I've been able to get a large 5m LED strip to work and now just need to sort out the relays for building lights, it's all ran off a 5v transformer off amazon, next job will be to design a custom PCB Link to post Share on other sites More sharing options...
jamespetts Posted February 3, 2021 Share Posted February 3, 2021 Am interesting topic. Does anyone know the CRI values of these LEDs? Link to post Share on other sites More sharing options...
Adamphillip Posted February 3, 2021 Author Share Posted February 3, 2021 9 hours ago, jamespetts said: Am interesting topic. Does anyone know the CRI values of these LEDs? Without a light meter not really, it'll very from strip to strip as they're only cheap LEDs Link to post Share on other sites More sharing options...
jamespetts Posted February 4, 2021 Share Posted February 4, 2021 1 hour ago, Adamphillip said: Without a light meter not really, it'll very from strip to strip as they're only cheap LEDs A shame - if one is setting up layout lighting for day/night cycles, it will make a huge difference to the appearance of colours on the layout if the white LEDs used have a high CRI (>90). Using low CRI LEDs has the potential to ruin the look of a layout. If anyone knows of any high CRI LED strips suitable for day/night cycle layout lighting, I should be very interested. Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now