N Gauge model railway lighting

I have no electronic experience so please forgive me if I have posted this in the wrong place.
I am seeking advice as to what equipment I would need to purchase to enable me to control say 20 leds.
I want the leds to fade on and off individually in a random pattern or in a controlled sequence.
At a later date I would also like to be able to operate small servo motors so that I can automate cranes for example.

Thank you.

Roy

An Uno has twenty pins that can be used for digital output, so it could handle your lighting needs with nothing more than the LEDs and some current limiting resistors.

It also has the ability to control up to 12 servos, although that would cost you digital pins. If you add in some shift registers, you can control the lights using fewer digital pins and still control the servos.

Alternatively, the Mega has enough pins to do both without extra hardware but it's more expensive. Since you have no experience with electronics, I'd suggest you start with an Uno (or equivalent) as it'll be cheaper to replace if you have any accidents that damage it.

As well as the pins to connect to the LEDs and servos you also need to consider how you are going to give instructions to the Arduino. And it's not really practical to think of an Uno having 20 pins as two of them are used for serial communication with a PC and you will need these for programming or debugging.

If you control the LEDs and servos using a screen on the PC then you don't need any extra pins for input. But if you plan to use switches or potentiometers to control things they will also need to be allocated to one of the pins.

On the other hand if the LEDs are controlled in groups one pin should do each group - but make sure not to exceed the Arduino's current limit of about 20mA per pin. If you need more it is easy to use a transistor to boost the current capability.

If you are not really interested in expanding your knowledge and experience of electronics it might make sense just to start with the Mega so that you have all you need up front. On the other hand if you are interested and you start with an Uno it is easy to build Uno functionality on a piece of stripboard for about £5 so that your second or third devices could be very cheap - and you could keep the original Uno for starting new projects.

...R

I have no electronic experience... I am seeking advice as to what equipment I would need to purchase to enable me to control say 20 leds.

I suggest you start by looking at the ArduinoInfo.Info WIKI HERE:

..and particularly at THIS since you are interested in controlling power and devices.

A Mega-compatible copy would be about $28 from Ebay, and you would have LOTS of pins for now and the future..

About making connectiions: I would suggest a Mega Sensor Shield (Sensor Shield for Arduino MEGA V1.3)

DISCLAIMER: Mentioned stuff from my own shop...

You said you want to fade them on and off individually. If you really mean fade, and not just switch, then you'll need PWM pins, and the Arduino Uno only has 6. The Mega 2650 has 15. If you are willing to combine some LEDs into groups of, say 2, there is another saving in pins.

As Robin2 points out, you don't want to go above 20 mA per LED. That being said, if you are willing to use groups of two, for example, and if they are red or green LEDs, or groups of 1 White or 1 Blue, and the other being either a Red or Green, then you can use 2 LEDs in Series, with the appropriate calculation of a dropping resistor. As well, you can use a higher voltage to power more than 2, with a little additional circuitry.

Let us know if you want to puruse something like this.

Thank you all for replying to my question.

As I said I know nothing about electronics and have read your replies with care.

I will now set about following the links and advice and study.

This is a completely new language for me

Roy

Feel free to ask more questions when you are ready.

...R