My Model Railroad with Electronics - Page 1
Forum section: electronics / projects

author: xrunner
author_rank: Super Contributor
timestamp: April 10, 2013, 06:45:50 pm
content: Hello,I finally joined after watching the video blog for a long time. I was planning on buying the Rigol DS1052 but after watching the recent video comparing it to the DS2072, I decided to wait and get the DS2072. I think it's got a 6 month backorder though.My electronics project? My model railroad. If you didn't know it, it's all computerized now and the locomotives all can have small microcontrollers in them called DCC (digital command control). I'm also using the Arduino to make some electronics I need such as a signal controller and traffic light controller. I've been working on it for 1 1/2 years now and not even close to being done. I attached several pics.Beauty!Glad to be here.

author: David_AVD
author_rank: Super Contributor
timestamp: April 10, 2013, 09:48:33 pm
content: I like the DCC system. Much easier to run multiple engines.

author: xrunner
author_rank: Super Contributor
timestamp: April 10, 2013, 10:19:39 pm
content: Quote from: David_AVD on April 10, 2013, 09:48:33 pmHello David,Yea it's pretty cool. I've even installed a small DCC decoder to run the motor in a turntable. I had N scale trains as a kid and recently got back into it after finding some of my old cars in a box. I had no idea the hobby had progressed this far.I'm planning on doing some cool stuff with the Arduino on the layout, as I've said one is to simulate signals and traffic lights. Another is to set up some emitters and sensors to detect trains. Instead of the standard IR LEDs I got some IR laser LEDs from a Chinese supplier on Ebay to use as emitters. I could use red lasers but it looks like the Terminator is after my trains.I also build my own N scale parking lot lights, I attached a pic of one that simulates sodium lights.I recently retired and plan on upgrading my test equipment. Right now I have a 20 year old Hitachi scope. I'd like to get the Rigol DS 2072 and maybe a Rigol DM3058 too.Glad to be here.

author: Skimask
author_rank: Super Contributor
timestamp: April 10, 2013, 10:42:56 pm
content: I wanna play!

author: dr.diesel
author_rank: Super Contributor
timestamp: April 10, 2013, 10:48:20 pm
content: Very nice! Thanks for sharing.

author: David_AVD
author_rank: Super Contributor
timestamp: April 10, 2013, 11:10:28 pm
content: I like that mini sodium light.

author: xrunner
author_rank: Super Contributor
timestamp: April 10, 2013, 11:26:56 pm
content: Quote from: David_AVD on April 10, 2013, 11:10:28 pmThanks. I used 1.6 mm LEDs for those. Currently (no pun intended) I run strings of LEDs on the layout in series using several Supertex CL2 constant current sources off a 24V PS.I next need to make some traffic lights with of course R-Y-G LEDs, but it's going to be quite a little project.Keep posting so I can answer a few more questions and get past the anti-spam verification captcha requirement.

author: David_AVD
author_rank: Super Contributor
timestamp: April 10, 2013, 11:45:33 pm
content: The stuff I have stored away is N gauge. I don't have room to set it up at home at present due to my other hobby; pinball and arcade machines. By the time I get back to it (retirement), there will be hover trains!

author: xrunner
author_rank: Super Contributor
timestamp: April 10, 2013, 11:58:28 pm
content: Quote from: David_AVD on April 10, 2013, 11:45:33 pmI know.I do plan on setting up JMRI for PC control of my layout (I have the USB interface already) but I do wish Digitrax would engineer a better handheld throttle. They need a bigger screen with color LCD.Now, how did I stumble upon Dave's EEV Blog? I believe it was when I was investigating the Arduino and if I could use it on the layout. I remember his video of the Arduino Duemilinova (I think) and him making fun of the name. So he kinda got me hooked on his style of reviewing gadgets. No worries!LOL. I have a small gadget I think I will mail to him for a teardown, if he isn't already overloaded with junque.P.S> I'm past the captcha thingy now.

author: grego
author_rank: Frequent Contributor
timestamp: April 11, 2013, 03:41:08 am
content: Don't forget to look into OpenLCB for layout control. I'm part of the group working on it and we could always use more folks. It's part of the 9.7 standard from the NMRA so it's all legit!www.openlcb.orgIt's all open source and we're doing some pretty wild stuff with it right now.

author: Alana
author_rank: Frequent Contributor
timestamp: April 11, 2013, 06:34:01 am
content: I'm into model railways too. At the moment there is no electronics in it - waiting for some $ to start building properly there but i have managed to make myself a turnout out of rails and pcb strips [pics attached]. Scale: H0, turnout is a miniature of polish state railways 1:9 R190 type turnout.And this is how it works - this turnout is attempt to copy a pre-made one for model railways

author: xrunner
author_rank: Super Contributor
timestamp: April 11, 2013, 12:18:02 pm
content: Quote from: grego on April 11, 2013, 03:41:08 amInteresting - I skimmed the documents but will look into it further later. I never heard of it until now.Quote from: Alana on April 11, 2013, 06:34:01 amImpressive! I don't think I'll be attempting that!

author: Alana
author_rank: Frequent Contributor
timestamp: April 11, 2013, 02:54:00 pm
content: This was simple, making layout look pretty will be difficult

author: xrunner
author_rank: Super Contributor
timestamp: April 11, 2013, 07:04:46 pm
content: Quote from: Alana on April 11, 2013, 02:54:00 pmWell, there certainly are tricks to it, but it's not that bad. I find that part of it very relaxing and fun. Remember, you don't ever want to "finish" the layout. That would be a catastrophe.Here's one more pic if anyone's interested.

author: TheWelly888
author_rank: Frequent Contributor
timestamp: April 11, 2013, 08:14:40 pm
content: I am also interested in model railways, in fact it was model railways that helped me get interested in electronics in the first place when I wanted to work out how to operate colour light signals like the real thing! I don't have a layout yet but have you heard of MERG ( pronounced merge ) which promotes the use of electronics to enchance model railway operation?http://www.merg.org.uk/It's UK based but has members from all over the globe and has kits available too. I am a member of MERG and highly recommend it!There are some members actively developing a new way of operating points, signals and train detection using the CAN protocol that was originally developed for cars!http://www.merg.org.uk/merg_resources/cbus.phpThere are also DCC stuff including kits!http://www.merg.org.uk/merg_resources/dcc.phpNaturally there is a forum:http://www.merg.org.uk/forum/Members can post to that forum and also get a quarterly newsletter plus access to various useful resources concerning model railway electronics.

author: Alana
author_rank: Frequent Contributor
timestamp: April 12, 2013, 12:49:27 am
content: Yup, know MERG and may build their DCC controller but rest of the layout, all the lights and turnouts control will be of my own design from scratch. What i got on a breadboard showed me that eventually i may end up with my own version of DCC but my point is to learn electronics while having lots of fun with it.Quote from: xrunner on April 11, 2013, 07:04:46 pmNow i "get it" why i loved that old station in Trainz and re-developed its layout over and over again.

author: xrunner
author_rank: Super Contributor
timestamp: April 12, 2013, 11:46:51 pm
content: Here's some work I was doing to simulate traffic lights w/Arduino -

author: xrunner
author_rank: Super Contributor
timestamp: May 28, 2013, 05:48:40 pm
content: Here's some work I'm doing with LEDs. The interior LED is a 5mm white diffused. The one over the door is a 1.6mm amber with most of it painted brown. There will also be another one for the rear delivery door. I'm just driving them with a Supertex CL2 LED driver.

author: David_AVD
author_rank: Super Contributor
timestamp: May 28, 2013, 10:32:31 pm
content: I'd like to get back into a railway hobby at some stage, but it'll probably have to wait until I'm retired. Maybe they'll have miniature "hover trains" by then!

author: Rerouter
author_rank: Super Contributor
timestamp: May 29, 2013, 03:08:27 am
content: make your own? there are enough designs out there for metal levitation, i get the feeling it wouldn't be too much of a step up to modify it to lift and hold a model train car,

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 03:24:00 am
content: I just picked up this n sale layout.No idea what to do with it yet, very dusty!http://www.flickr.com/photos/eevblog/8873964675/#

author: David_AVD
author_rank: Super Contributor
timestamp: May 29, 2013, 04:14:16 am
content: You might want to keep Sagan away from that for now. Curious fingers kill model railways pretty quickly! (I speak from experience)

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 07:10:13 am
content: Quote from: David_AVD on May 29, 2013, 04:14:16 amIt'll be kept in the lab

author: carbon dude oxide
author_rank: Frequent Contributor
timestamp: May 29, 2013, 10:03:35 am
content: Automate it ^.^

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 10:10:47 am
content: Quote from: carbon dude oxide on May 29, 2013, 10:03:35 amI've got an idea for a novel thing to try. But maybe someones done it, need to google it...

author: IanJ
author_rank: Unknown
timestamp: May 29, 2013, 10:40:12 am
content: Quote from: EEVblog on May 29, 2013, 10:10:47 amYou're thinking about having it EEVBlog Reader controlled aren't you.......?Ian.

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: May 29, 2013, 11:28:28 am
content: QuoteMaybe Gomez from the Adams family, has some ideas?

author: robrenz
author_rank: Super Contributor
timestamp: May 29, 2013, 11:33:29 am
content: I am not into trains butthis guyis about 2 miles from me and seems to have some good stuff. You might want to check here Dave to see if it already exists.

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 11:43:39 am
content: Quote from: robrenz on May 29, 2013, 11:33:29 amNope, nothing like my idea there.Not that I know if my idea would work anyway, guess I have to try it. Yes, it's technically iffy...

author: xrunner
author_rank: Super Contributor
timestamp: May 29, 2013, 12:57:04 pm
content: Quote from: EEVblog on May 29, 2013, 10:10:47 amIt'll be interesting to see what you come up with. Every time I think I have an idea that hasn't been done I'm proven wrong. That's not to say they aren't out there. With your electronics knowledge you can probably do something unique.I've seen that basic layout plan before, like this one with slightly different tracks?http://www.iblproducts.com/Traunstein.htmLooks like it's missing a bridge for one section? There's two loops (no crossover?) and four turnouts/sidings. You got a station/loading dock, an industry, a pond, a farm scene. Yea the tracks will have to be cleaned.I tried to get my nephew interested in model trains (10 year old). I gave him an N scale track setup, an engine, and some cars, and a DC throttle. He couldn't care less about it. It can't compete with video games.

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 02:00:32 pm
content: Quote from: xrunner on May 29, 2013, 12:57:04 pmAh, was looking for that, thanks.Yes, the back bridge is missing.

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 02:12:13 pm
content: I might very well retrack it to be a bit more versatile like in the manual and your photo.http://www.eurorailhobbies.com/pdf/Noch/NO-84810.pdf(English version available?)Could automate the cross over points as well and DCC the whole thing to automated control of 2 or 3 trains.Will have the remove the station for that.

author: Alana
author_rank: Frequent Contributor
timestamp: May 29, 2013, 02:57:29 pm
content: Your layout seems to be mod of this basic one wired for 2 trains running at the same time in opposite direction in DC operations, thats why it has no crossover between 2 track loops. If that was mine I'd add double crossover and re-wire it. Do you have trains for it?

author: xrunner
author_rank: Super Contributor
timestamp: May 29, 2013, 11:16:03 pm
content: Quote from: EEVblog on May 29, 2013, 02:12:13 pmHey Dave you can model the outback on the layout!Do they runs trains through the outback?

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 11:34:19 pm
content: Quote from: xrunner on May 29, 2013, 11:16:03 pmYeah, one.So that layout would be a single straight track, and red dirt

author: EEVblog
author_rank: Unknown
timestamp: May 29, 2013, 11:35:59 pm
content: Quote from: Alana on May 29, 2013, 02:57:29 pmThe guy I got it from is sending me a train.Yes, obviously designed for 2 train DC control.With crossovers, position sensors and DCC it would be possible to run an interesting 2 or even 3 car system, and on a bigger loop too.

author: David_AVD
author_rank: Super Contributor
timestamp: May 29, 2013, 11:51:48 pm
content: I designed a few accessory boards for my model railroad, but that hobby got interrupted before I finished building and coding them. I should revisit them at some stage.

author: xrunner
author_rank: Super Contributor
timestamp: May 29, 2013, 11:59:38 pm
content: Quote from: David_AVD on May 29, 2013, 11:51:48 pmWhat type of boards? Using discrete components or what (you mentioned coding them).

author: David_AVD
author_rank: Super Contributor
timestamp: May 30, 2013, 01:34:41 am
content: Quote from: xrunner on May 29, 2013, 11:59:38 pmOne is a controller that enabled automated (back and forth) operation of a DC loco on a single section of track. It has inputs for 4 trackside opto sensors so the train slows down before coming to a stop at the end. It also waits at each end (passenger pickup) before reversing direction each time.Another is a (PIC based) servo controller that went between two preset positions and has a switch input. It might be useful for points or signals, etc. I think you can buy little boards that do this quite cheaply now.There are others, but I don't recall exactly what they are as it's been a few years since I did them. (about 350 board designs ago!)

author: Neilm
author_rank: Super Contributor
timestamp: May 30, 2013, 06:08:14 pm
content: Its all very well as a hobby, but look what happened to Roland Callingham when he let his hobby get a bit out of hand.This is called Bekonscot model village. This is literally in a back garden.Neil

author: David_AVD
author_rank: Super Contributor
timestamp: May 30, 2013, 11:04:46 pm
content: Quote from: Neilm on May 30, 2013, 06:08:14 pmHoly cow!

author: xrunner
author_rank: Super Contributor
timestamp: May 30, 2013, 11:16:30 pm
content: Quote from: Neilm on May 30, 2013, 06:08:14 pmOh don't worry - I'llneverlet it get out of hand.

author: EEVblog
author_rank: Unknown
timestamp: May 30, 2013, 11:49:29 pm
content: Quote from: David_AVD on May 30, 2013, 11:04:46 pmNo, THIS is Holy Cow!I've been there, it's even more awesome than it looks!

author: xrunner
author_rank: Super Contributor
timestamp: June 01, 2013, 09:50:20 pm
content: Quote from: mojo-chan on June 01, 2013, 09:27:52 pmHi mojo-chan,Are you talking about old models? I don't do Z, but all the modern N scale engines I know of take DCC decoders easily.

author: xrunner
author_rank: Super Contributor
timestamp: June 02, 2013, 11:59:17 pm
content: Quote from: mojo-chan on June 02, 2013, 09:30:06 pmThat's weird, but I guess it explains why Kato keeps making their #6 turnouts route power when switched (which of course isn't needed with DCC).I modded all mine by soldering internal wires to disable the power routing.

author: C
author_rank: Super Contributor
timestamp: June 03, 2013, 02:25:46 am
content: Not sure if I can say this properly so here goes nothing.Think for a bit that all communications to and from a model train was done with magic, light, radio, sound, what ever , What does that model train still need and what can the other ways of communications not easily provide?1. POWER: With dirty track, track switches, ____ there is even a need for short term power storage.2. Position: Older systems did block detection. DCC makes this harder but not imposable. But what if you wanted more? What if the currently addressed train created a large current change, A current pulse in one or both directions. Block detection of this current pulse would allow knowing what block the addressed train is in. But could you not do more with the pulse with some timing like a TDR to determine where in the block the train is? While on position, how hard would it be for the controller added to a train to detect the rotation of the train's motor? Good detection of the motor rotation could give a mouse like reading. Just one pulse per rotation with the gear reduction would give good readings. Just one cheap optical sensor, a led, a black mark and a way to talk back and you could have mouse like counter telling you how far the train engine moved.Back to main thought.Previous systems to DCC had problems with signal strength. Some had EMI problems. Some had DC balance problems. If you think about it, what DCC did was make the communications to the train HUGE. So huge that the dc power could no longer exist, but done in a way that the signal it's self could be used for the train;s power source.Now I can understand in the limited space of a small train engine not having great filters to remove in train power supply noise. I can understand the communication signal getting a little distorted do to the small amount of space in an engine.But what is the excuse for things that do not have these tight space problems? If you look on the net, how many projects forget that what is on the track is first a communication signal and second a more expensive to create DC power source? What is the excuse for something not in a small space like a train engine pumping a lot of power supply noise back into the track signal. All that noise and distortion keeps adding making it harder for any talk back from the train system to function. It gets large enough that things with out talk back start messing up even with the huge signal DCC starts with on the track. Look at the strong suggestions made to use a separate DCC booster to power things Yes I know you can get away with a lot, but would it not be a good idea if a circuit that was using the track signal to power the circuit to have a proper filter between the power section and the signal input to remove the noise generated from the power section?Is it really that hard to keep a DC input from messing with signals which are above 3 kHz that are also connected in front of the DC input?C

author: xrunner
author_rank: Super Contributor
timestamp: June 05, 2013, 09:39:57 pm
content: Quote from: mojo-chan on June 05, 2013, 08:54:55 pmI think you can do that on the #4 switches only.I bypass the power routing on the #6 by soldering wires and shown in the attachment (the yellow and green wires).

author: David_AVD
author_rank: Super Contributor
timestamp: June 05, 2013, 10:42:19 pm
content: With terms like "frogs", etc people new to the hobby often wonder what the hell is being spoken about. No different to Electronics and all the associated weird terms I guess.

author: xrunner
author_rank: Super Contributor
timestamp: June 06, 2013, 02:24:34 pm
content: Had some success soldering the 0603 SMD LEDs! Got a traffic light head filled.

author: David_AVD
author_rank: Super Contributor
timestamp: June 06, 2013, 09:01:37 pm
content: Good stuff. Much nicer colours and less current draw than the "grain of wheat" lamps I remember buying as a kid for my model railway.

author: xrunner
author_rank: Super Contributor
timestamp: June 06, 2013, 09:23:49 pm
content: Quote from: David_AVD on June 06, 2013, 09:01:37 pmThe green SMD LED is bright.Reallybright. Way too bright @ 20 mA, so I reduced the current to 10 mA. Still way too bright. Then down to 8 mA, then finally to 3 mA!So at only 3 mA it's apparent brightness is the same as the red and yellow LEDs running at 20 mA.Wow, that green LED is pretty efficient!

author: David_AVD
author_rank: Super Contributor
timestamp: June 06, 2013, 09:29:16 pm
content: Yeah, there can be massive differences in the intensity of LEDs. As you found, you only need a few mA for some types. Maybe a good excuse to make yourself a resistance box or an adjustable current source for testing.If you check the LED data sheets, they will specify the wavelength (in nm) so you can use that to choose LED colours that are nice. eg. Some greens are definitely yellow tinged while others are a nicer (imo) emerald green.

author: xrunner
author_rank: Super Contributor
timestamp: June 07, 2013, 12:25:36 am
content: Quote from: David_AVD on June 06, 2013, 09:29:16 pmYea, and another good point is modelling real traffic lights with LEDs is valid, because real traffic lights are being constructed with LEDs now.

author: EEVblog
author_rank: Unknown
timestamp: June 07, 2013, 12:33:49 am
content: Quote from: David_AVD on June 05, 2013, 10:42:19 pmYep, now I have to get my head around again.I want to add two crossovers to my set, to potentially run two trains but don't know if DCC is the best way to go, or simply a regular controller with maybe isolated parts of tracks or whatever. It's been 30 years wince I had a train set

author: xrunner
author_rank: Super Contributor
timestamp: June 07, 2013, 12:55:49 am
content: Quote from: EEVblog on June 07, 2013, 12:33:49 amSame here. Three years ago I waltzed into a hobby shop just to get some track to display my old N scale cars on (for my nephew) and was completely sucked back into the hobby, because of the DCC capabilities. Now look at me.There's something simple and pure about a DC layout, and it may be all you need to use. But if you like more advanced electronic gadets and all that lot, then you will want DCC locomotives.Oh, I just described you didn't I.

author: EEVblog
author_rank: Unknown
timestamp: June 07, 2013, 01:04:00 am
content: Quote from: xrunner on June 07, 2013, 12:55:49 amThe last thing I need is another advanced hobby that will suck my time!

author: xrunner
author_rank: Super Contributor
timestamp: June 07, 2013, 01:06:00 am
content: Quote from: EEVblog on June 07, 2013, 01:04:00 amLOL - well it's DCC for your layout!Truthfully, I don't know how you are doing all you are doing anyway. You must be one Hell of a multitasker.

author: EEVblog
author_rank: Unknown
timestamp: June 07, 2013, 01:12:20 am
content: Quote from: xrunner on June 07, 2013, 01:06:00 amMultitasking to the point where hardly anything gets done!Continuous video output (at some level, but not as often as I'd like) gets priority of course, because without that Sagan starves.Apart from that, my non-achievements are outstanding

author: jh15
author_rank: Frequent Contributor
timestamp: June 07, 2013, 02:29:31 am
content: Yes! Give it all to Sagen before it's too late. We need your time here.

author: EEVblog
author_rank: Unknown
timestamp: June 07, 2013, 02:46:33 am
content: Quote from: jh15 on June 07, 2013, 02:29:31 amHe already broke the train station roof!

author: David_AVD
author_rank: Super Contributor
timestamp: June 07, 2013, 02:58:27 am
content: Quote from: EEVblog on June 07, 2013, 02:46:33 amInevitable I'm afraid. Been there, had that happen.

author: xrunner
author_rank: Super Contributor
timestamp: June 07, 2013, 08:56:19 pm
content: Quote from: David_AVD on June 06, 2013, 09:29:16 pmAnother odd thing is how the SMD LEDs mark the cathode. The green ones have a sortof green "T" that marks it. The yellow have a green triangle symbol, and the red - have no marking, the cathode is only distinguishable because it's metal pad is a different shape than the anode. Weird.Quote from: EEVblog on June 07, 2013, 02:46:33 amMaybe modelling the outback isn't such a bad idea after all.(at least for now)

author: David_AVD
author_rank: Super Contributor
timestamp: June 07, 2013, 11:04:26 pm
content: Quote from: xrunner on June 07, 2013, 08:56:19 pmYeah, you can never assume. I always test one out of a batch to confirm before loading them onto boards.

author: xrunner
author_rank: Super Contributor
timestamp: June 08, 2013, 11:06:46 pm
content: Here's five more SMD traffic lights. I have all six made now. Next I need to swap them into my Arduino breadboard and check the whole lot as they will be operating. Might adjust some resistors to make the light levels look more identical.Then I need to paint them and figure out what type of traffic light pole system to use to hold them on the layout.

author: xrunner
author_rank: Super Contributor
timestamp: June 09, 2013, 03:44:00 pm
content: Ran into a small problem.When I swapped the SMD lights into the Arduino + breadboard, the green LEDs wereverydim. The red and yellow were OK. Found out that the green 0603s are dropping ~3V. The green 1.6 mm LEDs I was using before on the breadboard prototype only dropped 1.8V.This was not a concern when I was testing them before because I was using a constant current driver and I had more than enough voltage available. Now I have only 5V on the Ard. digital outputs, and I'm not even using a resistor at the moment. It's pulling 0.15 mA.The brightness is possibly acceptable, however I'll have to either PWM the other colors to make them look the same brightness or adjust the resistors for them to do it.orI can drive the two sets of two greens LEDS each set with a transistor, and use the Vin rail, with associated current limiting resistors.If it ain't one thing it's another.

author: David_AVD
author_rank: Super Contributor
timestamp: June 09, 2013, 09:49:35 pm
content: You should be able to use any of those LEDs on a 5V supply. Is the Arduino output really 5V?

author: xrunner
author_rank: Super Contributor
timestamp: June 09, 2013, 10:40:38 pm
content: Quote from: David_AVD on June 09, 2013, 09:49:35 pmYea, sorry David I didn't explain fully. I'm using several of the outputs to drivetwoLEDs in series to save outputs because certain lanes on the same road are in synch - both the lights in opposite directions are on with the same colors at the same time. If I don't do that I'd have to move up to shift registers.But, I have it working now. I added a 2N2222 transistor connected to 12V, and I am driving the green LEDs with that, so I now have more than enough to cover the voltage drop for them in series. The other colors are lower voltage drop so are still working as the prototype 1.6 mm LEDs were, meaning I can use two of them in series off of a 5V digital output. It's just that these green SMDs have a 3V drop, unlike their 1.6 mm cousins which had a 1.8 V drop. I have no idea why that is.

author: David_AVD
author_rank: Super Contributor
timestamp: June 09, 2013, 10:57:42 pm
content: Different LED colours have different forward voltage drops (Vf) due to the manufacturing process. Red is the lowest (1.6 - 1.8V usually) while green and yellow are a bit higher. White and blue are a lot higher (up to 4V).Using two LEDs in series from 5V is never going to be a good idea. Much better to use some low-side drivers (2N2222 or a ULN chip) and run from a higher voltage as you've found out.

author: xrunner
author_rank: Super Contributor
timestamp: June 09, 2013, 11:14:41 pm
content: Quote from: David_AVD on June 09, 2013, 10:57:42 pmWhy do you say that? I have a series resistor that limits the current to about 16 mA, and the combined voltage drop for both LEDs is ~4V. I don't see any "legal" design problem with doing it, and it works OK.

author: David_AVD
author_rank: Super Contributor
timestamp: June 09, 2013, 11:20:54 pm
content: I guess if you can choose LEDs with a low enough Vf, it is ok. Just be aware that once you start operating the LEDs with very little headroom (Vsupply - Vf), the series resistor value becomes more more critical.The Vf of the LED also varies with temperature (lower Vf when hotter). This means that the drive current can vary a lot with temperature when the headroom is low. This is because the change in Vf becomes significant compared to the headroom.

author: xrunner
author_rank: Super Contributor
timestamp: June 09, 2013, 11:24:28 pm
content: Quote from: David_AVD on June 09, 2013, 11:20:54 pmOh yes, for sure. I think we're on basically the same page then. I had it all worked out on the prototype just fine, it's just that the green SMDs threw me a curve, because their combined drop was 6V.Onward and upward!

author: David_AVD
author_rank: Super Contributor
timestamp: June 09, 2013, 11:30:17 pm
content: For sure, if it works go for it. Being a non-commercial application you don't have to make sure it will work with substituted parts, etc. Sorry if I sounded like I was putting a damper on your idea. I just wanted you to know the pitfalls and why you saw some differences.

author: xrunner
author_rank: Super Contributor
timestamp: June 09, 2013, 11:31:30 pm
content: Quote from: David_AVD on June 09, 2013, 11:30:17 pmNot at all. It's hard to communicate all these technical details over a forum.

author: xrunner
author_rank: Super Contributor
timestamp: June 10, 2013, 02:28:57 pm
content: So here's the final test of the prototype with all SMD lights connected, and transistor drivers for the greens that are in series. Everything cycles properly and the brightness across all colors looks good.What it's simulating is a "T" intersection, with a main road being controlled in both directions (a traffic light for each direction), and the intersecting road with it's own light, being allowed to go when the main road is stopped and vice-versa.Now that it's finalized, I need to move on to gluing the SMD's in place, painting the traffic light body, working on how to hang them over the little road, running all the wires through holes to the underside of the layout, mounting the Arduino, powering it, and soldering up the proto board. This project will have taken more time than any other project on the layout so far.

author: Alana
author_rank: Frequent Contributor
timestamp: June 12, 2013, 05:02:24 pm
content: How about designing a current source switchable by TTL or 3V signal but capable of being powered from 12-15V AC/DC?

author: xrunner
author_rank: Super Contributor
timestamp: June 12, 2013, 05:12:27 pm
content: Quote from: Alana on June 12, 2013, 05:02:24 pmYea that's a possibility.Here's a short video of the traffic light project -

author: Alana
author_rank: Frequent Contributor
timestamp: July 05, 2013, 10:11:44 pm
content: Something i made quickly as a request from polish railway modeler's forums:Chips: 3x4011Layout: passing siding on which every train needs to stop - thats why "expect stop" on main signalI know its easier to use atmega or PIC but person who asked it would have to receive one programmed from me and almost everyone can solder few chips together when provided with schematics.

author: xrunner
author_rank: Super Contributor
timestamp: July 05, 2013, 10:19:47 pm
content: Nice. Is something on the tracks controlling the lights or is it going to be a manual thing for the operator?I finally got back to my traffic lights. I have them installed now but not wired up. That's the next step - wiring the electronics up under the table. Hello back pain.

author: Alana
author_rank: Frequent Contributor
timestamp: July 05, 2013, 10:44:41 pm
content: Thats a proof of concept - i wanted polish style signaling using only TTL/CMOS logic and i got a working device. Implementation depends on the person who gave me this task.But i have 2 unused gates that i could use for RS circuit to get what i saw in signal box. "Go" is set by push button and signals are automatically set to stop by passing train. The latter can be achieved by simple home made current relay using one of those glass tube signal relays and should work for both DC and DCC.There is one more thing i noticed. Polish modelers like to use modular design and travel with their modules to exhibitions or meetings away from home. In such setup its better to have something typical like 4011 or even electromechanical relays because its easy to get in any electronics store and easy to fix in few minutes using just a multimeter and soldering iron.

author: Alana
author_rank: Frequent Contributor
timestamp: July 18, 2013, 01:59:41 pm
content: My DCC system:function decoderi'm trying to testDCC ministation schematics and manualDCC Gen- page contains alternate firmware for DCC ministation that i find more usefull, aslo a great resource for many DCC related thingsIn attachment - homebrew booster system. I found several of those chips in latest dumpster dive and decided to use them in this el-cheapo setup.And... Dave - this project did not work

author: xrunner
author_rank: Super Contributor
timestamp: July 18, 2013, 06:22:06 pm
content: Nice work Alana. It's good to understand DCC at that level.Here's the final traffic lights in operation, and a pic of the Arduino mounted under the table. I will try to make a video of it today or tomorrow.

author: Alana
author_rank: Frequent Contributor
timestamp: July 24, 2013, 02:21:34 am
content: Nice stuff, especially assembling those traffic lights in 1:160 scale. What are dimensions of signal head?Have you thought of moving your traffic lights driver from arduino to some proto board with just atmega 8, oscilator, 7805 and those led driver circuts either now or when its completed?

author: xrunner
author_rank: Super Contributor
timestamp: July 24, 2013, 10:08:41 pm
content: Quote from: Alana on July 24, 2013, 02:21:34 amThanks - About 8 mm x 3 mm.QuoteNaw, not really. There's $9 Arduinos out there now so I'm not really concerned with using the whole thing for a project like this.

author: Alana
author_rank: Frequent Contributor
timestamp: August 02, 2013, 08:56:50 pm
content: sory about sound - made it today at model railway exhibition.Cars belong to one guy there and i was asked to fit lighting and for this one - forward lights for push-pull operation. DIY consists of making electric pickups and assembling 2 DDC decoders using schematic fromhttp://www.dccdiy.org.uk/index.html[page fails to load ATM] and programing those PICs.I may be doing more of them but probably based on different schematic and PIC program. This programing seems to be experimental and has only basic functionality and trying to change any configuration except decoder address crashes programing.One day i may do my own DCC decoder but at the moment I'm into simpler and more useful things like block occupancy detector and reverse loop for DCC.

author: rpm750
author_rank: Newbie
timestamp: August 03, 2013, 01:53:21 am
content: DCC is from what I understand an open platform. There was a standard setup from the beginning and any manufacture of decoder will work on another manufactures Control system. The functions from decoder to decoder are the same as well.It's a cool system, 12vdc with a super imposed AC signal on top of it. I work in the Instrumentation field and we have something similar called HART communication, which is over a 24v, 4/20mA loop.

author: Alana
author_rank: Frequent Contributor
timestamp: July 19, 2015, 06:35:32 am
content: This is last night job - big thx to EEVblog IRC chat guys who helped to debug it.Idea is that i have DCC controlled switches for "on the carpet" style layout that i can re-assemble as i want when i want. Switch is Piko 55227 and switch machine Piko 55271. Switch machine had to be modified with simple solder blob to bypass internal cut-off switch.Code for PIC is this:http://usuaris.tinet.cat/fmco/dccacc_en.html#dcc2coilh--> 2 turnout decoder but the same electronics will work with at least 3 other programs from that page.My work: making it into nice small smd board you see in the video and debugging it [bad case of "i hope your next project does not work"]And i have re-designed few boards from that webpage for my friends at model railway club so if someone wants protel files for them i'm open.