Help a Novice with an LED design or system PLEASE

Hi all and thanks for looking over the project im wanting to create…

I have a model railway or in the process of building my layout and im at the stage now where i need to start thinking about the lighting on the layout

Im wanting to my layout to transition from Day - Night gradually ( dimmed )

I will be using a 12V Strip LED above my layout for the Light for day time…

I want the process from day to night to take roughly 40 minutes

Say after about 20 minutes when the Strip LED light has been dimmed by say 50% I want Street lights on the layout to be turned on

Again these will be 12V LED’s as individual bulbs in each street light,

Ideally id like them to come on randomly throughout the course of the stated time as do real world ones but I could live with them all turning on at once

Same again for model houses on my layout id like the internal lights to be randomly turned on for say 4-6 minutes off for 10 then back on etc

Im a complete novice with the arduous and although I do really want to learn this on my own I just cant seem to get my head around what needs to be done

Please feel free to contact me if you require any further information as regards to what I plan to do

PLEASE SEE ATTACHED IMAGE TO BETTER EXPLAIN THE DESIGN AND HELP I NEED

Welcome.
Although we won’t design your system we will help you when you have problems.

Arduino links of interest.

How to use this forum:
https://forum.arduino.cc/index.php?topic=149014.0

Listing of downloadable 'Arduino PDFs' :
Either Google >>>- - - - > arduino filetype: pdf
Or
https://www.google.ca/search?q=arduino+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=arduino+filetype%3A+pdf&aqs=chrome..69i57j69i65.1385j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8

Listing of downloadable 'C++ PDFs' :
Either Google >>>- - - - > C++ filetype: pdf
Or
https://www.google.ca/search?q=c%2B%2B+filetype%3A+pdf&rlz=1C9BKJA_enCA739CA739&oq=c%2B%2B+filetype%3A+pdf&aqs=chrome..69i57.22790j0j7&hl=en-US&sourceid=chrome-mobile&ie=UTF-8

Arduino cheat sheet:

Troubleshooting common errors:

Watch these:
Arduino programming syntax:

Arduino arithmetic operators:

Arduino control flow:

Arduino data types:

Some things to read

https://learn.adafruit.com/category/learn-arduino

https://learn.sparkfun.com/tutorials/how-to-read-a-schematic

Language Reference:
https://www.arduino.cc/en/Reference/HomePage

Foundations:

How and Why to avoid delay():
http://playground.arduino.cc/Code/AvoidDelay

Demonstration code for several things at the same time.
http://forum.arduino.cc/index.php?topic=223286.0

Useful links:

Arduino programming traps, tips and style guide:
http://www.gammon.com.au/forum/?id=12153

Jeremy Blume:

Arduino products:
https://www.arduino.cc/en/Main/Products

Motors/MOSFETs
http://www.gammon.com.au/motors

Switches:
http://www.gammon.com.au/forum/?id=11955

Share tips you have come across, 500+ posts:

Images from above:
https://www.google.com/search?q=“Share+tips+you+have”+larryD+site:https://forum.arduino.cc&prmd=nmvi&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiJw-zu68ncAhXPGTQIHWCDCNwQ_AUIFCgE&biw=1024&bih=653

Debug discussion:

.

In the future, always show us your ‘current’ complete sketch.
Use CTRL T to format the sketch.
Please use code tags.
Use the </> icon in the posting menu.

[code] Paste sketch here. [/code]

Also:
Show us a good schematic of your circuit.
Show us a good image of your wiring.
Give links to components.
Posting images:
https://forum.arduino.cc/index.php?topic=519037.0

And:
2017-08-05_20-33-24.jpg

Outputs.jpg

“PLEASE SEE ATTACHED IMAGE TO BETTER EXPLAIN THE DESIGN AND HELP I NEED”
BTW, all caps is like you are yelling at us.

.

demo of lights.jpg

Hmmm. Interesting graphic. Does not seriously demonstrate the concept of street lights coming on section by section or house lights changing individually.

40 minutes is a prolonged animation on a model; people are likely to get bored following it.

Do you have a proper web link for those street lights? They evidently contain a single chip LED and if they are 12 V, must include a current limiting resistor which actually wastes the vast majority of the power. If each uses 20 mA - which is likely - and you have just 20 of them, then in parallel they are drawing nearly half an Amp which is a significant load which you require transistors or a TPIC6B595 to control - it could control six such 20 mA lights on each of its eight outputs; that would certainly work out quite well - no brightness control. Street lights commonly come on in groups.

But if these were single LEDs without the resistor, you could control 64 separately from a 5 V supply using a MAX7219. Which is exactly what I would suggest you do for the house lights - use separate common white or warm white LEDs wired in a matrix and controlled by the MAX7219 which you can obtain ready mounted on a module to use. Similarly for the TPIC6B595.

As to your overhead strip lighting, you will require a logic-level FET to control and dim it using PWM. You will however find that PWM from the Arduino becomes "steppy" at low values and PWM may interfere with digital video cameras.

Hi thanks for your response, the layout is for my own personal use to start with ...

I would like the street lights to come on in blocks as you mention and not gradually lit thats correct the same for the houses ...

I've just double checked and the Street lights i intend to use for my scale are rated at 3V each 20mA, I could easily match the interior lights to make it simple...

I think im asking in the wrong place to be fair Im new and I mean NEW to all this and may have to acquire help elsewhere as id need help with a wiring diagram and also the code used in the arduino..

so yeah basically from the Arduino I want that to control the 12V LED strip lights that would give me day light and be automatically on a timer dim to night thus control the Street Lights and Interior lighting when certain parameters within the code are met example when the PWM signal dimming the light hits ( Value ) or what ever it requires again no expert sorry

We need some more information on what your LED light actually is.

A very basic LED needs a series resistor to limit the current flow.

Your LED lights may have these resistors built in but we need to know this.

Do you have a link to these lights and street lights?

What Arduino board do you have?
.

Hi yeah sure here is what I’ve ordered

Look at this on eBay

LNH16 10pcs Model Railway Lamppost lamps Street Lights N Z Scale LEDs NEW

https://rover.ebay.com/rover/0/0/0?mpre=https%3A%2F%2Fwww.ebay.co.uk%2Fulk%2Fitm%2F331384587858

Thanks again Tom

Features:
Brand new. Perfect for Railway & Building Layout!
Made with white LEDs.
Complete with wires and LEDs and can be lighted.
These Lampposts are suitable for use at supply voltages of 3V only.
DO NOT use them on 12V or 16V directely to avoid damaging the LED.
You must connect a resistor in series before you will use them on 12V or 16V, I will supply compatible resistors for free.
Please apply correct Operating Current 20mA to each LED too.

Specifications:
Brand: Everest.
Size: Approx. 5cm(H) or 1.97''(H) Inch.
Reference Scale: 1:140~1:220,Suitable for N scale or Z scale etc....
Operating Voltage: 3V, AC or DC Compatible.
Operating Current: 20mA.
Material:Coppery Column Model Lampposts.
Emitting color: Warm White.

Package included:
10 Complete lamp.
10 Resistors (not pre-soldered) for 9~18V operation.

So looks like you get and need to add the series resistor to set the current when powered by 9-18volts.

What Arduino do you have?

.

Hi I’ve not ordered anything as of yet as I was unsure what one to go for but as a guess I would order the uno

Suggest you do order an UNO to start with.

You will need an external power supply/supplies to power everything.

If necessary, you can get a Arduino Mega later on.

What experience do you have with basic electronics, soldering, software, etc.

.

I do have some basic knowledge of electrical wiring etc I done a lot of work when modifying my car and putting in new equipment... as for using the uno none at all really esp when it comes to the coding I’ll have to try and get my head around that

Take a look at this posting:

Do you think you could master this technique.

And this PDF.

BTW, look at this thread to get some ideas what you can do.
Yes there are >600 post to see :wink:

.

Do you have a soldering iron, DVM, small electronics tools (wire cutters, tweezers, third hand etc.) ?

Yeah I’ve got all that already ... just ordered the uno now as a start kit

Assume your soldering iron is small enough for PCB and small electronics work.

Something similar to this.

  • How many street lights do you plan to have?

  • How many feet of LED strip will you have?

  • Also do you have a link to the 12 volt LED strip?

  • What other things are you planning to have the Arduino do?

.

Hi yeah I’ve got a decent soldering iron with tips that swap out for smaller ones and heat control etc

Look at this on eBay

WOW - 5M 5050 SMD 300 LED Warm White Strip Light Waterproof 12V DC + Female Plug

That’s the link for the strip lights I’ll be suing about 4m of it to ensure my layout is lit up enough

I’ll be using between 10 and 15 street lights

About 20 buildings will need interior lighting

I plan on using probably another uno to have some motion or characters moving on my layout controlled via servos and push rods

300 LEDs @12v 0-5 amps.

Can you master these hand techniques?

Yeah I dont think thatll be a problem alot of whats shown ive used when constructing my RC planes

Sounds like you have the skills or can acquire them.

Robin2 has a good discussion here:

.