EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: xrunner on April 10, 2013, 06:45:50 pm

Title: My Model Railroad with Electronics
Post by: xrunner on April 10, 2013, 06:45:50 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on April 10, 2013, 09:48:33 pm
I like the DCC system.  Much easier to run multiple engines.   :)
Title: Re: My Model Railroad with Electronics
Post by: xrunner on April 10, 2013, 10:19:39 pm
I like the DCC system.  Much easier to run multiple engines.   :)

Hello 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.
Title: Re: My Model Railroad with Electronics
Post by: Skimask on April 10, 2013, 10:42:56 pm
I wanna play! :'(
Title: Re: My Model Railroad with Electronics
Post by: dr.diesel on April 10, 2013, 10:48:20 pm
Very nice!  Thanks for sharing.   :-+
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on April 10, 2013, 11:10:28 pm
I like that mini sodium light.   :)
Title: Re: My Model Railroad with Electronics
Post by: xrunner on April 10, 2013, 11:26:56 pm
I like that mini sodium light.   :)

Thanks. 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.  :P
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on April 10, 2013, 11:45:33 pm
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!   ;D
Title: Re: My Model Railroad with Electronics
Post by: xrunner on April 10, 2013, 11:58:28 pm
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!   ;D

I 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.  :-BROKE

P.S> I'm past the captcha thingy now.
Title: Re: My Model Railroad with Electronics
Post by: grego on April 11, 2013, 03:41:08 am
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.org (http://www.openlcb.org)

It's all open source and we're doing some pretty wild stuff with it right now.
Title: Re: My Model Railroad with Electronics
Post by: Alana on April 11, 2013, 06:34:01 am
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 zwrotka (https://www.youtube.com/watch?v=4jB3jodw_4s#)
Title: Re: My Model Railroad with Electronics
Post by: xrunner on April 11, 2013, 12:18:02 pm
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!

Interesting - I skimmed the documents but will look into it further later. I never heard of it until now.

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.

Impressive! I don't think I'll be attempting that!
Title: Re: My Model Railroad with Electronics
Post by: Alana on April 11, 2013, 02:54:00 pm
This was simple, making layout look pretty will be difficult :D
Title: Re: My Model Railroad with Electronics
Post by: xrunner on April 11, 2013, 07:04:46 pm
This was simple, making layout look pretty will be difficult :D

Well, 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.
Title: Re: My Model Railroad with Electronics
Post by: TheWelly888 on April 11, 2013, 08:14:40 pm
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/ (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.php (http://www.merg.org.uk/merg_resources/cbus.php)

There are also DCC stuff including kits! http://www.merg.org.uk/merg_resources/dcc.php (http://www.merg.org.uk/merg_resources/dcc.php)

Naturally there is a forum: http://www.merg.org.uk/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.
Title: Re: My Model Railroad with Electronics
Post by: Alana on April 12, 2013, 12:49:27 am
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.

Remember, you don't ever want to "finish" the layout. That would be a catastrophe.  :)
Now i "get it" why i loved that old station in Trainz and re-developed its layout over and over again.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on April 12, 2013, 11:46:51 pm
Here's some work I was doing to simulate traffic lights w/Arduino -

Traffic Lights 1 (https://www.youtube.com/watch?v=sLnFKZhTpP4#ws)
Title: Re: My Model Railroad with Electronics
Post by: xrunner on May 28, 2013, 05:48:40 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on May 28, 2013, 10:32:31 pm
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!   :)
Title: Re: My Model Railroad with Electronics
Post by: Rerouter on May 29, 2013, 03:08:27 am
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,
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 03:24:00 am
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/# (http://www.flickr.com/photos/eevblog/8873964675/#)
(http://farm4.staticflickr.com/3781/8873964675_7a2fd637e9_b.jpg)

(http://farm8.staticflickr.com/7353/8873963295_0bc214fa07_b.jpg)
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on May 29, 2013, 04:14:16 am
You might want to keep Sagan away from that for now.  Curious fingers kill model railways pretty quickly! (I speak from experience  :( )
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 07:10:13 am
You might want to keep Sagan away from that for now.  Curious fingers kill model railways pretty quickly! (I speak from experience  :( )

It'll be kept in the lab  ;D
Title: Re: My Model Railroad with Electronics
Post by: carbon dude oxide on May 29, 2013, 10:03:35 am
Automate it ^.^
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 10:10:47 am
Automate it ^.^

I've got an idea for a novel thing to try. But maybe someones done it, need to google it...
Title: Re: My Model Railroad with Electronics
Post by: IanJ on May 29, 2013, 10:40:12 am
Automate it ^.^

I've got an idea for a novel thing to try. But maybe someones done it, need to google it...

You're thinking about having it EEVBlog Reader controlled aren't you.......?

Ian.
Title: Re: My Model Railroad with Electronics
Post by: HackedFridgeMagnet on May 29, 2013, 11:28:28 am
Quote
I just picked up this n sale layout.
No idea what to do with it yet, very dusty!

Maybe Gomez from the Adams family, has some ideas?
Title: Re: My Model Railroad with Electronics
Post by: robrenz on May 29, 2013, 11:33:29 am
I am not into trains but this guy  (http://www.dallee.com/site_index.htm)is 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.
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 11:43:39 am
I am not into trains but this guy  (http://www.dallee.com/site_index.htm)is 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.

Nope, 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...
Title: Re: My Model Railroad with Electronics
Post by: xrunner on May 29, 2013, 12:57:04 pm
I've got an idea for a novel thing to try. But maybe someones done it, need to google it...

It'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/images/Traunstein_Ready_to_Run_N_scale.JPG)

http://www.iblproducts.com/Traunstein.htm (http://www.iblproducts.com/Traunstein.htm)

Looks 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.  :(
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 02:00:32 pm
I've seen that basic layout plan before, like this one with slightly different tracks?
(http://www.iblproducts.com/images/Traunstein_Ready_to_Run_N_scale.JPG)
http://www.iblproducts.com/Traunstein.htm (http://www.iblproducts.com/Traunstein.htm)
Looks 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.

Ah, was looking for that, thanks.
Yes, the back bridge is missing.
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 02:12:13 pm
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 (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.
Title: Re: My Model Railroad with Electronics
Post by: Alana on May 29, 2013, 02:57:29 pm
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?
Title: Re: My Model Railroad with Electronics
Post by: xrunner on May 29, 2013, 11:16:03 pm
I might very well retrack it to be a bit more versatile like in the manual and your photo.

Hey Dave you can model the outback on the layout!  :)

Do they runs trains through the outback?  :-//
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 11:34:19 pm
Hey Dave you can model the outback on the layout!  :)
Do they runs trains through the outback?  :-//

Yeah, one.
So that layout would be a single straight track, and red dirt  ;D
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 29, 2013, 11:35:59 pm
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?

The 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.
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on May 29, 2013, 11:51:48 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on May 29, 2013, 11:59:38 pm
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.

What type of boards? Using discrete components or what (you mentioned coding them).
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on May 30, 2013, 01:34:41 am
What type of boards? Using discrete components or what (you mentioned coding them).

One 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!)
Title: Re: My Model Railroad with Electronics
Post by: Neilm on May 30, 2013, 06:08:14 pm
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. :)
https://www.youtube.com/watch?v=HMsJ_P6d-zg (https://www.youtube.com/watch?v=HMsJ_P6d-zg)
This is called Bekonscot model village. This is literally in a back garden.

Neil
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on May 30, 2013, 11:04:46 pm
This is called Bekonscot model village. This is literally in a back garden.

Holy cow!   :o
Title: Re: My Model Railroad with Electronics
Post by: xrunner on May 30, 2013, 11:16:30 pm
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. :)

Oh don't worry - I'll never let it get out of hand.  :-DD
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on May 30, 2013, 11:49:29 pm
Holy cow!   :o

No, THIS is Holy Cow!

Miniatur Wunderland *** official video 2012 *** largest model railway / railroad of the world (https://www.youtube.com/watch?v=ACkmg3Y64_s#ws)

I've been there, it's even more awesome than it looks!
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 01, 2013, 09:50:20 pm
I know you can use DCC for this but it isn't that popular with Japanese modellers, mainly because everything is N or Z gauge and there are lots of models that would be hard to retrofit.

Hi 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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 02, 2013, 11:59:17 pm
And, well, for whatever reason DCC just isn't popular.

That'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.  :)
Title: Re: My Model Railroad with Electronics
Post by: C on June 03, 2013, 02:25:46 am
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
     
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 05, 2013, 09:39:57 pm
Yeah, most Japanese modellers use multiple loops to control multiple trains. I believe you can remove the switched power/frog power by removing screws from the underside.

I 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).
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 05, 2013, 10:42:19 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 06, 2013, 02:24:34 pm
Had some success soldering the 0603 SMD LEDs! Got a traffic light head filled.  :-+
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 06, 2013, 09:01:37 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 06, 2013, 09:23:49 pm
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.

The green SMD LED is bright. Really bright. 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!
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 06, 2013, 09:29:16 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 07, 2013, 12:25:36 am
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.   :)

Yea, and another good point is modelling real traffic lights with LEDs is valid, because real traffic lights are being constructed with LEDs now.

 :clap:

(http://lanecontrols.com/images/traffic-light.jpg)
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on June 07, 2013, 12:33:49 am
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.

Yep, 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  ;D
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 07, 2013, 12:55:49 am
It's been 30 years wince I had a train set  ;D

Same 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.  :-DD

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.  :-/O

Title: Re: My Model Railroad with Electronics
Post by: EEVblog on June 07, 2013, 01:04:00 am
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.

The last thing I need is another advanced hobby that will suck my time!
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 07, 2013, 01:06:00 am
The last thing I need is another advanced hobby that will suck my time!

LOL - 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.  :o
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on June 07, 2013, 01:12:20 am
Truthfully, I don't know how you  are doing all you are doing anyway. You must be one Hell of a multitasker.  :o

Multitasking 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  ;D
Title: Re: My Model Railroad with Electronics
Post by: jh15 on June 07, 2013, 02:29:31 am
Yes! Give it all to Sagen before it's too late. We need your time here.
Title: Re: My Model Railroad with Electronics
Post by: EEVblog on June 07, 2013, 02:46:33 am
Yes! Give it all to Sagen before it's too late.

He already broke the train station roof!
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 07, 2013, 02:58:27 am
Yes! Give it all to Sagen before it's too late.

He already broke the train station roof!

Inevitable I'm afraid.  Been there, had that happen.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 07, 2013, 08:56:19 pm
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.   :)

Another 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.

He already broke the train station roof!

Maybe modelling the outback isn't such a bad idea after all.  ;) (at least for now)
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 07, 2013, 11:04:26 pm
Another odd thing is how the SMD LEDs mark the cathode.

Yeah, you can never assume.  I always test one out of a batch to confirm before loading them onto boards.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 08, 2013, 11:06:46 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 09, 2013, 03:44:00 pm
Ran into a small problem.  :)

When I swapped the SMD lights into the Arduino + breadboard, the green LEDs were very dim. 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.

or

I 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.

Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 09, 2013, 09:49:35 pm
You should be able to use any of those LEDs on a 5V supply.  Is the Arduino output really 5V?
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 09, 2013, 10:40:38 pm
You should be able to use any of those LEDs on a 5V supply.  Is the Arduino output really 5V?

Yea, sorry David I didn't explain fully. I'm using several of the outputs to drive two LEDs 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.  :-//
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 09, 2013, 10:57:42 pm
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.   :)
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 09, 2013, 11:14:41 pm
Using two LEDs in series from 5V is never going to be a good idea.

Why 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.  :)
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 09, 2013, 11:20:54 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 09, 2013, 11:24:28 pm
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.

Oh 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.  |O

Onward and upward!
Title: Re: My Model Railroad with Electronics
Post by: David_AVD on June 09, 2013, 11:30:17 pm
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.   ;D
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 09, 2013, 11:31:30 pm
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.   ;D

Not at all. It's hard to communicate all these technical details over a forum.  :-/O
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 10, 2013, 02:28:57 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: Alana on June 12, 2013, 05:02:24 pm
How about designing a current source switchable by TTL or 3V signal but capable of being powered from 12-15V AC/DC?
Title: Re: My Model Railroad with Electronics
Post by: xrunner on June 12, 2013, 05:12:27 pm
How about designing a current source switchable by TTL or 3V signal but capable of being powered from 12-15V AC/DC?

Yea that's a possibility.

Here's a short video of the traffic light project -

Traffic Light Progress (https://www.youtube.com/watch?v=UVI0wFPyK10#ws)
Title: Re: My Model Railroad with Electronics
Post by: Alana on July 05, 2013, 10:11:44 pm
Something i made quickly as a request from polish railway modeler's forums:
main signal with distant signal (https://www.youtube.com/watch?v=QRRlUEzhqnc#)

Chips: 3x4011
Layout: passing siding on which every train needs to stop - thats why "expect stop" on main signal

I 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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on July 05, 2013, 10:19:47 pm
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.

Title: Re: My Model Railroad with Electronics
Post by: Alana on July 05, 2013, 10:44:41 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: Alana on July 18, 2013, 01:59:41 pm
My DCC system:
my home made DCC (https://www.youtube.com/watch?v=fyr-kraFFSk#)

function decoder (http://www.dccdiy.org.uk/function.html) i'm trying to test
DCC ministation schematics and manual (http://www.minidcc.com/instruct.htm)
DCC Gen (http://usuaris.tinet.cat/fmco/home_en.htm) - page contains alternate firmware for DCC ministation that i find more usefull, aslo a great resource for many DCC related things

In 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 :D
Title: Re: My Model Railroad with Electronics
Post by: xrunner on July 18, 2013, 06:22:06 pm
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.
Title: Re: My Model Railroad with Electronics
Post by: xrunner on July 19, 2013, 11:37:45 pm
N Scale Traffic Lights (https://www.youtube.com/watch?v=7h3pC_BlALg#ws)
Title: Re: My Model Railroad with Electronics
Post by: Alana on July 24, 2013, 02:21:34 am
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?
Title: Re: My Model Railroad with Electronics
Post by: xrunner on July 24, 2013, 10:08:41 pm
Nice stuff, especially assembling those traffic lights in 1:160 scale. What are dimensions of signal head?

Thanks - About 8 mm x 3 mm.

Quote
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?

Naw, 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.
Title: Re: My Model Railroad with Electronics
Post by: Alana on August 02, 2013, 08:56:50 pm
home made DCC car lighting (https://www.youtube.com/watch?v=TdoMiBaxxSQ#)
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 from http://www.dccdiy.org.uk/index.html (http://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.
Title: Re: My Model Railroad with Electronics
Post by: rpm750 on August 03, 2013, 01:53:21 am
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. (https://www.youtube.com/watch?v=6g55KbuIikM/url)
Title: Re: My Model Railroad with Electronics
Post by: Alana on July 19, 2015, 06:35:32 am
This is last night job - big thx to EEVblog IRC chat guys who helped to debug it.
https://www.youtube.com/watch?v=WfHnE0xE_tQ (https://www.youtube.com/watch?v=WfHnE0xE_tQ)
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 (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.