Skip to main content

This discussion started in another thread, and I thought it should stand on it's own, so I'm starting it here.

The issue is how to control feature of rolling stock based on the locomotive situation or direction of travel.  Examples would be untethered subway car lighting, untethered dummy locomotive lighting, etc.  I looked around and found these RF transmitter and receiver pairs.  The nice thing about this set is it's a learning code pair, so you can pair the locomotive transmitter with the receiver and have it only react to that environment.  Another neat feature is one receiver can be trained to recognize multiple transmitters, thus adding to the flexibility.  Each transmitter and receiver handles four channels, so depending on the mode of operation, you can control multiple functions, a nice feature as well.  Finally, the transmitter/receiver pair are only around $2 a set!

The receiver has three modes of operation, they look to be flexible enough to cover a lot of situations.

  1. Momentary: This simply activates the receiver channel whenever the corresponding transmitter channel is triggered.
  2. Toggle mode: This toggles the respective receiver output state for each corresponding transmitter channel trigger.
  3. Interlocked mode: This activates the selected channel, all other channels are deactivated.

 

The mode where one channel latches until another channel is triggered sounds like just what we'd need for a simple backup light scenario.  The only thing that would have to happen is for a small circuit to send a pulse when the backup light comes on or off.  If we're talking about a diesel or electric, the directional lighting can provide the pulse to two channels, one for on, and one for off. 

The really cool thing is, if you're talking about PS/2, you could tie into one of the seldom used functions like strobe light and have it do a function at the other end as well.

 

 

The receiver and transmitter are each 99 cents, so they're not out of reach.

Mini Wireless 433Mhz RF Remote Control 1527 Learning Code Transmitter Module

Size: 1.8×1.8cm/0.71×0.71in

433mhz Wireless RF Receiver 1527 Learning Code Decoder Module For Remote Control

Size: 28×12.3mm/1.10×0.48in

For convenience, I've attached the captured descriptions.

433Mhz RF Remote Control 1527 Learning Code Reciever.pdf

433Mhz RF Remote Control 1527 Learning Code Transmitter.pdf

Original Post

Replies sorted oldest to newest

GRJ: You're a trail-blazer for sure!

When my Mother was still with us, I rigged a wireless (key fob) remote for her to use to turn on lights in the living room and to activate some buzzers in other parts of the house. They worked well throughout their usefulness. They were similar to the units that you have mentioned in that they could learn the codes so that additional remotes could be utilized.

These units look to be the right size for what you may have planned. Good find!

-- Leo

We shall see.  I did setup a test on my bench, and all the modes work as I expected.  I ordered a bunch of them as I can see using them for a couple of neat projects.  I will have to do some minor mods before I can use them.  First off, I have to interface them to some non-TTL inputs, and I also need a power supply for each end. 

I'm thinking I can pull the right angle connector off and use straight pins and just sandwich then with a motherboard that supplies the support circuits and power supply.

I just used one of the relay models that is similar to remote my doorbell so I can hear it downstairs in my workshop.

It sounds like mounting these modules onto a supporting motherboard is the way to go for this type of project. In fact that seems to be a consistent approach for things like microprocessors in general. They all need supporting hardware in order to complete the designated task.

Sounds good to me. Trail-blazing can be interesting. But watch out; the pioneers take the arrows!

gunrunnerjohn posted:

Well, it could.  However, probably a better choice for an easy install would be one of the relay based models with a keybob remote, they're only a couple bucks on eBay as well.

eBay: 253412786388, $3.81 shipped free.

I discovered the 4 relay version of these a few years ago.  

for trains, I've set them up to:

- trigger sound in my sound car designs

- trigger a helicopter car to launch anywhere on the layout

- trigger a bump n go trolley to make it work "magically" with kids

- trigger accessories on the layout

non train? I use 'em for:

cheap garage door remote

car power door lock additional transmitters

 etc.

On eBay, one of the sellers has a 2 relay unit that is a bit better....it can be powered with 12-24v DC or AC.... that makes 'em O gauge powered with no additional electronics! 

 

 

Stan had brought up the issue of these cheap transmitters operating continuously and thus not allowing for the possibility of multiple systems in the same area.  I've been thinking about that issue.

One approach is to bring in the input signal, condition it, and feed it to a microprocessor.  The uP would then do a simple encoding of the status and send out a brief (100-200 millisecond) encoded state for the input.  With four bits, I could transmit up to 8 states using three of the bits, (probably 7 as 000 would not be recognized by the transmitter).  The 4th bit indicating the state of the input, active or inactive.  The transmissions would only take place once during initialization to set the initial states of each input, and then only upon a change in the input state.  This would consume very low bandwidth and allow for many of these systems to coexist if desired.

The receiver could then send this simple encoded signal to another uP for the decode.  That uP would convert the signal into the desired action, for a backup light for instance, it would simply toggle it on by command until it received an "off" indication.  If you were triggering a coupler, it would trigger it for perhaps 1/4 second, similar to what the TMCC or DCS system handles them.

I need a motherboard anyway for signal conditioning on the inputs and of course the DC power for the radios.  For the receiver, I'll also have signal drivers of some sort, depending on what capabilities we envision this link having.

I'm also thinking of routing serial data to the uP in the case of TMCC or Legacy and being able to trigger events based on the serial data stream.

gunrunnerjohn posted:
MWasko posted:

 I have a musical boxcar (6-26815) that pays off a 9v battery. It would be nice to have it play without having to remove it from the track since the on/off switch is under the boxcar. Would this second item(eBay: 253412786388) work at 9v?

Mark

Mark, it would likely be marginal if it worked at all on 9V, it's a 12V relay they use.

There are very small 12 volts Li-on batteries available.  While still larger than a 9 volt battery, they may work in your application.

Type this in on Ebay;

Mini Portable DC-168 12V 1800mAh Rechargeable Li-ion Battery Pack for CCTV Cam

MWasko posted:

 I have a musical boxcar (6-26815) that pays off a 9v battery. It would be nice to have it play without having to remove it from the track since the on/off switch is under the boxcar. Would this second item(eBay: 253412786388) work at 9v?

Mark

As GRJ says, that receiver uses a 12V relay.  The way that eBay receiver board is designed, you can replace the 12V relay with a 9V relay so that it would work with a 9V battery.  You can buy the 9V relay for about $1 on eBay (search for "SRD-09VDC-SL-C").  But this does involve soldering rework of 5 terminals which may not be in your comfort zone.  I suppose you could get lucky and find a receiver board with a 9V relay already installed...but I figure the 12V version (automotive applications and such) might be the only readily available variant. 

srd 9v relay

A 2nd consideration for your intended application is the so-called stand-by power required by the receiver.  In other words, it consumes 9V battery power 24/7 just listening for the radio control signal to turn on.  As stated in the eBay listing, the standby power is somewhere in the 5 mA range.  There's some tedious math that I'll skip over, but this basically means a 9V alkaline battery would deplete in a matter of days (less than a week) just sitting there doing "nothing"!   But wait!  There's more!  Then, even if you're in the zone where the battery is still good, when you remotely activate the receiver relay to play the music, the active relay itself draws about as much battery power as the music player!  So you'll be changing batteries that much more often. 

Attachments

Images (1)
  • srd 9v relay
Last edited by stan2004
Ron464nyc posted:

John,could this be used to turn on/off hotbox reefer? Thanks man. Always thinking outside the box! 

Lionel's "hotbox" as well as MTH's smoking tankcar, animated boxcar and caboose were what came to mind for me especially if you could easily and economically incorporate a simple Bluetooth (BT) power on/off switch.  BT would allow individual addresses for each item and you could control various units w/ smartphone and/or tablet.

stan2004 posted:
MWasko posted:

 I have a musical boxcar (6-26815) that pays off a 9v battery. It would be nice to have it play without having to remove it from the track since the on/off switch is under the boxcar. Would this second item(eBay: 253412786388) work at 9v?

Mark

As GRJ says, that receiver uses a 12V relay.  The way that eBay receiver board is designed, you can replace the 12V relay with a 9V relay so that it would work with a 9V battery.  You can buy the 9V relay for about $1 on eBay (search for "SRD-09VDC-SL-C").  But this does involve soldering rework of 5 terminals which may not be in your comfort zone.  I suppose you could get lucky and find a receiver board with a 9V relay already installed...but I figure the 12V version (automotive applications and such) might be the only readily available variant. 

srd 9v relay

A 2nd consideration for your intended application is the so-called stand-by power required by the receiver.  In other words, it consumes 9V battery power 24/7 just listening for the radio control signal to turn on.  As stated in the eBay listing, the standby power is somewhere in the 5 mA range.  There's some tedious math that I'll skip over, but this basically means a 9V alkaline battery would deplete in a matter of days (less than a week) just sitting there doing "nothing"!   But wait!  There's more!  Then, even if you're in the zone where the battery is still good, when you remotely activate the receiver relay to play the music, the active relay itself draws about as much battery power as the music player!  So you'll be changing batteries that much more often. 

I don't mind soldering although I'm no pro.

I would have to open up the boxcar again, but if I can install this board(with the 9v relay) in after the on/off switch that is there now that should solve the battery drain while not running my layout. I I'm still taking it of the track to hit the switch. This way I can hit the switch before I start the train and start/stop the music while the train is moving. The way it is now you have to stop the train and take the car of the track every time you start/stop music.This is for the grandkids on a under Christmas tree layout, so I only run this car about  2-3-months a year.

 

Mark

Dan Padova posted:
gunrunnerjohn posted:
MWasko posted:

 I have a musical boxcar (6-26815) that pays off a 9v battery. It would be nice to have it play without having to remove it from the track since the on/off switch is under the boxcar. Would this second item(eBay: 253412786388) work at 9v?

Mark

Mark, it would likely be marginal if it worked at all on 9V, it's a 12V relay they use.

There are very small 12 volts Li-on batteries available.  While still larger than a 9 volt battery, they may work in your application.

Type this in on Ebay;

Mini Portable DC-168 12V 1800mAh Rechargeable Li-ion Battery Pack for CCTV Cam

This would also solve the problem of batter replacement. I can have the female barrel inside the boxcar and just open the door to access it rather that having to open it up.

I now have a couple ideas.  Thanks

 

 

Mark

 

 

Wondering if a number of these could be used in cars, etc. on the layout and the TMCC cab remote trigger them selectively with one TMCC device like a switch or something TMCC controller to activate the specific WiFi controllers. A way to always have just one TMCC remote in your hand and remotely control without the cost of separate Mini Commanders.

I have been looking on-line and watching some YouTube videos.

Would this combo work in my musical boxcar?

EBay :DC5V/DC5V-12V Self-lock Smart WiFi Wireless Switch Relay Module APP Control with a USB rechargeable 9V like  EBay: 142545740433

Could I use it when my tablet/phone is connected to the MTH wifi, while I'm connected to my DCS explorer? Could I just switch apps?

OR I  want to connect to a ECHO at some point would this one work? EBAY:Sonoff WiFi Wireless Smart Switch Relay Module Inching/Self-Locking Smart 5V 32V

I also seems to me that you can command multiples of these in the app.

 

Mark

 

cjack posted:

Wondering if a number of these could be used in cars, etc. on the layout and the TMCC cab remote trigger them selectively with one TMCC device like a switch or something TMCC controller to activate the specific WiFi controllers. A way to always have just one TMCC remote in your hand and remotely control without the cost of separate Mini Commanders.

I don't have a TMCC cab remote, but to the idea of using an existing train remote, here's what a DCS user can do with the key fob "technology" shown earlier.  The MTH DCS-AIU outputs are just relay contact-closures.  The AIU can therefore electronically "push" the individual buttons of the key fob.  I show this on a 4-channel version on the O gauge archive here.    A photo and video from that writeup:

4channelremotefobattachedtoaiu

 

 

Attachments

Images (1)
  • 4channelremotefobattachedtoaiu

Stan, with the little transmitter module I am using here you can just supply DC voltage to it and wire it directly to a TMCC controller like the SC2 or ASC and perform the functions with the TMCC remote. You could hack that transmitter you show as well of course.

I like the fact that the receiver has multiple modes, toggle, momentary, and interlocking, gives you a bit of flexibility in using it.

Of course, the original topic of this thread was to do stuff from the locomotive and trigger other actions in other cars on the train.

gunrunnerjohn posted:

Well, I looked at those and then looked at the application reviews on Google Play Store, and unless they've updated the application in the last week or two, I doubt I'd want to waste my money on these.  I like the idea, but they only work with the one app and it seems pretty flaky.

Thanks for taking a look. So I'll go with your original board eBay: 253412786388 and solder in a 9v relay as Stan2004 suggested. I'll order a UBS charging battery. I looks like the delivery time is long on some of these items so I'll post and update when I get this working.

 

Thanks to everyone for their input!

Mark

I think there are 2 overlapping aspects to this conversation.  1) What it is, 2) How to do it.  While there is a necessary and useful back-and-forth between the What and How, it seems threads like this get bogged down.

I believe the What needs to play out more.  In other words, I for one would like to hear more ideas on What guys would want to do with control of rolling stock.  I am 100% on-board with the original idea of sync'ing the directional or classification lighting of a slave/trailing engine to the master/lead engine.  But I'm curious about other animation functions slaved to engine behavior...or that would make sense to be remotely-controlled via the engine.

Separately, there's How.  As you've mentioned earlier, the challenge with the 99 cent "garage-door-opener" modules is how to shut up the transmitter so that the RF channel is available for other layout devices.  This being in contrast to Bluetooth, Wi-Fi, or similar wireless modules/technologies that have the inherent ability to co-exist or play well with others.  As you point out, what's neat about the so-called "learning" receiver module you found is the latching mode.  This mode was not available on the original eBay 99 cent receivers.  So with latching mode, you can send a short RF signal to turn on the back-up light and it latches on...and then minutes or hours later send a separate short RF signal to turn off the back-up light and it latches off.  And for all the time between direction changes, the RF channel is available for other devices on the layout to do the same. 

What's not clear to me is how a custom 50 cent microcontroller would play into a practical solution for the average O-gauger.  Would this be a one-off proof-of-concept or would there be an actual order-able, no-soldering-required kit?  Or something in between... like a link to a circuit board layout that one orders from OSH-Park and maybe a downloadable software image that runs on an Arduino Nano.  I initially thought a rudimentary implementation would be some kind of discrete timer circuit (no software) that momentarily pulses the transmitter with the ON/Reverse command when it detects the engine's backup light turning on.  The timer circuit would additionally momentarily pulse the transmitter with the OFF/Forward command when it detects the engine's backup light turning off.  The receiver module would be set to the latching mode.  

MWasko posted:
 
… I'll go with your original board eBay: 253412786388 and solder in a 9v relay as Stan2004 suggested. 
This being a discussion forum...
 
SRD relay
Don't try this at home  but it occurred to me that you might be able to simply remove the 12V relay (unsolder the 5 terminals in yellow box) and drive the music module with the relay coil voltage!  In other words, when the module is triggered, it applies 9V (or whatever DC battery voltage you have) to the two coil terminals of the relay.  The relay then closes and then applies the same 9V DC via the relay contacts to the music module.  Skip the middle man (the relay).  Obviously the 10 Amp switching capability of the relay is overkill for this application!
 
There are i's to dot and t's to cross.  First is to determine the +/- polarity correct as to which coil terminal gets which polarity when triggered...that should be easy to determine by inspection or measurement.  Another would be to confirm the transistor that drives the relay coil has enough power to drive the music module.  That's a little more involved and would require, say, measuring some DC currents with a meter.
 
Anyway, just thinking out loud here.    Perhaps this approach (removing the relay) could be used in other remote-control-of-rolling-stock applications of, say, a few LED lights where you don't need the high current capability of a relay. 
 

 

Attachments

Images (1)
  • SRD relay
Last edited by stan2004
MWasko posted:
... I'll order a UBS charging battery. 

That USB 9V battery is pretty slick!  Just curious though how you plan to access the charging port given the construction of the boxcar and orientation of the battery.  Though I suppose you might be able to get thru one holiday season with a single battery charge if used in conjunction with the on/off slide switch before and after operating sessions.

9v usb battery  

Attachments

Images (1)
  • 9v usb battery
stan2004 posted:

I think there are 2 overlapping aspects to this conversation.  1) What it is, 2) How to do it.  While there is a necessary and useful back-and-forth between the What and How, it seems threads like this get bogged down.

I believe the What needs to play out more.  In other words, I for one would like to hear more ideas on What guys would want to do with control of rolling stock.  I am 100% on-board with the original idea of sync'ing the directional or classification lighting of a slave/trailing engine to the master/lead engine.  But I'm curious about other animation functions slaved to engine behavior...or that would make sense to be remotely-controlled via the engine.

Separately, there's How.  As you've mentioned earlier, the challenge with the 99 cent "garage-door-opener" modules is how to shut up the transmitter so that the RF channel is available for other layout devices.  This being in contrast to Bluetooth, Wi-Fi, or similar wireless modules/technologies that have the inherent ability to co-exist or play well with others.  As you point out, what's neat about the so-called "learning" receiver module you found is the latching mode.  This mode was not available on the original eBay 99 cent receivers.  So with latching mode, you can send a short RF signal to turn on the back-up light and it latches on...and then minutes or hours later send a separate short RF signal to turn off the back-up light and it latches off.  And for all the time between direction changes, the RF channel is available for other devices on the layout to do the same. 

What's not clear to me is how a custom 50 cent microcontroller would play into a practical solution for the average O-gauger.  Would this be a one-off proof-of-concept or would there be an actual order-able, no-soldering-required kit?  Or something in between... like a link to a circuit board layout that one orders from OSH-Park and maybe a downloadable software image that runs on an Arduino Nano.  I initially thought a rudimentary implementation would be some kind of discrete timer circuit (no software) that momentarily pulses the transmitter with the ON/Reverse command when it detects the engine's backup light turning on.  The timer circuit would additionally momentarily pulse the transmitter with the OFF/Forward command when it detects the engine's backup light turning off.  The receiver module would be set to the latching mode.  

Stan, to be clear, I'm not complaining about your input, rarely do I see any issue with what you say.

My concept is indeed to lay out two little support boards, one for each end.  They would have the uP, input signal conditioning circuitry for the tranmitter, output drivers for the receiver, and of course, the power supply for the receiver or transmitter.

The uP is necessary, at least in my mind.  If I'm triggering on something like the backup light coming on, the question arises as to how I terminate the transmission.  Obviously, if we can come up with something with sufficient flexibility that doesn't require the uP, that would likely be a better plan, easier for anyone to build and use.

One reason I'm looking at extra circuits is in order to make this truly semi-universal, I believe you'll need opto isolation on the transmitter inputs.  Given that many signals, especially on DCS and later Legacy, have no common ground, I wouldn't want to cause issues trying to tap into them.  My vision if for stuff like lights, couplers, smoke, and of course I'd probably do one senses the motor voltage (motion sensing). 

There would probably only be two or three transmit inputs by my way of thinking, but the purpose of this thread was to get some more input as to what people envision something like this unit being used for.

stan2004 posted:
MWasko posted:
... I'll order a UBS charging battery. 

That USB 9V battery is pretty slick!  Just curious though how you plan to access the charging port given the construction of the boxcar and orientation of the battery.  Though I suppose you might be able to get thru one holiday season with a single battery charge if used in conjunction with the on/off slide switch before and after operating sessions.

9v usb battery  

The door on behind the Hobo does open. There is just a foam strip attached to the inside of the door to hold it closed. I removed the foam an can tuck a 6" USB cable between the door an that back wall and run it over to the battery in its holder. There are already two wires running back there from the battery to the music unit.

Even if the remote control upgrade fails, I am going to upgrade the battery.

I have found three brands of these batteries on EBay.20181111_154646A

 

Mark

Attachments

Images (1)
  • 20181111_154646A

There are several options I see to do this without worrying about radio interference, each with varying other support components and costs that make them better or worse for some things.  

Using TTL to BlueTooth is simple and effective if you plan to use a uP anyway, but comes with about a $3.50 price tag per BT module, and may be cumbersome to pair for users.  

The nRF24l01+ is an insanely powerful 99 cent 2.4 GHz transceiver but requires complex coding to make it work with more than 6 units in range of each other.  Though, it might not actually be that bad just to have 2 units talking to each other that are hard coded only to speak to each other.  

What I think might be the best option is the ESP8266.  These cost about $1.85 each, and work over Wifi.  Modules can be clients or a server, and they have 2 GPIO pins built in which is probably enough for the simple function reading an input and turning something on on the other end.  The only real down side of these is that they run on 3.3v logic rather than 5v and the GPIO pins are not 5v tolerant.  


On the question brought up of controlling devices from the cab1/2, there are much better ways to do this than using the switch controller or what not.  About $25 in parts plus a receiving transmitter for each device to be controlled would allow for control of as many devices as you like, by reading the raw TMCC serial data.  In dumbed down terms, you could use any of the transceiver options above to replace the link between track signal and r2lc.

I'll start by saying I don't have any hands on experience using the ESP8266 as a stand alone uP, only as a wifi solution connected to Arduino.  That said, the ESP8266 can be programed from Arduino IDE now and as I understand it it is not hard to do if you are already familiar with that environment.  When I was playing with these it probably took about 4 hours of fiddling around to get a pair of them talking to turn on or off an LED with a check box on a webUI.  You don't actually need to control the device from a web interface however, just have the "master" unit host a web page with a list of devices and their on/off states.  all of your layout's devices would be on their own network and thus isolated from any other layout, and since it's on wifi protocol, it will play nice with other devices in the area.  

ESP8266 Arduino Core Documentation

There are various ESP chips with more GPIO and such as well.

edit: As far as the coding needed, 90% could be copied from the standard hello world if all you want is an input pin on one to turn on an output pin on another.  

Last edited by JohnGaltLine

JGL, I have looked at the ESP8266 devices, neat, but they are probably a little over my head for now. You are probably aware of this already too. So just as a FYI (and I am not sure how this fits in with what GRJ is attempting here) places like Adafruit, Sparkfun, etc have ESP8266 breakout boards, tutorials, and libraries too I believe.

Might be too basic for you, GRJ, Stan, etc, but just thought I would mention it here in case someone was interested. I realize you guys would probably just use the ESP8266 and not need the breakout boards, but maybe this would be a good learning place for some that were interested? Possibly even you guys?

Last edited by rtr12

I think we have a bit more than "hello world", at least what I'm considering.  I'm still a little fuzzy on the ESP8266 in a stand-alone environment and programming it from the Arduino IDE, that doesn't sound quite right, but maybe I just don't get it yet.

I looked around and I find a ton of slightly different ESP8266 products, hard to know which one to pick.

Add Reply

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Ste 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×