I am a total novice when it comes to electronics. I had a simple circuits class 30 years ago as a software undergrad. I've designed a simple LED lighting circuit for N-scale model railroad, to be used to light passenger cars. The circuit includes "anti-flicker" capacitors so that minor interruptions of input voltage due to dirty track, etc. do not cause the lights to flicker (which is terribly annoying).
I used example circuits from various websites plus input from forum members on an N-scale forum I am on to come up with this circuit. I've mocked it up on a breadboard and it works, but I wanted to make sure it makes sense to people who know more than me. The exact values in the circuit are just an example and I am not sure the resistor leading into the zener makes sense. I've watched a few zener diode YouTube videos and looked at online tutorials.
The goal of the circuit is to have a board made that the user can then populate with their desired components (amount of anti-flicker capacitance, "dimming resistor", number of LEDs in parallel, size of LED, 3.3V or 5V regulator feeding the LEDs etc).
The input is meant to be either DCC track voltage (n-scale levels) which is a digital square wave signal (and represented by the "VAC" inputs and on the output of the rectifier shows as around 13.5--14.5V), or for those using DC analog trains, a positive or negative voltage (usually 0-12V but can be higher than 12V).
So the input is fed through a bridge rectifier, and the output is then fed into the circuit. The main circuit is composed of anti-flicker capacitors that feed a voltage regulator (listed as L7805 but I am using AMS1117 in 5V or 3.3V versions). The output of the voltage regulator is fed into the LED circuit, which has a "dimming" resistor (shown here as 2.2k ohms, and which can probably vary from 750 ohms to around 3k ohms depending on how bright the user wants the LEDs to be, what sort of LED (0805 or 1206 -- the difference being the amount of light they produce so relative brightness of an individual LED to get the desired overall passenger car internal brightness), whether 5v or 3,3v from the regulator, etc.
The capacitors are meant to be SMD ceramic capacitors. While up to 47uF are available in 25V versions, 100uF (in 1206 or smaller or 1210 size) are hard to find in 25V versions (at least economically), but readily available in 12V, so to be able to use 16V versions of the capacitors, I added a zener diode between the rectifier and the capacitors in order to "hard limit" the voltage into the capacitors at about 12V.
(There is also a resistor of 100 ohms or 75 ohms to limit a hard surge of current into the capacitors [as I gathered from other circuits, and a similar low value resistor into the voltage regulator).
It appears from my testing that this is about correct but I am not sure I am computing the resistor leading into the zener correctly.
The zener I have is a ZMM12V (from Chanzon -- inexpensive Chinese stuff as this is meant to be a low cost board) -- https://www.aliexpress.com/store/product/100-500-2500-Pcs-SMD-Zener-Diode-0-5W-12V-ZMM12V-ZMM12-LL-34-SOD/313665_32854074530.html?spm=2114.12010612.8148356.14.711e4cf5y0vwxT
I had computed around 35 ohms based on a 13.5V input and a 12V zener voltage. But this gives me around 12.5-12.7V. If I make this resistor 150 ohms the voltage showing between the zener and the capacitor circuit is about 12V.
Because the LEDs are not lit very brightly, the overall load from the LEDs is not that high. If I am measuring it correctly, usually in the low single digit "ma" .
Does this circuit look reasonable and how do I really compute the resistor for the zener? I need to be able to handle a variety of input voltages from 12V up to probably around 15V/16V from the rectifier.
Thanks for a newbie.