Directional lights on Radio Controlled locos?

Douglas McLay

Registered
17 Jun 2020
5
0
73
Castle Gresley, Derbyshire
Best answers
0
Hi everyone, I'm new here so please be gentle with me :)

Ive just got my railway running, and am now building up my fleet of radio controlled battery powered locos. The first ones I got were cheap toys, but they didnt last long!! So now Im converting better quality pre loved (!) track powered locos to radio control.. So far Ive converted Bachmann 4 6 0 chassis with one of my toy bodies fitted and a Piko mainline BoBo diesel using Arduinos and H Bridges as ESCs. They worked pretty well once I'd fine tuned the programme, but I have been unable to fathom out how to make the directional lights work.

My Piko diesel had headlights built in, which on track power lit up depending on direction. These were wired up to the motors, so in my niavity I just left them like that when I fed the motor from the ESC. But although the forward lED lit up, the rear one flickered brightly too. When the loco is running on high throttle levels its difficult to see which end is the brighter........

I am thinking that this must be some effect of the PWM voltage wave pattern on the IEDs, but its beyond me to work out why that is, and therefore how to cure it. Anyone got any ideas, or experienced something similar?

The only circuitry info I have from Piko is in the owners manual, and it is a bit schematic. It looks as if the three headlights at each end are fed in parallel from the motor, with each LED having its own series resistor.

The only
 
Last edited:

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
33,562
3,521
Nottingham
Best answers
0
Country flag
Use your forward/reverse information to switch another pin off/on.. One of more pins per direction. - Dependent on lighting load. Simplees! :nerd:
 
  • Like
Reactions: 1 user

JimmyB

Now retired - trains and fishing
23 Feb 2018
6,947
921
69
Weston-super-Mare
www.tumble-down-falls.co.uk
Best answers
0
Country flag
I have my battery powered locos' lights (LEDs) wired from the motor input (with the appropriate resistor) and as the voltage changes polarity the lights change, and using bi-coloured LEDs, I have white going forward at the front and red at the rear, reversing and I reverse power.
 

Rhinochugger

Retired Oik
27 Oct 2009
36,715
4,240
North West Norfolk
Best answers
0
Country flag
Yeah, there's 101 ways of killing a cat, but with the ESCs that Douglas is using, Philp's suggestions are probably the way to go.

If you use other, proprietary ESCs, then you can wire the lights from the ESC, and if you don't use LEDs, then you can simply put a diode in the circuit to do the same job unless the ESC gives you directional lighting.

I tend to prefer LEDs 'cos, as you say Jimmy, it makes life pretty easy - until you take the loco apart and wire the motor up the wrong way round - don't ask me how I know :wasntme::wasntme:
 

Douglas McLay

Registered
17 Jun 2020
5
0
73
Castle Gresley, Derbyshire
Best answers
0
Use your forward/reverse information to switch another pin off/on.. One of more pins per direction. - Dependent on lighting load. Simplees! :nerd:
Yeah, there's 101 ways of killing a cat, but with the ESCs that Douglas is using, Philp's suggestions are probably the way to go.

If you use other, proprietary ESCs, then you can wire the lights from the ESC, and if you don't use LEDs, then you can simply put a diode in the circuit to do the same job unless the ESC gives you directional lighting.

I tend to prefer LEDs 'cos, as you say Jimmy, it makes life pretty easy - until you take the loco apart and wire the motor up the wrong way round - don't ask me how I know :wasntme::wasntme:
 

Douglas McLay

Registered
17 Jun 2020
5
0
73
Castle Gresley, Derbyshire
Best answers
0
Thanks for the replies. Some useful ideas.

I think I'll look at Philips approach is the answer for my Arduino based ESCs. However not quite as straightforward as I'd first thought!

The first project that I want to get finished is my Piko Diesel, but it's triple headlights probably will draw too much current to be driven directly from an Arduino output pin, so to be safe I will need to use a solid state switch to protect the Arduino. Ive just ordered some on ebay, but as they are coming from China, so it will be a while before I can report back.

I had in mind using two colour LEDs too, but for reasons I don't understand I cant drive them directly from the motor feed when using my Arduino solution. The directional diodes dont work as I'd imagined. Ive tried a variety of solutions without any success, so I've decided to look at another solution. I do have a loco with working lights and an Mtroniks ESC, but it has incandescent lights so tells me nothing!
 

Rhinochugger

Retired Oik
27 Oct 2009
36,715
4,240
North West Norfolk
Best answers
0
Country flag
Well, as you have found out, it's a great life >:)>:)>:)>:)

One would have thought that there might have been some sort of common approach ......................... :smoke::smoke::smoke::smoke::smoke:


I even came unstuck with colour changing LEDs, because I bought one which had the wrong common polarity. So that just shows the potential for *uck *ock ups mishaps.

I think, if I were to try and undertake some sort of analysis of all the various issues in this scale, current draw would come top of the pile - across all aspects.

So, that's quite a good place to start - to find the various bits of kit required for a battery conversion that will meet the current requirement (s'cuse the pun) :nerd::nerd:

After that ..................... talk to the intelligent people who understand these issues - I'm a devout bodger :nod::nod::nod:

Philp in another life is R C Trains RC Trains Radio Controlled Trains - Home Page
 

Tony Walsham

Manufacturer of RCS Radio Control.
25 Oct 2009
2,221
50
Casino, NSW
Best answers
0
Country flag
If you want something simple to install and operate you might consider the plug in, inline RCS supplied # MRW-SSLS.

MRW-SSLS-text.jpg

Instructions.
 

Michael

Registered
26 Jan 2010
139
16
Best answers
0
Country flag
Welcome to the forum.

I have used Arduinos for my locos in the past but have now switched to ESP8266s as they are more powerful and have integrated 2.4GHz wifi. I have used both 2 diodes back to back and a bi-coloured diodes in parallel with a PWM powered motor (with the appropriate resistors) without a problem, they varied in brightness with speed as expected so it does work.

For driving LEDs etc. from an Arduino I've either used a MOSFET or the ULN2003 series darlington drivers. The latter I've been using for 40 odd years so there is probably a more modern equivalent that I'm unaware of. :)

Some pictures would be nice and what remote device are you using?

Michael
 
8 Mar 2014
7,806
972
San Diego
Country
Armenia
www.elmassian.com
Best answers
0
Country flag
so the OP is using an Arduino and an "H bridge" shield (or just an H bridge) to form his own ESC.

There are tons of GPIO pins, so drive the LEDs from that.

The flickering of the "reverse" LED in forwards motion indicates a LOT of BEMF... so you could try solving that problem with how you drive the motor, but why?

Use the GPIO pins for all the lighting, they are at least 20 milliamps each... plenty to handle, and with the 5v typical voltage, even the dropping resistor is smaller...

Greg
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,169
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Welcome to the forum.

I have used Arduinos for my locos in the past but have now switched to ESP8266s as they are more powerful and have integrated 2.4GHz wifi. I have used both 2 diodes back to back and a bi-coloured diodes in parallel with a PWM powered motor (with the appropriate resistors) without a problem, they varied in brightness with speed as expected so it does work.

For driving LEDs etc. from an Arduino I've either used a MOSFET or the ULN2003 series darlington drivers. The latter I've been using for 40 odd years so there is probably a more modern equivalent that I'm unaware of. :)

Some pictures would be nice and what remote device are you using?

Michael
Interesting re the ESP’s, is the coding the same as for Arduinos?
 

Michael

Registered
26 Jan 2010
139
16
Best answers
0
Country flag
Interesting re the ESP’s, is the coding the same as for Arduinos?

Yes, programming the ESP8266 is virtually the same as for an Arduino. You use the standard Arduino IDE and simply add the ESP8266 board manager.
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,169
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Yes, programming the ESP8266 is virtually the same as for an Arduino. You use the standard Arduino IDE and simply add the ESP8266 board manager.
oops sorry very new to thinking about Arduino. IDE? 8266 Board Manager presumably some code?
 

Michael

Registered
26 Jan 2010
139
16
Best answers
0
Country flag
The Arduino IDE is the development environment that allows the user to write the code and download it to the Arduino/ESP8266. The main code for the Arduino and ESP8266 are mostly the same but there are minor differences to some of the libraries. The board manager allows you to select which processor you are using. Here's the "Hello World" type blink program.

Image5.jpg


PS Jon, when I'm eventually allowed to visit my Mum in the care home near St. Neots and social distancing rules are relaxed, I hope to take up your offer to view your railway. Will then be able to give you a demonstration.
 

Rhinochugger

Retired Oik
27 Oct 2009
36,715
4,240
North West Norfolk
Best answers
0
Country flag
I'm lost, and I can't work out what Tony Walsham's MRW-SSLS does, 'cos I couldn't locate it on his website :confused::confused:
 

PhilP

G Scale, 7/8th's, Electronics
5 Jun 2013
33,562
3,521
Nottingham
Best answers
0
Country flag

Tony Walsham

Manufacturer of RCS Radio Control.
25 Oct 2009
2,221
50
Casino, NSW
Best answers
0
Country flag
Hi Phil.

Thanks for the input.
The # SSLS is part of a quite large range of R/C switches I stock.
Apart from the # SSLS there are single function triggers on one channel and dual functions per channel.
Plus lighting and sound effects.

R/C switches.

Yes, they are a problem to ship thanks to COVID-19.
They once cost just A$ 3 to post by air to anywhere in the World at the large Letter rate.
Now the minimum is A$ 25 to the UK.
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,169
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
The Arduino IDE is the development environment that allows the user to write the code and download it to the Arduino/ESP8266. The main code for the Arduino and ESP8266 are mostly the same but there are minor differences to some of the libraries. The board manager allows you to select which processor you are using. Here's the "Hello World" type blink program.

View attachment 268571


PS Jon, when I'm eventually allowed to visit my Mum in the care home near St. Neots and social distancing rules are relaxed, I hope to take up your offer to view your railway. Will then be able to give you a demonstration.
That would be great, look forward to demonstrating the DR to you.
 

dunnyrail

DOGS, Garden Railways, Steam Trains, Jive Dancing,
Staff member
GSC Moderator
25 Oct 2009
26,169
4,993
75
St.Neots Cambridgeshire UK
Best answers
0
Country flag
Always on the lookout for interesting stuff, thanks to Michael and Rik I am convinced that an Arduino will be what I am looking for. There are a few other issues that I need to resolve in my head but YouTube will probably help me out. Plus hopefully a visit by Michael to view my line when possible will be a great help, I am one if those that need to see and be demonstrated to my face sometimes before I get things. However for those interested in this sort of stuff I found this interesting YT Vid comparing RasperiPi and Arduino, it cleverly talks about what would be appropriate for each one highlighting Ardunino’s strengths for what I would like to do.