Skip to main content

I've been doing some looking at various remote control sound options for rolling stock, I've tried several audio modules, and I have a couple different types still in the pipeline that I have yet to receive.

 

I started with the WTV020-SD-16P, but it was a disappointment.  It's factory programmed for a specific function set, and they have all been for an MP3 player with just forward space, backspace, etc.  I want one that I can select specific sounds.  It also required AD4 files, so I had to go through a conversion raindance.  The audio output was pretty weak, so I'd probably need an amplifier as well.  If you are thinking of this application, I'd pass this one by.  It's only positive attribute is that it's cheap, and you really do get what you pay for!

 

 

 

I then tried the BY8001-16P, and this one works much better.  Not only is it a better quality board, but it has a better micro-SD slot and tons better audio!  It has five pins that you can selectively ground and play any of the first five sounds on the SD card.  It also accepts pretty much any MP3 file without any problems.  You can move some function selection jumper resistors and change it to a computer controlled module, that will probably be the next experiment.  With the computer control, you have access to any sound on the SD card, potentially thousands of them!

 

BY8001-16P

 

Having a worthwhile sound module, I set about pairing it with the wireless transmitter so I could remotely trigger sounds.

 

I already have a couple of these 4-Channel Wireless Remote packages, so I used one of those.

 

4-chan Remote

 

In order to interface these, I need a logic inversion as the remote receiver puts out a high signal for a button press, and the sound module expects the pin to be grounded to trigger a sound file play.  I started by testing two channels, so I just added a transistor to invert the button press and trigger the sound module.  Obviously, for the "production" unit, I'd probably use a single chip open collector inverter, but I didn't have one handy...

 

Here's the test setup.

 

Sound Module First Test

 

Some observations...

 

The module is pretty bulletproof, it's a very nice and well behaved unit.  If you need high quality sound, this will certainly do it, and it will pump out all the volume you need as well.

 

The remote is OK, but I'm somewhat disappointed with the range.  I found that both the transmitter and receiver needed a lot longer antenna for any decent performance.  With my "clip lead" antenna extension on each, I got about 30 feet reliably, and spotty performance at 40-45 feet.

 

I'm still in the development stage, but I can see that this can work.

 

Any ideas for better transmitter/receiver options are welcome.  Obviously, it has to be small as this whole rig is intended for rolling stock.  My next step will be to put this rig into a boxcar and see how it behaves at the club layout.

 

Attachments

Images (3)
  • BY8001-16P
  • 4-chan Remote
  • Sound Module First Test
Original Post

Replies sorted oldest to newest

I think I know why the transmitter doesn't have decent range.  When the MP3 module is actually playing a song, it's stomping on the RF signal to the receiver!  It works great to start the first sound, but if I want to change the sound from the transmitter, I have to be pretty close to the receiver to get it to work.

 

Although I wasn't initially going that way, I think I may try mating an ERR MiniCommander ACC module to this sound board and have TMCC control directly.  I was hoping for better range from the RF solution, but there's more than one way to skin this cat.

 

Originally Posted by Bob Rumer:

Wow! Great idea Gunrunner. I can visualize a boxcar with an open door, a figure setting and holding a guitar. The sound would be Jimmy Rogers singing Train Whistle Blues!

 It would be really cool if I used one of my RC servo units and opened the door under remote control.

 

Last edited by gunrunnerjohn
Originally Posted by sinclair:

I would look at getting a unit if I could use it to open doors.  Also, what about using a reed switch and cam/magnate on an axle to trigger sounds, kinda like the VL sound reefers and tankers?  I would so love to add those kinda of sounds to my freight cars.

Now you're launching into computer control and more complex audio effects.  In order to duplicate what the VL tankers have, you have to mix audio channels.  It's certainly possible, but not nearly as simple as triggering discrete sound clips to play.  I seriously doubt I'm going to launch into that kind of development effort here.

 

After getting a basic rig running, I do plan on introducing the processor to expand the capabilities, that will be the next step.  I want to get some experience with the sounds and build a few cool projects first.

 

 

The opening doors is not that difficult, but it will require the addition of the processor.  The model airplane servos I use are PWM controlled with one input.  You can have the door move at any reasonable speed just by controlling the PWM output.  Arranging it to open the door is pretty simple, and the servo has plenty of torque to do the job, if the door sticks, it's liable to pull it off the slides!

 

I shielded the MP3 player board with a tinfoil box, didn't seem to make much difference in the range problem.  That being said, I decided to go a different way and do it with TMCC anyway.

 

Here's the new interface, this will go between the ERR MiniCommander ACC board and the MP3 player module.  The opto isolators are not technically correct as TinyCAD didn't have any AC opto component, but you can get the idea. 

 

Basically, the four channels of the MiniCommander connect to the four optocouplers.  Since two of them are negative in respect to ground, this seems to be the easy way, and it's 100% bulletproof.  The output of the optocoupler is filtered  by the 22uf cap to eliminate the AC ripple from the input side.  The resultant signal is sent to the MP3 module to trigger one of four sound selections.  The MP3 module takes a connection to ground (or at least a logic zero), so when the output from the Opto is active, that's what I get.

 

If the breadboard works as I expect, I will probably immortalize this in a PCB so I can install them in more than one car.  Hand wiring a bunch of these ain't in the cards!

 

 

Edit: remove old schematic.

Last edited by gunrunnerjohn
Originally Posted by gunrunnerjohn:

When the MP3 module is actually playing a song, it's stomping on the RF signal to the receiver!  It works great to start the first sound, but if I want to change the sound from the transmitter, I have to be pretty close to the receiver to get it to work.

 

Well, there's a clue.  More than likely the module uses a Class-D switching amplifier so when driving audio to the speaker you have 5V pulses radiating EMI courtesy of the huge antenna of the long speaker coil winding.  I notice in your prototype photo that the speaker is conveniently placed next to the RF receiver to maximize the stomping.

 

So first move the speaker and wiring away from the receiver.  That might do something.  If you have one of those ferrite cores/toroids to wrap you own inductors, place it near the module output and wrap the speaker wires thru it.  If that shows improvement but not enough, google "class-d emi filter" or something like that and install an engineered L-C filter right on the module.

 

Yes, I'm imagining how easy the job is...but IMO the greater contribution to the hobby would be if this was not dependent on using an ERR module to gain remote control...which would leave out conventional, DCS, DCC, etc. users.  

Stan, I moved the speaker way away, and had the receiver and MP3 module 6" from each other.  I also shielded the MP3 module totally with a little tinfoil box, trying grounding the shield to a variety of places, negative, earth ground, etc.  No joy with anything I tried, the range didn't change much, if at all.  I think I've expended about all the effort on getting that RF solution to work.

 

While the TMCC solution isn't for everyone, part of this exercise is for a solution that I can use.  Being somewhat selfish, I'd like something that can work for me.  If a different module works better (I have several more coming), I may revisit the RF solution.

 

 

 

I ended up rethinking a bit of the logic for the MiniCommander to solve one vexing issue I had.

 

I have four outputs, so I can trigger four sound files.  One issue is that with the MP3 module, there is no easy way to stop it playing without using the serial computer interface.  Since I'm simulating push buttons, I can't stop the audio.

 

I figured a way, I put a 5th audio file that's just a short silent recording on the SD card and I can trigger that to stop the sound.  Of course, that brings up another problem, how do I get a 5th output from the MC?  I think I've solved that one with the following additions to my interface board.

 

Since the LC1 and LC2 outputs toggle on and off with discrete keys, they're normally used to turning on and then turning off the output for the sound you'd like to play as the MP3 module is edge triggered.  In order to trigger the 5th output, I turn on LC1 and LC2, this normally would just play the last one selected.  However, with the addition of a couple of gates, I generate a slightly delayed pulse to the 5th input to play the 5th song, which is the short silent one.  That results in the sound module being silenced.

 

I could have also just used three sound files and had the 4th be the silencing one, but I'd like to support as many different sounds as possible.

 

Yet to be determined is if I need a delay for the logic circuit to insure the 5th trigger really does the trick, but the logic seems right.

 

 

 

MiniCommander MP3 Module Interface

Attachments

Images (1)
  • MiniCommander MP3 Module Interface
Last edited by gunrunnerjohn
Originally Posted by gunrunnerjohn:
With my "clip lead" antenna extension on each, I got about 30 feet reliably, and spotty performance at 40-45 feet.

 

Originally Posted by gunrunnerjohn:

I think I know why the transmitter doesn't have decent range.  When the MP3 module is actually playing a song, it's stomping on the RF signal to the receiver!  It works great to start the first sound, but if I want to change the sound from the transmitter, I have to be pretty close to the receiver to get it to work.

So to be clear, you got 30' "reliably" for which functions / under what conditions?

 

I understand you back-burnered the direct RF remote for now, but in the context of an O-gauge layout what would you (or anyone else following along) consider to be decent range?

 

I like the door-opening idea as it fits with so many other rolling-stock accessories where you trigger it, the door opens, something happens, the door closes.  Is anyone else following along?  If there is really interest in mating some kind of mechanical action to the sounds, I've been messing with the idea of using a stereo MP3 module to put sound on one track and mechanical commands on the other track.  For example a series of audio bursts can be sent not to a speaker but to a 25 cent bridge-rectifier to create the DC pulses to drive a PWM hobby servos that GRJ mentions.  Maybe someone has done this already but that would be one way to synchronize sound and motion without requiring a processor chip and writing software.

If the audio isn't running, when I key the first sound file, whatever it is, I can usually trigger it from 25-30 feet away in the next room.  However, once the audio is playing, 4-5 feet is about all I get.

 

When I get a chance, I downloaded a couple of detailed filter descriptions for Class D EMI filters, maybe that will make a difference.

 

That's an interesting thought with the stereo, the little module I'm testing with has stereo output.  You could really just record the PWM data stream on one channel and the audio on the other.  With a simple gate you could square up the PWM data from the tape and feed it directly into the model servo.  I don't know if you could use the on-board amp to play the audio channel, as it being mono, I assumed it was mixing the two channels.  That may be a false assumption.

 

Here's the pinout of the module I'm using right now.

 

 

 

 

BY8001-16P Pin Descriptions

Attachments

Images (1)
  • BY8001-16P Pin Descriptions
Originally Posted by gunrunnerjohn:
When I get a chance, I downloaded a couple of detailed filter descriptions for Class D EMI filters, maybe that will make a difference.

 

...

I don't know if you could use the on-board amp to play the audio channel, as it being mono, I assumed it was mixing the two channels.  That may be a false assumption.

 

Well, easy for me to say, but how about connecting an 8 ohm resistor (or whatever your speaker impedance) right at the module output so as to create an equivalent load.  Then when you start a song does the RF range decrease?  I really believe it's the Class-D hi-frequency modulation radiated over the speaker wires killing your RF as I'm quite certain the RF receiver uses a super-regenerative front-end which is a vacuum cleaner of EMI (as opposed to, say, a super-heterodyne design).

 

As for the stereo stuff, it's hard to imagine taking advantage of stereo sound in a piece of rolling stock given the size.  That said, why not take advantage of the spare audio channel.  I'd think your DACR and DACL outputs are low-current outputs and you have a mono amp on board?  Otherwise you'd think they would have provided two speaker outputs.  But the DACR and DACL may actually be PWM'd output full-scale 5V - as opposed to a true linear DAC which is expensive to fabricate on an IC.  This, to me anyway, is the key to keeping the circuitry simple.  That is, the PWM DACs or Class-D amplifiers put out 5V pulses even for small audio signals; it's just the duty-cycle that changes.  It makes is so much cheaper to "square up" full-scale pulses than to amplify analog signals up to the right amplitude.

Stan, I did try the experiment with an 8 ohm resistor, the range was still affected the same when a sound was playing.  I suspect you're right about the RF circuit, it doesn't have the components that I'd expect for a superhet receiver.

 

I wasn't suggesting taking advantage of the stereo in the rolling stock, that's why I figured one channel would be available for the control function. 

 

I took a look at the signals coming out of one of the DAC channels, they look like normal audio.  If they're generated with PWM, they have added filtering before the outputs.  I went pretty high frequency and didn't see evidence of full voltage excursions that I'd expect with PWM.  Here's a few samples of my test sounds at the left DAC output, I assume the right would be similar.

 

Coal loading into tender

Scope Coal Loader Sounds

 

Reefer Compressor

Scope Reefer Compressor Sounds

 

Track Running Sounds

Scope Train Track Sounds

Attachments

Images (3)
  • Scope Coal Loader Sounds
  • Scope Reefer Compressor Sounds
  • Scope Train Track Sounds
Originally Posted by gunrunnerjohn:

I did try the experiment with an 8 ohm resistor, the range was still affected the same when a sound was playing.

Geez.  You're probably thinking I've sent you snipe hunting .  Well, maybe time to give the direct-RF remote a rest and focus on the TMCC version since that's what you need. If you do come back to it, there's more snipe hunts available to the hunting enthusiast - conducted susceptibility via the power or i/o lines.

 

I remain convinced that a low-cost remote "system" to activate rolling-stock anywhere on the layout is something O-gauge could really use.

I took a look at the signals coming out of one of the DAC channels, they look like normal audio.  If they're generated with PWM, they have added filtering before the outputs.

That's pretty slick if they integrated the filtering on the chip and/or module.  As I recall, some microcontroller chips that feature "analog" output pins are BYOF (bring-your-own-filter).  Of course for this hack of using the spare audio track as a control channel, I'd rather have the digital pulses but that's tomorrow's problem.  Thanks for taking those scope shots, I can see the 1/2 scale DC offset on the DAC channels. 

 

As you may recall, I'm fiddling with the barebones $1 MP3 module plus external amplifier module. I'm finding each O gauge application has some quirk to work out.  For example, in the case of servo PWM, to get the pulse timing resolution to smoooothly rotate the mechanism, let's say you want 1 part in 100 resolution.  Since the pulse width varies about 1 millisec for full servo swing range, that means a pulse resolution is 10 microsec.   Back-of-envelope says that requires a sample rate of at least 100 kHz.  Well, for example, I see your MP3 module specs a max sample rate of 48 kHz...and I'm sure my MP3 module is no better.  So then you start playing games...or as the saying goes all ideas eventually degenerate into work.  I'm just learning about how the MP3 compression algorithm and these low-cost MP3 chips handle DC-coupled digital pulse streams.

 

 

 

I did more reading on class-D EMI suppression, it's obviously NOT a simple topic!  Boy, some of the stuff I've found is really deep!  Many of the discussions get into to EMI stuff I used to do for avionics, however I don't have the equipment or testing facilities that I had available back then.  When you had OPM to buy all the toys, it was a lot easier to work on some of these issues. 

 

Many of the references were to using ferrite beads and small capacitors across the speaker leads to minimize the problem, including some specific application examples.  With that in mind, I ordered some trial components to see if adding filtering right at the MP3 module might improve the situation.  No certainty, but it's worth a shot.  I do agree that having a generic capability without TMCC in the mix would be a good thing, but it's getting there that's the issue.  I think I may be able to stomp on much of the higher frequency EMI from the amp, we'll see when the parts arrive.

 

Another approach would be NOT to use the amplifier that's on the MP3 module, but rather incorporate a separate amplifier chip on the interface board.  The TI LM4861 Class AB chip would probably generate a lot less EMI.  That's what might have to happen in order to solve the EMI issue, after I try a filter I'll know.

 

There are also modules that play WAV files, which would solve the problem of dealing with MP3 files.  The module I'm using is one of those.

Before I lose my train of thought, one other possibility if you re-visit these modules. These low-cost RF modules appear to come in either 315 or 433 MHz versions...I think that's a SAW resonator on the TX side and I can read the frequency on the can.  It could be that one receiver is less susceptible to the MP3 harmonics/noise than the other.

 

I'm focusing on the what to do with the spare audio track right now, but my to-do list now has to hook up the 4-channel RF receiver to see if it plays well with the $1 MP3 player driving the 82 cent class-D audio amp.   My 4-channel TX is 315 MHz.

 

 

I have the 315mhz units as well.  Given the nature of the receiver, I can't see changing the frequency as being the primary solution.  If the filter doesn't do it on the MP3 module, maybe the alternate amp might be better.

 

Truthfully, I'm not as concerned about keeping the cost rock bottom, I'm more interested in functionality.  I don't want the cost to spiral out of control, but anytime you have to layout and build circuit boards, it's not going to be a $5 solution unless you're the Chinese and you're building 100,000 of them.

 

For either of these versions, I want to be able to play any one of the four sound files and also stop it on command remotely.

 

 

GNR and Stan,

Gentlemen, I am enjoying this thread immensely. Both of you are obviously well versed in the subject material. I am some 40 years removed from this level of electronic detail so my voice is very small in regards to this endeavor. With the knowledge that GNR has some plan "B", plural, to tinker with I would like to note that up until this point, from my outside aspect, a 20,000 foot birds eye view in you will, there seems to be a lot of Band-Aid fixes to this issue; would a foundational level review be in order? Unfortunately, I am left with leaving you with an observation and no clear solution, which goes against a post of this sort. In short, to me, there may be another angle to tackle this problem with less moving parts. IMHO  

David, we're all ears if you have a better idea.   There is obviously a more reliable way to do all of this, but it costs more money.  The object of the exercise is to leverage the stuff that we can get very cheap to do the job for a reasonable price.  I have some more involved ideas rolling around in my head, but I'm trying to come up with something with less total expended effort.

 

 

 

Stan, I did a new design of the RF version with the filters in place right at the connection of the MP3 board.  Once I bench test the filters, if that is a positive test, I'll consider cranking out a few of these boards to see how well it works.

 

 

 

Here's the trial run of the PCB topside, the MP3 module plugs in on the right, and the RF receiver plugs in on the left facing away from the board.  The board is 1 x 1.6 in size, with the receiver sticking out the end, adds about another inch.  Should fit easily into rolling stock.

 

 

Edited to remove obsolete drawing.

Attachments

Images (2)
  • RF-Link MP3 Interface PCB
  • RF-Link MP3 Interface
Last edited by gunrunnerjohn

GNR, I am so out of my league on this issue and my hat is off to you and Stan. That said, I would go with a larger and more expensive, probably, tried and true solution and then distill it down instead of starting with the most inexpensive solution with band aid fixes to get where you want. I think you are on the right track with an FM solution using the FM carrier wave with the two sideband (read stereo) frequencies to get where you want. You are able to take it down to the IC level which gives you the advantage to distill. At the risk of repeating what you already know as a resource, Mouser.com have many industrial solutions to a duplex communications issue in a very small form factor. There is a Zigbee line of solutions that may fit the bill and are not at all expensive in the big scheme.

1. DRC would catch it but your bridge ground is floating.

2. If I were doing it, I'd change your RC delay by increasing R and decreasing C.  Resistors stay same size and same cost irrespective of value, capacitors generally decrease in size and cost for values shown.  Ceramics IMO generally more reliable than electrolytics.

3. I'd change the inverter after the RC to one of the unused HC14 gates.  Don't know about cost but it might be cheaper and smaller pkg for a single NOR than a dual NOR.  Also, for the RC time-constant you really should protect against possible oscillation on that inverter so the HC14 hysteresis will handle that.

4. Presumably you'll hold off ordering boards till you do more testing, but I'd give a bit more thought to how-to isolate the RF receiver.  This could be a simple bead filter between power-supplies should conducted susceptibility be the issue.  I also can't help think of consumer electronic devices where, when you open it, the RF module/tuner/whatever is usually in a shielded can/enclosure.  In other words, different than shielding the MP3 electronics.

 

In any event, I am genuinely excited that you are still considering a general purpose approach rather than a TMCC-only version requiring a somewhat spendy ERR module.  I understand your comment about cost, but if in the end you do need to go with a $1 microcontroller, a lot of SPI code talking to JGL's a $1 2.4GHz module I still think the cost will be reasonable.  Actually my concern is that the general OGR readership "gets" the significance of what we're talking about here.   I don't know what to do about that aspect though.

 

IMO if you can pull this off - allowing connectivity with an ASC/AIU, this will have a greater impact on the hobby than your super-chuffer and LED board combined.

Stan, the DRC didn't catch that missing trace, I was just rushing it to put it up. However I managed to screw some much bigger things up, so I'll have to fix all of them.   I managed to swap the MP3 mounting connectors around, not a good thing, the sound board would not have had the right connections!

 

I didn't originally have that inverter, but that's an excellent idea.  I started with the design of the MiniCommander interface, and it's using opto-isolators in place of those inverters. I didn't think to change when I got the HC14 in the mix.

 

I was thinking about the time constant being too short, that was one thing I was going to play with on the bench before going with the values I have.  The little 10uf cap I have is a pretty cheap one, and as far as "going smaller", I have imposed a limit of how small I'll do SMT stuff.  I know they can assemble it, but if I can't hand solder it easily, it's a big problem.  All my resistors are now 805 size, and I keep the capacitors that large as well.  I made the mistake of specifying a 201 sized resistor on a board, I couldn't even see the little things!  I tried to solder it on for 20 minutes, and three or four ended up on the floor, lost forever!  I can manage the 603 sized components, but I prefer the next size up for easy of handling.

 

For the receiver, I was going to make a tinfoil box for it and see if that helps.  However, I figure if I can whack most of the EMI with the filter, that will make the receiver problem easier to deal with, and any shielding more effective.

 

The key to "pulling this off" is getting an MP3 solution that plays nice with the remote.  So far, this one has had the other attributes that I was looking for.

 

Edit:

 

I corrected the graphics in the previous post, still a work in progress, but each step we get a little closer.

 

I'm not ordering boards yet, the boards are just to see how everything fits as I go.

Last edited by gunrunnerjohn

I don't know if this is "good" news or just news but I tested the range of my MP3 player and class-D amp controlled by the LED remote system I showed on the other rolling stock thread.

 

ogr rf receiver with audio

I got 15 ft. reliably around a corner down the hallway.  But the key is the performance was the same whether turning ON or OFF.  The audio amp is class-D using the PAM8403 chip running at 260 kHz; there is no separate LC filter the board.  The datasheet claims the chip is a low-EMI design but who knows what that means relative to your module's amp.  But I can't imagine and class-D design having lower EMI than a class-AB style squeezing out battery-life is not an issue with rolling stock.

 

The LED controller remote uses a 3V coin battery with no external antenna so 15 ft. is pretty good.  The 4-channel remote uses a 12V battery and has the telescoping antenna which together almost seems like cheating compared to the LED controller remote!  I opened up the LED controller receiver and it appears to be a superhet design.  From various listings for the remote, it is 433.92 MHz and that crystal on the right (6.7458 MHz) matches what various single-chip superhet IC receiver datasheets say as the crystal to use for 433.92 MHz.  I could not correlate the "PP833L" chip marking on the so-8 receiver IC to anything.

So while I agree that you don't want to get in the business of designing RF receivers, this LED controller shows it's getting simpler with an 8-pin SO, a crystal, and maybe half a dozen 0603-sized passive components and no tuning-coil to mess with.

 

 

Attachments

Images (1)
  • ogr rf receiver with audio

Stan, the thought is always there, but I'd have to build both ends in order to have the complete package.  I certainly wouldn't want tuning coils, that raises the complexity and reliability I would expect.  It would make for a more compact package.  I'm eager to see what the EMI filter on the speaker does for the existing setup.  If that works well, I'll probably order the basic $30 worth of boards (minimum order) and build up one to see how it functions.

 

This board appears to use a BY8001-24SS chip to do the basic functions, there's an Atmel serial EEPROM, presumably for parameters, and then a 8 pin chip labeled MIX2002CN?4S0N, the ? is a number I can't read.  I find nothing on that chip in a search.  The mystery chip seems to most likely be the amplifier, it's next to the speaker leads.  Since two of it's pins are directly connected to the speaker, that's a good indication.

 

 

I've done a "trial run" of the RF version final assembly and PCB layout.  If anything jumps out at you, let me know.  As soon as I get to test the EMI filtering, I may pull the trigger on one of these if that's a success.  Of course, any comments welcome before we go to copper.

 

Edit: remove obsolete diagrams.

Last edited by gunrunnerjohn

John, what I would really like to have is a very inexpensive microphone and sound card run off a single AA that would pick up the wheel noise coming through the car body and convert the sound to prototype steel wheels sound with clank on a live basis. One in each frt. and passenger car would be awesome.

 

At least, I'de like to try it. Maybe one for locos first that rumbled. 

 

Ron H

I'd like to win the lottery, but that ain't happening either.

 

Everyone want's "very inexpensive", but if there's no potential for any profit, who's going to build it?  While it sounds simple, one only has to refer to my signature saying...

 

You want to do live digital sound processing on the wheel noise, and that's going to be "very inexpensive"?  I'll buy them if you get them to $10-15, but I doubt even the Chinese are going to do that!

 

Well, the Class-D EMI filter was a huge disappointment!  I soldered the little surface mount components directly to the speaker pins, that's better than they could be on a circuit board.  It didn't change anything that I can see with the remote control, it still starts the first sound great, but if that sound is running, you aren't going to trigger any others from more than about 5 feet away.

 

If this is going to work, I'm going to have to find a better RF remote control package I suspect.

 

If you still haven't given up on that 315 MHz 4-channel receiver, I'd look at conducted susceptibility over the power supply.  I take it you're still using the white prototype board albeit with receiver and MP3 modules separated by (at least) 6 inches.  One of those DCS 22uH inductors has 40K ohm impedance at 315 MHz.  I figure you only need maybe 10 mA max into the receiver so those cheap 1/4-1/2W inductors can handle the current.  I'd just put a 22uH on on ALL the lines to start including the 4 output lines.  Or just disconnect all but the 2 control lines to turn MP3 on and off.

 

Separately, since you apparently have multiple receiver modules all with the 0.1" square-pin headers, how about hooking up two receivers where one is completely electrically isolated (runs off a separate 5V supply).   So the 2nd receiver would maybe just drive some local LEDs or whatever's enough to show that it is decoding the commands.

 

If you have just the RF rcvr 4-pin module that comes paired with the bare tx module (99 cents), even that could be used to evaluate if/how the super-regen rcvr behaves when the MP3 player is playing if you look at the data stream output with a scope.

 

So the idea is to determine whether the MP3 module is just so darned noisy that it blows away anything in the same county that isn't even hooked up to it.  Yeah, all these high-school science projects take time...

 

-----------

 

Completely on a different issue, regarding the PCB.  I can't imagine anyone else trying to solder-up this circuit given the complexity.  I say this based on what guys will do/did for various LED lighting circuits.  That said, if going to the trouble/cost of making boards, I figure you'd just put in a 14-pin (or whatever) microcontroller.  Initially it could eliminate all the logic gates since it would be a fairly trivial program to do the inversion and the minor timing to pulse the 5th channel to turn off audio.  But obviously the next step would be decoding the RF packets using the cheaper receiver that is 1/2 the size of the 4-channel receiver.  Even if the board is just for yourself, I figure you probably want to be able to set the address of the board or else ALL you sound cars will respond to same RF controller.

OK, if you're a "glass half-full" person:

 

I used the basic $1 MP3 module + $1 PAM8403 class-D audio amp module powered by 5V. When powering a 4-ch 315 MHz receiver module with the same 5V supply, I get data loss whenever audio is blasting away. During MP3 silence gaps, data goes thru fine.

 

Then I powered the MP3/amp with a separate 5V power supply. No problem getting data thru even with audio blasting away.

 

Then I connected a wire between the grounds of the MP3/amp and RF receiver. No problem!

 

Even draping the un-filtered speaker wires 1-inch from the RF receiver...no problem!

 

My working theory: it's coupling thru the power supply.

Stan, I'll try some of the 22uh chokes in the power and ground.  I see the receiver already has a cap across the power/ground, so the addition of the chokes may be a winner.  FWIW, in order for this to work, I'd like the receiver to be plugged in to my board, so I do want it to work closer.  I'm thinking you may be on to something with the power, I was thinking about that my self.  I have a whole raft of the little 22uh chokes, so it's an easy test.

 

I also put in an order for a superhet 4-channel receiver to see if that has better luck.  It has the same pinouts as this one, so it would be a drop-in if it works better.

 

We'll see how the chokes in the power feed work...

 

I added a 78L05 right at what you call J1 to power the RF receiver separately. Let's just say the results were dramatic

 

The 22uH did NOT work in my situation but we do have a slightly different configuration.  In my case I was looking at the noise on the 5V supply to the receiver on the scope; it's low-freq audio noise from the current variations that I believe is messing up the receiver sensitivity.  The 22uH does not have enough of a low-freq effect.

 

This is one of those cases where I hope Your Mileage does NOT vary!


 RF-Link%20MP3%20Interface%20Schematic

 

BTW, not today's problem, but are you really using 10 or 12 mil traces on your power supply lines on the PCB.  Given the average current when pumping out a couple watts of audio, I'm thinking 25 mil minimum and the more the merrier...you have the room.

 

 

Attachments

Images (1)
  • RF-Link%20MP3%20Interface%20Schematic
Last edited by stan2004

Just curious, why did you run the 70L05 off the output of the main 5V supply?  It would seem to make more sense running off the input, and it would be further isolated by the little switching module.  I can certainly try that, it's easy enough to do.

 

I have plenty of room for a regulator, I won't be needing the speaker filter.

 

As far as trace widths, I have a 1/2A max supply, and the module draws about 100ma blasting out audio.  For a 500 ma current and 1mil thickness, required trace width is 4.55mil.  Since I don't see anything close to those currents, I think the trace width shouldn't be a factor.

 

Here's the Trace Width Calculator I'm using.

 

 

Yup, schematic revised. I was so busy trying to edit a pixelated image rather than a schematic...

 

Well, there's theory and then there's practice.  It's not a question of how much current a given cross-section of copper can carry, or right or wrong.  It's my opinion that if you have the space to run fatter traces for power you should do so.  It makes for more robust traces for prototyping (less chance of nicking or cutting traces as you fidget with modifications), it's easier to mod boards with resistors/caps as there's more copper area to solder to, there's less inductance per inch which reduces glitches for fast current edges, etc. etc.  But to each his own...

I'm going to give the separate regulation a try, that sounds like it may be a big help.  I think I'll stick the 'scope on the power and see what it looks like as well.

 

I hear you on the traces, nothing wrong with your thinking.  On my little motion sensing board, I did widen the traces to the relay contacts since they are capable of 5A if you want to use them that way.  I'm a ways from actually going to boards on this one, I just do the layout to see how things fit.  I'll revisit the trace widths when I'm actually ready to make a board.

 

I was thinking about your suggestion to use a processor for the logic, it has some interesting benefits.  One thing it would do is allow me to have both the TMCC and RF version as a single board.  The TMCC serial data would be used for the TMCC version, that could come from a variety of TMCC products.  By plugging in the receiver, I could receive RF data and operate from RF inputs.  That allows more flexibility from a single board design, not to mention minimize the costs of having two different versions.

Originally Posted by stan2004:

Then I powered the MP3/amp with a separate 5V power supply. No problem getting data thru even with audio blasting away.

 

Then I connected a wire between the grounds of the MP3/amp and RF receiver. No problem!

 

Even draping the un-filtered speaker wires 1-inch from the RF receiver...no problem!

 

My working theory: it's coupling thru the power supply.

When you're right.... YOU'RE RIGHT!  That's it exactly.  Powering them with a separate supply and all is well!  I tried a choke and a 220uf cap with a .1uf cap to cover all bases, but with one power supply, they still have an issue.

 

I looked at the power on my 'scope, and it does dance around with the audio playing, even with a 220uf cap.  That does seem to be the issue.

 

Time to move on, I think the noise issue is behind me.

 

Why use a DIP uC pkg if you have an ICD interface?  Presumably you'll be (re)programming  using the ICD so should never have to remove the chip.

 

So then I'm thinking if you have more space using a TSSOP, you can easily fit a 20-pin version to get another 6 i/o pins for, say, 50 cents more.  What to do with 6 more pins?!

 

I still think you need a solution to multiple addresses so you can have more than 1 receiver running per layout.  I'm hoping you're thinking this can be the first revision toward something you can sell to bring this to the masses.  Perhaps using the flash/EE on the uC, you can come up with some kind of "learning" mode where the receiver learns its address and stores it in non-volatile memory...rather than having a bunch of jumpers of DIP-switches to set the address.

 

A downstream option is to accept the 99 cent receiver module's 3-signals: 5V, GND, DATA.  Not so much the cost, but the space would be greatly improved for fitting into rolling stock if plug-in rcvr board was half the size of the 4-channel rcvr.  Yes, would require a bunch of code to decode the bit-stream.

 

I'm imagining some output pins to drive other functions besides sound.  Whether it be some LEDs, or a coupler coil, or a PWM'd hobby servo, or fill-in-the-blank.  Perhaps a gross violation of KISS...

 

I'm imagining at least one input pin to allow something to trigger a sound locally.  In other words it can be playing sound #1, but when it gets a trigger it goes to sound #2...or something like that.  Kind of half-baked in my mind, but I'm thinking of the animal sounds that trigger when there's motion.  eBay has low-cost motion/vibration detection modules. 

 

But I do grasp the rapid progress being made!  As you well know in a for-profit corporate world this would take forever.

Funny you should mention that, I was just looking at the addressing and thinking how I might address it.  I agree that allowing more than one working at the same time is a very desirable option, so that's got to be incorporated.  Looks like I'll have to have some connections to the unused pins on the receiver over to my board.

 

As far as triggering sounds locally, if there were a way to mix audio channels, that would be a more attractive option.  That's getting way beyond what I am going to do here.

 

One reason I went to the DIP was easy of hand assembly, I'm getting tired of soldering tiny little leads.  I'd probably with a surface mount, but not the TSSOP as that's pretty small.  I just added the ICD interface after I put the chip in, I was initially thinking I'd pull them out and program them on my debug board.  Then I decided to stick the ICD in, so it probably makes sense to go with a smaller footprint SMD option, the SOIC is probably good and pretty easy to handle as well.

 

I did think about other functions as well, but I'm leaning to getting the audio function working as a first step.  I'm not ready to spend the time to decode the bit stream since someone already did the work.  One thing that the 20 pin chip would do is allow me to have the TMCC serial input on the chip as well, but then I have to open that can of serial decodes.

 

Truthfully, I'm not too worried about the size of the module with the receiver plugged in, it'll be less than 3" long and 1" wide.  Even a small boxcar will fit that easily with a speaker.

 

Understood.

 

I think it be sloppy to jumper over multiple "address" lines from the 4-channel rcvr module to your PCB.  My 4-channel rcvr uses the SC2272-M4 decoder chip; the SC2272 comes in a few variants for latching, momentary, etc. operation.  If you look at the 4-channel rcvr compared to the barebones rcvr, it's pretty much "just" the SC2272 that makes it different.  Hence, one option is to use the barebones 99 cent rcvr and put the SC2272 on your PCB.  I can't speak to the incremental PCB cost for the additional real-estate but the chips themselves are insanely priced on eBay for about 25 cents!

Then you plug in the 4-pin (3-signal, 5V, GND, DATA) barebones rcvr and feed the DATA line to the SC2272....AND have access to the addressing pins on the 2272 to connect to address switches, jumpers, or even spare uC output pins (if you choose to save the address in the uC EEROM).

 

Edited=no direct links to ebay!

 

Just a thought....

Last edited by OGR CEO-PUBLISHER

At this point, I'd like to get something going.  It only costs me $36 to get a few PCB samples of a given layout, so I want to arrive at a workable solution and pick up a set of boards and get some miles on it.

 

I could engineer this forever, but we used to joke about that when I was actually working for a living.  If I let the guys go, they'd "improve" on the design forever, but we wouldn't have a product to ship, and the costs would go through the roof!  

 

FWIW, I have a couple of the bare bones transmitter and receiver sets, did you ever determine if they had as good a receiver as the 4-channel remote?

 

One thing I'm waiting on is I ordered one of the superhet 4-channel sets, if that's vastly superior in range, I'd probably want to use that.  It happens to be pin compatible with the 4-channel ones I have now, so I could just drop it in.

 

John,

 

Have you looked at Adafruit:

 

https://learn.adafruit.com/ada...sound-board/overview

 

http://www.adafruit.com/search?q=pam8302a

 

I bought a solder sucker from them a few weeks ago and their site has some interesting stuff.  One of the posters on the Free Rails forum gave me these links.  I was looking for steam sound but he said the sound was not adjusted by speed of the engine.  Still they may have something useful.

Bob, I haven't seen that before, but the MP3 module I have I get for $7/ea, and I can play up to 5 sound files, each with a single button press.  I can also connect a serial stream and control many more sounds.  It includes a 3W mono speaker amp and dual stereo headphone or external audio outputs.  Since the long sound files I'm going to be using for rolling stock are in the 40-50 megabyte range, the limited capacity of this board is too restrictive for my use.  This one accepts SD cards to allow any capacity I desire.

 

I don't know of anyone short of the actual model train folks that have sound synchronized to the speed of engines or rolling stock.

 

No, I have not compared the bare bones vs. 4-channel super-regen rcvrs.

 

In looking at the super-het 4-ch rcvrs I noticed some have "learning" mode.  Looks like OGR is now enforcing no eBay links but easy to find.  Is this the one you got? 

 

I figure you press the button and then send a command within x seconds and stores away the other 8 address bits (if it was a 10-bit address)....no address pin/jumpers/switches required.  Looks like an LED next to the button which presumably flashes to provide feedback on learning mode.  Makes sense and would eliminate running extra address wires to your board.  Presumably this uses the 2262/2272 chipset serial protocol or obviously would need to get the mating 4-button remote.

 4ch learning superhet rcvr

Attachments

Images (1)
  • 4ch learning superhet rcvr

Moving on then...here's my next issue.  Handling track power dropouts. 

 

With peak speaker currents of, say, 5V thru 8 ohms, that's over 1/2 Amp.  I was looking at your module pinout at it does not look like there are separate logic voltage and power voltage inputs.

 

Since I have a separate audio-amp module, I can split off (diode) the power to the audio-amp.  The MP3 electronics would have a cap with enough energy to ride-out a X second dropout without resetting or whatever.  Obviously the speaker output would dropout and there may be a pop or click on each transition.  Anyway that's my thinking right now.  I guess a big enough supercap is one approach but would need to run-the-numbers so to speak.  This dropout could obviously be from a direction change for conventional operation though I realize this could be a command-mode-only design.

 

What's your take on this?

 

I'm going to see what experience tells me, but track power interruption is certainly a potential issue.  I did look at how I could add a superCAP.  I'm thinking it could get a bit complicated to do this properly, probably a two-stage system.  Regulate track power down to 10 volts, put a couple of 5.2V 2.7F superCAPs in series to provide the power, then regulate down to 5V.  I don't think just putting the cap across the 5V output will cut it, though that might be a band-aid when I first try to run these.  I suspect it would provide a short time power bridge, but you need more voltage to use a decent amount of the stored energy.

 

I have no way to regulate the volume with the existing module, so I experimented with series resistors.  Right now, the volume with an 8 ohm speaker (ERR model) is pretty loud, maybe too loud for many applications.  I can say that volume won't be an issue!  I think the maximum power is used with a 4 ohm speaker, but I find the 8 ohm to be more than loud enough.  I'm adding a provision to use a resistor to control volume.  You could use a 50 ohm pot or just solder a selected 3W resistor directly to the board.  I found that 30 ohms dropped the volume by about 1/2 the apparent loudness, and was probably about as loud as I'd want it.

 

That looks like the superhet one I have coming, if it works out well, I'll consider that as the "standard".  I did observe that it has the learning provision.  One issue is how you do the transmitter, do you need a different transmitter for each of these receivers?  With the other one, you can change addresses at the transmitter side to address multiple units.

 

As far as addressing, if you look at the back of the super-regen receiver, you'll see they have already conveniently placed ground and 5V bus bare traces to easily jumper addresses.  For the first cut of this, that's going to be the addressing provision.

 

OGR is really starting to get a bit absurd, I think the commercialization is going a bit overboard.  The 'Bay links to stuff are a valuable resource.

 

Originally Posted by nvocc5:

When did they start the no e-bay link, this is the first I have heard of this.

I have no idea.  All I know is a link was removed by someone from OGR yesterday.

 no links censored

As it says on their terms of service:

 

OGR Publishing, Inc. reserves the right to delete any message, at any time, for any reason.

 

"for any reason" is clear to me and the OGR person at least had the courtesy to say "no direct links to ebay".  So be it, and I figure we should just leave it or else this entire thread might get deleted!

 

 

Originally Posted by gunrunnerjohn:

You could use a 50 ohm pot or just solder a selected 3W resistor directly to the board.  I found that 30 ohms dropped the volume by about 1/2 the apparent loudness, and was probably about as loud as I'd want it.

 

Yikes.  Perish the thought of having to add a 3W resistor!  The MP3 module I'm messing with has a non-volatile volume-control-button setting so I figure you set it once and forget about it.  But in your case I suppose you could complicate matters and add an external audio amp WITH volume control? 

audio amp with volume control

This would also then allow splitting the lower current "logic" supply from the higher current "power" supply.  So this could be driven by the DACR and DACL outputs. I understand KISS, but there is something un-American about just putting in a power resistor to simply convert excess volume into heat.  IMO that is.

 

I suppose one benefit is the spare audio channel is now buffered with higher current drive capability which could, for example, drive a motor or LEDs or who knows what. 

 

I was thinking more about your use of "just" a 7805.  So with 20V DC on the rectified bridge output, and (for the sake of argument) a 1 Watt audio load on the 5V regulator.  1 Watt = 5V x 200 mA average current...so the 7805 is burning 15V x 0.2A = 3 Watts. 

 

So further throwing KISS out the window, I suppose a 99 cent step-down regulator integrated with your PCB and maybe even a provision to charge a superCap as you suggested for the recent thread on the Dark Trolley station stop.

Attachments

Images (2)
  • no links censored
  • audio amp with volume control

If I do anything regarding the volume, when I round up the serial control specifications for the module I have, I'll just control it that way.  I've written the vendor I bought them from to get the serial interface specifications. 

 

Truthfully, I have no interest in adding yet another amplifier, even though it might be a way to solve this particular issue. 

 

As far as "just a 7805", look closer.   I'm using the Recom R-78E05 there, it's a small switching supply that is a replacement for the 7805T three-terminal regulator.  It will handle 200ma without breaking a sweat, it barely has any temperature rise with that current.  It costs about $2.50 in quantity, and it's the same one I use for the Super-Chuffer, so I buy them in quantity.  I started using that when I couldn't get enough power out of the 7005T without a heatsink.  I also figured that the total module power would be a lot less, and it is.  I'm not reluctant to spend a couple of bucks on a good solution for power like the Recom switching module, it's been very reliable for me on the Super-Chuffer and I haven't had any power issues.

 

I'm going to build a "simple" RF controlled MP3 player first, it'll be my test bed to work out any kinks.  I want to have a couple running around and see if my radio choices are really practical in the real world.  If that all works out, then I'll consider the larger 20-pin PIC part and do the TMCC serial, the RF interface, and the serial interface to the MP3 module for an all-inclusive module.  At that point I might consider moving the SC2272 onto the board in one of the SMT versions and using the small bare-bones receiver.  That would probably be the one that I'd try to make into a product, with enough flexibility, I may be able to get enough quantity to get them built.  I have to get to around 100 in an order to get the price down to a reasonable level, smaller quantities kill you for parts, PCB blanks, and assembly services.  

 

Originally Posted by gunrunnerjohn:
As far as "just a 7805", look closer.   I'm using the Recom R-78E05 ... the same one I use for the Super-Chuffer

Roger that.  Here I am holding your Super Chuffer board in my grubby hands and whadda you know!

At that point I might consider moving the SC2272 onto the board in one of the SMT versions and using the small bare-bones receiver.  That would probably be the one that I'd try to make into a product, with enough flexibility, I may be able to get enough quantity to get them built.

Sounds like a plan.  I believe the big opportunity is for general purpose (as opposed to just audio/sound) remote control of rolling stock.  So whatever you do I implore you to keep in mind all the animated/activated rolling-stock cars that , in today's world, only work when positioned on an activation track, or runs all the time, etc. etc.

I'll certainly keep the extra controls in mind, but it may not be as easy to do some of the stuff.  Lights or couplers are pretty easy, but stuff like animation would probably be all over the map.  I have used a couple of the model airplane servos for that task, but you have to tune the PWM to the specific application.  Unless I have a way to calibrate the output, that would be problematic.  Obviously, a simple digital on/off control is no problem, and perhaps several outputs that can control a variable speed motor would be useful.

 

 

John and Stan (and other contributors) - this - as usual - has been very educational and entertaining (and way beyond my electronics knowledge at this point).  But two (perhaps random) questions - at some level, it sounds like you two are reinventing DCC (a topic about which I know precious little at the detailed level).  I recall a few years ago seeing a video on the Yahoo S-gauge forum where the proud layout owner (and a nice layout it is/was) showed how he was able to operate different unloading cars essentially anywhere on his layout via a DCC system with the appropriate DCC hardware mounted in the various action cars.  The cars operated without need of the usual 'accessory shoe/rail'.

 

Now that I've said that - I think John said something earlier in the thread about using TMCC, which I guess would be similar.  Remind me - is the idea of using an RF control a more 'universal' solution - meaning those of us without TMCC or Legacy would be able to use it...??  Or is it more the problem of coming up with a robust TMCC kluge/hack?

 

A second question - a repeat of someone else's observation earlier in this thread - is it feasible to use a blue-tooth based system, with the advent of blue-tooth enabled speakers (or, presumably, rolling your own blue-tooth circuit board connected to a remote/mobile speaker)??  Might there be some advantage to having a 'fixed' audio source, with only the speaker end of the system mobile??

You are correct, since we're running command systems that are not compatible with DCC, so one solution is to use TMCC.  That would be compatible with TMCC/Legacy or DCS as they both run with straight AC track power.   The RF solution is the "universal" solution that can be used with DCS or TMCC, or indeed with conventional operation.  Currently, there is no DCS receiver capability to do a strictly DCS system, that's one significant hole in the MTH product line IMO.

 

I'm thinking in the near future that I'd probably merge the technologies and have RF and TMCC all in one package and be able to select between them.  I'm also waiting on several different RF packages with what may be higher quality radios for longer range, that will figure into what I end up building.

 

I saw the mentions of BlueTooth, but I want to have the ability to have perhaps five or ten pieces of rolling stock on one layout, all with unique audio files playing.  That seems like it would get a little tricky without writing a pretty involved BT application and having a computer to run it.  Of course, then you'd also have to have the BT host in the picture and be controlling the audio from that platform.  If I were only doing one channel, the BT might be a workable solution.  Even with multiples as I'm talking, I suspect it can be done with BT, but I know how to do it with the technology I'm using.

 

I've also seen other references to mesh networks like Zigbee, but having no idea of how complex that would get, nor the cost, I'm probably not going to invest time and energy in chasing that.

 

Originally Posted by richs09:

John and Stan (and other contributors) - this - as usual - has been very educational and entertaining

I'd say that hits the nail on the head. The hobby is great because it's a big tent. There are many ways to participate, enjoy, spend time (and money), etc.  I find the electronics aspect educational and entertaining, and no doubt there are countless times where I have "re-invented the wheel" so to speak. 

 

What's new are these insanely (low) priced electronic modules from Asia allowing  Lego-like construction of gadgets useful to our trains. It's not quite there yet requiring component-level "glue" to make them work together and that's how I see this particular project.  In some cases we need to change the glue, in other cases we need to change the pieces.

 

What's also new is forums like OGR to engage with like-minded folks. Not so long ago discussions like this were limited to the knowledge of the guys at the club, or to the Radio Shack clerk if you were lucky, or thru a snail-mail dialog with a magazine.  So keep your ideas (and questions) coming!

 

I now step down from the soap box.

GRJ, regarding your separate 5V supply, I notice the uC powered from U2 rather than the main 78E5.  Yes, the uC draws little current and should be relatively quiet on +5 but I'd think whatever RF module you end up with would be better off with a dedicated supply.  Stated differently, unless you're using some analog functions on the uC, I don't think it will be bothered by the 5V audio-side noise.  Just a thought...

The uP doesn't draw much, and I figured I'd rather not have it seeing the rather large swings I saw on the 5V supply with the MP3 player.  Note that I haven't powered the MP3 board with the switching regulator I'm using yet, I have to do that and see how well it regulates.  I think I have a better chance of it working well without the uP on the noisy MP3 supply.

 

I do note that with an 8 ohm speaker, the MP3 module is only drawing around 100ma on average, so I'm not getting nearly 2-3 watts to the speaker.  That's fine as it's already too loud using the little 1 1/2" ERR speaker and baffle.  Since I get one of those with each ERR RS-C I buy, and I don't often use them in the installations, they're piling up and will be just the right size to put into rolling stock.

 

I did go in and change the trace width from .006" to .01", that's twice the trace width "required" for half an amp of current, so I think it's conservative enough for what's going on here.  Let's be pessimistic and say we have 200ma, the computed trace width is 1.28mils, and I'm at 10mils.  Even allowing for parallel runs that increase the requirements, I think it's pretty conservative.  In addition, as I said, I really only see around 100ma to the board, so there is only about 1/2W of power available.  I suspect virtually all of it goes into the audio.

Regarding dropouts, if 200mA is indeed pessimistic then maybe a single 5V superCap might be OK (vs. stacking 2).  So at 0.2A, a 1F cap will discharge at "only" 0.2 Volts/sec - and a 2.7F less than 0.1 V/sec.  Your MP3 module says operation down to 3.6V and surely any modern uC will be fine at 3.6V.  So if you can get it charged up to anywhere near 5V, you have several seconds over which volume will fade slowly but I'd think imperceptible for short-time dropouts over dirty rail/switches etc. 

 

Your regulator datasheet specifies a max load capacitance of 220uF which I'm guessing is for load stability in its feedback loop.  So if I were designing in a superCap on the output, I'd want to know a bit more about why and hence the effect of isolating the capacitance with, say, a charging resistor which is what you'd probably use.  Also, I if you're isolating the superCap I figure the incremental cost of a Schottky diode may be be worth it to get another 0.4-0.5V of starting voltage.

 

Another idea is now that you have a uC in there, perhaps you could use its Brown-Out detect circuit at ~4 Volts or whatever and send a command to the MP3 module to mute.  I know you're not trying to squeeze every last penny out of the design but those superCaps are somewhat spendy relative to the other devices.  In which case a lower cost electrolytic maybe on the input side of the regulator could store enough energy to handle 0.2A of 5V audio for, say, 0.1 sec after which audio volume is cut reducing current to, say, 0.02A (10%) keeping the digital logic out-of-reset for a while longer in anticipation of voltage recovery so that the song doesn't reset/restart. 

 

Let's see. 1000uF cap charged to 20V = 0.2 Joules.  Let's say 60% of that is available after the step-down switcher so 0.12 Joules.  At "pessimistic" full-current load you need 0.2A @ 5V for 0.1 sec = 0.1 Joules.  So it's at least in the ballpark.

 

Are we having fun yet?

 

 

 

 

I did a brief measurement of the MP3 player at full volume on the bench, it varies between 100 and 110 ma on the 'scope.  That's playing an audio file with a rather high percentage of "noise", some of the quieter files actually run in the 70-80ma range, and I'm using an 8 ohm speaker.  When I insert some resistance (the only method without serial communication to the module) in the speaker leads, the current drops way down in the 50-60ma range.  I find a 30 ohm resistor still gives me probably as much volume as I'll want for most applications.

 

Given those power figures, let's do some calculating.  Figure the switching regulator at around 80% efficiency, which is below it's lowest specification.  We have at least 20 volts on the input with the rectifier and the cap.  So with the existing 330uf cap, we have about .066 Joules.  If I figure 100ma load for .1 second, that's .05 Joules.  So, the way I see it, I already have some protection against dropouts.  If I drop the volume as I suspect I'll have to do in most practical installations, I have even a bit more margin.
I know that the Super-Chuffer has only 1/2 wave rectification, and I can draw 100ma from that supply with a cab light, headlight, and the smoke motor, etc.  It has no problem with dropouts running normally, so I think I'm probably not going to have that bad a time with it.

 

In the future when I have serial communication to the MP3 module, I can do something a bit fancier.  I'm still looking for information on serial communication to the BY8001 module, that's a pacing item.

 

Yep, we're having fun!

 

GRJ, what about going back to the most common denominator and thinking inside of the box.

With all of the effort expended to use a remote, why not use Rare Earth Magnets (REM,o)oriented for effect, strategically placed on the track. A reed switch with equal orientation, triggered by passing over the (REM,o)  could supplant a remote. After all, using a remote, there are just four functions, in your design, at this time. One is an OFF function that stops any other sounds. Three others are regional sounds' on the track, like Station sounds, Mountain sounds and use your imagination sounds. Others could take advantage of this angle by placing the REM,o magnets wherever they want and tailor their sound-scape to the present 4 channel application.

 

I sense that I am going to be fired from this forum for posting this. Since I will miss all of you guys more than you would miss me; and I will miss you all for sure, I will leave my account open in case John & Stan didn't completely finish me off.

 

 

Originally Posted by Up with UP:

GRJ, what about going back to the most common denominator and thinking inside of the box.

With all of the effort expended to use a remote, why not use Rare Earth Magnets (REM,o)oriented for effect, strategically placed on the track. A reed switch with equal orientation, triggered by passing over the (REM,o)  could supplant a remote. After all, using a remote, there are just four functions, in your design, at this time. One is an OFF function that stops any other sounds. Three others are regional sounds' on the track, like Station sounds, Mountain sounds and use your imagination sounds. Others could take advantage of this angle by placing the REM,o magnets wherever they want and tailor their sound-scape to the present 4 channel application.

 

I sense that I am going to be fired from this forum for posting this. Since I will miss all of you guys more than you would miss me; and I will miss you all for sure, I will leave my account open in case John & Stan didn't completely finish me off.

 

 

Having been keeping up with this thread from the beginning, but not having anything to offer that wouldn't add complexity, haven't had anything to say.  This post by Up with UP got me thinking, however, that a little complexity might be fun.  

 

Rather than using the radios, or the simple magnetic switches, you could use a RFID reader and and place RFID tags where you want sounds to start and stop.  I thought of using this a while ago for other uses, but it had not occurred to me to use RFID tags to turn on and off sounds.  this would allow a practically limitless number of files to be used once you have the serial data figured out.  and furthermore to allow the sounds to be played at the appropriate location on the layout.  

 

As for radios, I'm partial to the very inexpensive 2.4GHz type, but these get a bit tricky in the coding end if you plan to use more than 6 devices.  

I'm sure the concept can be expended in the future, but I'm concentrating on the remote aspect right now. 

 

When I manage to get the serial data specifications for the MP3 module, then I could have practically limitless sound clips.  I actually have some RFID stuff that I was playing with here, that would allow you to trigger specific clips at a chosen place on the layout.

 

Truthfully, a combination of location triggered sounds and remote triggered sounds is the best of both worlds.  While we're at it, maybe an accelerometer to trigger curve specific sounds.

 

One of the hardest part is getting appropriate sound clips for all the things you might like to do with the sound modules.  I might have to have a website to start collecting all the various sounds.

Just found and read through this topic this morning. I have been considering a project like this for well over a year now, but have no where near the electrical experience or time to get deep enough knowledge to make it happen. The possibilities that these kinds of projects open in the world of O gauge are HUGE. Even larger if down the road you introduce logic circuits into a board like this. I believe there is a market for this product and I also believe that the core board is not the only marketable part of the product. I'm interested to see where this goes.

It'll be interesting to see where it goes.  I've been thinking about something like this for some time as well.  Recently, as the quality MP3 player modules started showing up, it seemed like a more practical project, so I decided to jump in and do some tinkering.

 

In the long run I see this having a core microprocessor and multiple activation methods.  I like the RFID idea, that allows position dependent triggering of the sounds.  The remote triggering gives you ad-hoc sounds wherever you are on the layout.  Finally, other sensors can be used, as I mentioned above, for specific sounds on curves or when running or stopped.  I'd like to have it compatible with TMCC control as well as the RF option.  That allows it to be used for TMCC/Legacy, DCS, or even conventional operation.

 

As you say, endless possibilities.

 

Originally Posted by gunrunnerjohn:

It'll be interesting to see where it goes.  I've been thinking about something like this for some time as well.  Recently, as the quality MP3 player modules started showing up, it seemed like a more practical project, so I decided to jump in and do some tinkering.

 

In the long run I see this having a core microprocessor and multiple activation methods.  I like the RFID idea, that allows position dependent triggering of the sounds.  The remote triggering gives you ad-hoc sounds wherever you are on the layout.  Finally, other sensors can be used, as I mentioned above, for specific sounds on curves or when running or stopped.  I'd like to have it compatible with TMCC control as well as the RF option.  That allows it to be used for TMCC/Legacy, DCS, or even conventional operation.

 

As you say, endless possibilities.

 

 This thread has been very interesting to me.  I have done 4 cars now with sounds, but I am limited to one sound per speaker - because that is the technical knowledge I can work with.  with some of the plans you have here my sound car fleet will get much more impressive

Originally Posted by Up with UP:
I sense that I am going to be fired from this forum for posting this. Since I will miss all of you guys more than you would miss me; and I will miss you all for sure, I will leave my account open in case John & Stan didn't completely finish me off.

 

Not at all!  This is what this forum is all about. 

 

You could simply bypass the RF portion of circuit and trigger the MP3 module with your oriented reed switches.  So now you can start (up to) 4 unique sounds based on postion on the layout.  There would then be a 5th reed switch orientation that stops any sound.

 

As I see it, in the big scheme of things it's the recent availability of these DIY insanely (low) priced MP3 modules that is the windfall to O gauge trains.  The engine manufacturers have done a pretty good job with sound quality but the accessories and rolling stock have just not kept up.  And not just the sound quality but the length of sounds.  For years the "standard" was a set of IC chips with greeting-card voice-quality sound that came in increments of like 10 seconds.  A 2 minute chip was "big" and had a big price.  Now you get hours of music-quality sound for less $.

 

But beyond the triggering there are many other details that GRJ has worked out to install the sound module into a piece of rolling stock...such as managing the whole power supply issue and that pesky AC-voltage used in O gauge. And he openly shares how he is doing it so anyone can decide if it's something they want to undertake or use as the basis for their own project.  That's a real contribution to the hobby.

I guess price point matters.  These cars have been available.  RS and Crew Talk Cabooses and stock cars, Diners.  It was just a matter of how far and what types of sounds to install.

 

I really wonder how big the market is though.  You have  a whole group that don't want sounds and talk on engines.  So I doubt they would buy these items.

 

Seems like this would be easy peeze for the manufactures to do, with remote control via their systems.  Yet they chose not to.

 

I still go back to the MTH Coors train.  Remote control sounds, animated features and smoke, all controlled via the DCS system and the PS-2 board talking to the auxiliary cars.   Why no follow up with working railroad cars is beyond me.   G

George, I'm not really worried about the market, I started this project, as with others, for my use.  I'm not a major manufacturer, and I don't think like one. 

 

I would point out that the VL tank cars are scarce and expensive.  Also, the VL PFE Reefer sets are all sold out in advance, and now you pay a big premium over MSRP to buy the VL tank car sets, and I suspect after a spell, the VL PFE Reefers.  Obviously, someone must like the sounds.   Lionel is also bringing back the Station Sounds Diners as well.

Last edited by gunrunnerjohn

I don't have any sound cars, but I really like the idea of having additional sounds. I also like the crew talk, and other sounds we have available now, but they are somewhat limited. Even with the current sound cars offered, you are still stuck with whatever they want to put in them and also how much they want to have in them. Having your own, whatever you want and as many as you want would really be a great addition.

 

As far as the folks posting here to estimate demand for sound, I wonder if we don't just hear from the ones that don't like the sounds a lot more than we hear from the ones that do? I would bet there are many more sound users than folks turning it off, especially if kids are involved or promotion of the hobby is the goal.

I'm not really worried about the naysayers, I know some folks don't like the sounds, and others do.  I don't routinely use the crewtalk on most locomotives because it's usually kinda' lame.  OTOH, more "natural" or entertaining sounds coming from a number of cars in the consist is pretty cool, so I'm all for that.

 

Clearly, as I stated before, the fact that most of the sound equipped rolling stock sells quickly and many times at a premium speaks for itself.

 

Originally Posted by rtr12:

...with the current sound cars offered, you are still stuck with whatever they want to put in them and also how much they want to have in them. Having your own, whatever you want and as many as you want would really be a great addition.

This feature is the key in my opinion.  Yes, there's at least one supplier that you can send in your sound and they will program it onto a sound module.  But now you just program whatever you want using your PC/laptop/tablet and your rolling-stock or accessory is playing that sound right now!

 

Plus, the major manufacturers will never be able to provide real music because they can't afford the licensing fees.  But for your personal use, the sky's the limits.  Let's see.  The train stops, the boxcar door slides open, there's a band, hey it's the Rolling Stones!, music starts playing Can't get no Satisfaction in MP3 quality sound, song finishes, door slides closed, train pulls away.  You're limited only by your imagination.

 

The length (hours not seconds) of sound with these MP3 players opens new opportunities.  So for station sounds you can literally go to Grand Central Station or wherever and record hours of actual station sounds and play them back on your layout.  Imagination becomes the limiting factor...

I'm going to take a train ride on a local RR company's freights and I have a couple of USB stick audio recorders.  I'll Velcro them to locations on a couple of cars for each direction of the run, then I'll edit the mess and see what I get.  Real freight car sounds!

 

Stan, I did see that I forgot one detail in my design.  The BY8001-16P only accepts a 3.3V input, for 5V inputs you need a 1K resistor in series with the outputs of the uP.  I don't know if I'll change the processor for 3.3 or insert the resistors.  Either way, it's a little 'OOPS".  The MiniCommander one has the same issue, but there's only one location where 5V logic goes to the MP3 player, easier to fix.

 

 

I think this whole project is a great idea myself. I really like your (stan2004) idea about the bands playing when the boxcar opens up, very good idea and would be pretty neat to have on one's layout. People that don't currently like the crew talk and announcements will probably also be interested, once they see this in action.

 

Along with GRJ's sound website he was talking about earlier for gathering sounds to play, an idea section for how to use the sound modules on that site would be great to have as well. I bet the grand kids will be able to come up with some interesting ideas too (probably a lot better than any of mine will be).

 

This is a very exciting project and I am also very glad it is being shared with all here on the forum. Although once GRJ gets things perfected, I will probably just try to get one (or more) of his. That is if he decides to offer them to others.

Last edited by rtr12
Originally Posted by gunrunnerjohn:

I'm going to take a train ride on a local RR company's freights and I have a couple of USB stick audio recorders.  I'll Velcro them to locations on a couple of cars for each direction of the run, then I'll edit the mess and see what I get.  Real freight car sounds!

 

Now that's what I'm talking about!  What strikes me is how with "hardware" it can be difficult to explain how to change a 5 cent resistor or capacitor to change the behavior of some widgit.  Soldering can be a royal pain. And of course that 5 cent part requires a $5 shipping charge or waiting a month from China.  If you make something like this available, we can share/email MP3 files to completely change the behavior.  IMO this is a game-changer.

 

Either way, it's a little 'OOPS".  The MiniCommander one has the same issue, but there's only one location where 5V logic goes to the MP3 player, easier to fix.

 

Below the radar!

 

 

BTW, I have one of these ~$6 DTMF (touchtone) decoder modules on order 251600411636

 

$_12 

This is to decode the spare MP3 stereo channel to embed up to 4 channels of animation motor/lighting control.  I'm going to use the $1 MP3 player to test this but I'm thinking if you make your module available I'd want to let the DIY ambitious join the party. To that end, on your next revision how about bringing the unused audio channel, +5V, and GND to a 3-pin header on a board edge to make it easier to connect? 

 

Attachments

Images (1)
  • $_12

I wasn't being a naysayer, just pointing out observations when others said how much of a market there is for this.

 

I realize John and Stan are doing this as a hobby and much of it for themselves.

 

But I don't think Lionel and MTH would leave money on the table if there was a high demand, and both companies have the tech to do this.

 

No need to shoot me for a simple comment.

 

Sure odd off passenger cars are always in high demand, same with the Vision Line set.  but crewtalk cabooses and stock cars DID NOT sell well.  Folks complain about $70 stock cars, $120 just don't sell.  Which is why I mentioned price point.

 

A hobbyist can do this for less then what a manufacture can with direct access to these components.   G

Originally Posted by GGG:
I realize John and Stan are doing this as a hobby and much of it for themselves.

Exactly.  It's about having fun!

 

I only speak for myself but, for example, we both have built a DIY O-gauge motorized Oscar Mayer Wienermobile car.  I for one am imagining mine rolling down the track playing "Oh I wish I were an Oscar Mayer wiener..." and "My best friend has a first name, it's O-S-C-A-R..."

 

wienermobile

I haven't seen one of their TV commercials in a long time, but I believe they still drive those things across the country and it's said to be a great summer job for a college kid!

 

Attachments

Images (1)
  • wienermobile

I think we just slapped you around a bit George, we didn't shoot you.   I agree there's a big difference between doing this on a shoestring and doing it in a corporate environment. 

 

Stan, I need to save up all these ideas and see about adding stuff.  I think when I do the microprocessor version with serial data for TMCC and serial out for the MP3 control, that would be a good time to add some digital controls and bring out both of the analog stereo channels.  I'll want to use some smaller connectors so they don't take up a ton of space, I have a few of the 1.25mm ones that Lionel uses in a few places.

 

FWIW, I have what might represent sort of a document on the BY8001-16P command set.  I've pieced together a bunch of documents, did a few Google translations of Chinese stuff, and then cut-n-pasted together a composite that may be enough to use the serial protocol.  The translation wasn't perfect, and a few places got weird overlayed text, but pretty close.  I'm going to dust off my old serial protocol analyzer and see if any of these command sequences work.

 

Document attached.

 

 

Attachments

Originally Posted by stan2004:
I for one am imagining mine rolling down the track playing "Oh I wish I were an Oscar Mayer wiener...

 

<...snip...>

 

I haven't seen one of their TV commercials in a long time, but I believe they still drive those things across the country and it's said to be a great summer job for a college kid!

 

Stan, mine does sing the theme song.

 

I just saw one the other day, they're still driving them around.  I believe it was last winter when this one crashed.

 

 

Then there's this one, but not much damage.

 

Last edited by gunrunnerjohn

The first prototype is in the can.

 

Here's the ERR MiniCommander ACC first prototype.  Other than a missing resistor that I had to cobble in, and making a mistake on the size of the two IC chips, all is well.  I violated my self-imposed limit on chip size, and they were a giant PITA to solder on.  Before I build any more of these, I'll be changing those to the slightly larger packages.

 

That's all behind me, and I'm happy to report that it works as intended!  I'm going to install it into a boxcar for it's first road test.

 

 

MC MP3 Interface Module N1

MC MP3 Interface Module N2

MC MP3 Interface Module N3

Attachments

Images (3)
  • MC MP3 Interface Module N1
  • MC MP3 Interface Module N2
  • MC MP3 Interface Module N3

I've thought about a motion detector, there are a number of options for those.  However, in a steady-state speed on a straight track, you won't have a sense of motion.  I'll believe it when I see it.  Here's the Train Tech Sound Page, it apparently uses a small coin battery.  The user's manual has more details, and I'm not overwhelmed with what they have so far.  I think you'll see the difference between that power source and several watts of power from track voltage.

 

Carl, I want a car with two pickups, as track power interruptions will be an issue.  I'll figure something out.

 

Kris, the real problem is this particular product isn't really suitable for O-gauge, so it's unknown how much an O-gauge product might cost.

 

I also note that when you read the description, they don't know how fast the train is running, so synchronized chuffs or prime mover sounds are not possible.  In addition, the fact that they use a simple metal ball in a contact sphere leads me to believe that in steady-state running it would think you were stopped as I mentioned previously.

 

This may be good enough for the HO guys, but I want better sound in my trains.

 

Trains are incredibly loud and noisy contraptions.  I'm imagining a scenario where sound modules can be put in EVERY car - not just in the expensive engine.  This only can happen if cost gets low enough...but that's exactly what has happened in the last couple years with these insanely-priced, miniature-sized Asia electronic modules.  MP3 players, RF remote modules, etc.

 

A byproduct of the Fitbit and smartphone activity trackers and navigation systems are these motion detection modules for less than $2 shipped (121658851348).  3-axis accelerometer and 3-axis gyroscope on a single IC chip.  It's absolutely incredible considering just a few years ago you'd pay a fortune to just get a single-axis solid-state accelerometer chip. 

 $_57

Yes, it requires a microcontroller or processor and lots of software to take advantage, but there are countless O gauge applications if someone puts their mind to it.  Let's see.  Detecting going around a curve to trigger wheel squealing, detecting initial motion or stopping to trigger coupler slacking or compression, detecting rail joints to generate truly synchronized clickety-clacking, well you get the idea!

 

To date it's been impractically expensive to put sound in EVERY car (plus the engine) and maybe it's a fool's errand to do so.  But imagine the effect of a consist rolling by that actually sounds like the prototype...rather than sound coming only from the engine and 50 trailing cars silently tagging along...

 

Also, in my opinion, O gauge is the smallest scale where the sounds can have enough volume and fidelity to make it worth the effort.  Yes, speakers have gotten better over time and to each his own, but I think it takes about a 50mm/2" speaker which just fits into O and will never fit in HO or S.

 

Attachments

Images (1)
  • $_57

Dear Carl (Moonman)

 

"Wouldn't an MTH boxcar be the easiest? Screw attachment. The E O T truck would work as a swap out for a power lead." I like you idea, I think this would work best. I was think of using a Lionel flat car 6400 series and a box car that I have in my inventory. But with all the mod that have to be done to the Lionel cars it might be cheaper to purchase second hand MTH cars. I am looking for the box car and flat car to be in black color any suggest?

Dear John

 

My younger son models in HO (DC only no DCC) and has a small layout that I built him.  The price of the Train Tech out my price range and I think your design is better. I probably will in the not distant future use your and Stan's design in my younger son layout but not his year. Too many project to complete and the honey do list is growing again.

Originally Posted by nvocc5:

Dear Stan2005 and GRJ

 

If you two could give on line course in the wonderful world of electronic you gentleman would make a fortune. Both of you gentlemen never stop to amaze with me with what you can come up with next. This is one of the reason I am glad I joined this forum,

I would agree that John and Stan have a lot of knowledge between them.  As for a course, it's all out there already, for free.  tutorials on the use of every module imaginable, and how to connect them to micro-controllers, PIC's, and computers abound on youTube, as well as introductions to electronic components and theory.  Even if you don't want to get hands on with electronics, I'd recommend watching some of the better done introduction to electronics videos out there.  Having even a limited understanding will be an asset.  

 

"I am always doing that which I cannot do, in order that I may learn how to do it." - Pablo Picasso

Originally Posted by nvocc5:

Dear Carl (Moonman)

 

"Wouldn't an MTH boxcar be the easiest? Screw attachment. The E O T truck would work as a swap out for a power lead." I like you idea, I think this would work best. I was think of using a Lionel flat car 6400 series and a box car that I have in my inventory. But with all the mod that have to be done to the Lionel cars it might be cheaper to purchase second hand MTH cars. I am looking for the box car and flat car to be in black color any suggest?

Kris,

I don't know the rolling stock well enough. It's easy enough to search the website and scroll though photos of products.

 

I don't know of many rr's that had black box cars. I have seen black flats and hoppers.

 

I am loading out to work on the layout restoration project, so I will try a few things later.

Originally Posted by nvocc5:

Dear Stan2005 and GRJ

 

If you two could give on line course in the wonderful world of electronic you gentleman would make a fortune.

Lots of sources as mentioned for some basic electronics training.  I started tinkering with electronics when I was around 10 years old, for the first years it was mostly disassembly, but by the time I got to my teens, I could actually build and fix stuff.  I say this to illustrate that the knowledge didn't come quickly, it took years and later more years of school to have a solid base to work with. Most of my working life I was also either doing software or hardware design, and many times a combination of both.

 

It's like any other skill, it takes time and dedication to learn it, as well as constant use.  I find after I haven't used something like the PCB layout package for a few months, I have to retrain myself on some of the things I learned and forgot.

 

Best advice I can give is to look at some of the basic electronics sites, and then try a few things.  Sure you'll get smoke occasionally, but you'll also find out that it's not that hard to do some of the simple electronic projects.

Originally Posted by gunrunnerjohn:
Originally Posted by nvocc5:

Dear Stan2005 and GRJ

 

If you two could give on line course in the wonderful world of electronic you gentleman would make a fortune.

Lots of sources as mentioned for some basic electronics training.  I started tinkering with electronics when I was around 10 years old, for the first years it was mostly disassembly, but by the time I got to my teens, I could actually build and fix stuff.  I say this to illustrate that the knowledge didn't come quickly, it took years and later more years of school to have a solid base to work with. Most of my working life I was also either doing software or hardware design, and many times a combination of both.

 

It's like any other skill, it takes time and dedication to learn it, as well as constant use.  I find after I haven't used something like the PCB layout package for a few months, I have to retrain myself on some of the things I learned and forgot.

 

Best advice I can give is to look at some of the basic electronics sites, and then try a few things.  Sure you'll get smoke occasionally, but you'll also find out that it's not that hard to do some of the simple electronic projects.

Sometimes I fail to consider that most folks are not born with a silver solider in their mouth, a hand holding a part in place and the other on the iron.  Yes, it will take years to  have a firm understanding that comes only with experience.  That shouldn't stop folks from trying to learn, if it interests them.  I do think the prevalence of these cheap modules from asia that need only Vcc +/-, Tx and Rx make what was once complex electronics now achievable for even the novice.  

Kris,

 

Here are a couple of youtube channels that you might like for learning more about electronics.

 

EEVblog - He has tutorials on different electronic components and circuit designs. And just about everything else electronic. A lot is over my head, but some of it is understandable, especially after following GRJ & Stan for a while. He explains some of the parts and circuits similar to what GRJ & Stan use here on the forum. May not be exactly as used here, but you will get the idea.

 

mjlorton - He does a lot with multi-meters among other things. I haven't watched this as much as the one above, but there is good info here too.

 

Now back to regular scheduled programming...

Speaking of modules from China, here's the completed project with one.  It passed it's track test with flying colors, though I did have to add one capacitor for the MiniCommander to trigger properly, the triac thing again.

 

Both the MC and the MP3 module are mounted on Velcro for easy maintenance if necessary.  I used the Lionel style 2.54mm connectors since I have the tool to crimp those contacts.  In the future versions, I may go to a smaller connector.

 

The second picture illustrates the placement of the MP3 module, just open the door and you can change the sound SD card or update the one you have.

 

The volume turns out to be pretty close to right, though in the future I want to have a volume control to crank it down a bit.  I figure if you had four or five of these running around, you'd probably want lower volume.

 

 

MC MP3 Sound Interface Car N1

MC MP3 Sound Interface Car N2

Attachments

Images (2)
  • MC MP3 Sound Interface Car N1
  • MC MP3 Sound Interface Car N2
Last edited by gunrunnerjohn

If you were to program the MiniCommander as a TMCC engine, you should be able to control it using the DCS controller.  That, of course, assumes you have a TMCC or Legacy command base connected to your TIU.  I have yet to try this, but it should work.

 

By request, here's a short video with the finished car.  I'm controlling this with my workbench CAB1, obviously it works with Legacy as well.  It's programmed as an accessory, though it can be set as an engine as well.  You won't see much motion as it's on a test track on the bench.  It sounds the same on the tracks, and I'm happy to report there was no issue at all with dropouts of the audio running around the loop.  We'll see on the much larger club layout, but I have high hopes that it will work fine there as well.

 

Several of the sounds I'm using are over 40 minutes long, and the roughly ninety minutes of audio is using 78 megabytes of the 2 gigabytes of storage on this rather small two gigabyte SD-RAM.  Clearly, you could have hours of MP3 files available.

 

 

Last edited by gunrunnerjohn

Stan,

 

That brief "hickup" is the 5th sound, it's my "null" sound.  Since the mode the player runs in has no way to turn off the sounds, I've reserved one sound file as the "turn off" sound.  I can make it more silent, I just didn't bother yet.

 

I actually moved the "turn off" sound to one of the primary four channels, it was more reliable that way.  To get to the 5th sound, you first click the "turn off" sound, then the second button.

 

The reason that's a bit of a kludge is because of the way the ERR MC works, there is no "pulse" mode on the two low power channels, only on and off.  Since I'm edge triggered, when I have one of them on, then turn the other on, it triggers the 5th sound.  It worked out better to put the "turn off" sound on one of the those channels and have the combo be one of the working sounds.

 

It has plenty of volume with the ERR speaker and baffle, I'm very pleased with the sound level!

 

 

Do you think we need a "standard" for dropout tolerance?  If a conventional operator presses direction, if the reserve requirement is, say, 0.5 Joules (100mA @ 5V for 1 sec), a 330uF won't cut it...even charged at full-command voltage.  And of course since we're talking conventional, there would never be 18V on the track.

 

I realize you're thinking TMCC/Legacy so command voltages, but curious is you've considered some "simple" way (e.g., just add a capacitor) to support conventional without unnecessarily complicating the circuit.  This would be, for example, if the user operated it with the eBay remote or TBD optical/magnetic location-based triggers vs. O-gauge command control.

Stan, I found a 560uf capacitor that fits the same footprint, so I figure as a start I can replace the 330uf with that one.  I was pleased that this car made it over several back-to-back O72 switches without an issue, so there is some drop-out resistance.  For other than conventional, I think a one second drop-out isn't too likely, and I suspect the larger capacitor would do the trick for command use.

 

Once I get the RF basic version working, and I am confident the radios give me the performance I need, then I'll do the all-in-one version.  At that point, I'm thinking of seeing how I could use super-caps to enhance the dropout resistance and provide for conventional operation.

 

One of the things I want for the all-in-one version is the ability to play more sound selections.  With the four channel remote, you actually get 15 combinations as you can press multiple buttons and get coherent multiple outputs.  I could have perhaps ten sound files and use three or four for aux functions, and finally perhaps the all bits for a reset that would stop any sounds and action.

 

So many possibilities...

Last edited by gunrunnerjohn

Just to let you guys know, I fixed the "null" sound with a second of silence, no more audio glitches.

 

Next up is to build up one of the RF controlled units and see how that works.  I have the boards coming, and of course I identified some fixes I'll have to do before I can fire them up.   I have a couple different radio packages coming to see if I can get decently long range from one of them.

 

I got one of the SuperHet radio receivers in today, so I decided to do some range testing to see which way to go.  I compared the new receiver with my existing Super-regen models, and I'm pleased to say that both have sufficient range.  I was able to activate either receiver from over 100 feet away and through at least three walls to the outside.  The receiver was at one end of my house on the second floor, and I was at the other end (house is 85" long), and out on the deck, both receivers were still working from that range.

 

Looking forward to the prototype of the RF board arriving.

 

Did you have a helper or do you have really good hearing?  I'm trying to imagine you 3 walls away pressing the remote listening for the sound!

 

Anyway since we're just flapping our jaws, tell me more about the economics of using an ERR module for the TMCC decoding (I am not a TMCC user so pardon my ignorance).  As I understand it, the cheapest ERR decoder is the EX for $25.  So are you picking off the TMCC serial stream and you're paying $25 for a module that demodulates an FSK 455kHz signal?  Or is the plan to take advantage of some of the ERR buffered outputs that can drive higher currents...and independently pick-off and decode the serial stream for sound triggering? 

 

Stated differently, I think it's hard to imagine seeing $2 eBay module (free shipping of course) hat demodulates 455 kHz.  So in terms of bringing universal remote control to the world (at a reasonable cost), in my way of thinking means you need to provide the 455 kHz FSK demodulation function - a few dollars in parts using a single-chip IF amplifer IC chips plus a 455 kHz ceramic filter.

I cheated and had my wife with a radio tell me when the LED lit on my little test board.  I was actually somewhat impressed with the range, I didn't expect it to work that well.

 

Yes, it's my plan to use some Lionel board for the serial input.  I'm pretty sure that I'd have to license any receiver that receives the TMCC track signal, there has to be a reason that all the 3rd party TMCC folks were all using the R2LC in their designs.

 

I also don't want to re-invent that part of the wheel, as you not only have to receive the 455khz, but you also have to decode the incoming input data and generate the serial data output. I'd be glad to combine forces if you want to take a lash at that part.

 

It's the same reason I didn't relish the idea of trying to decode MP3, I've looked at doing that before.

 

I figured to use something like the dummy locomotive board and have the couplers and lights covered if I wanted to use them.

 

The good part about a modular design like I'm contemplating is that you can use the board without the TMCC component if you don't need it for your application.  You can just use the RF side and/or any RFID triggering or other independent triggers that I incorporate into the design.

 

My thought would be, rather than decode the 455KHz track signal, just take the serial data out of the command base, and build a transmitter at the base station that uses the same, or some other, frequency as the current remote.  This has been the model I'm using in various projects, using a raspberry Pi to interface between the TMCC base and 2.4GHz wireless modules in locomotives.  

I can understand the benefit of it being a stand alone unit, and if the price point is right, doing it that way, go for it.  My head always thinks on the cheap, hence having one add on to the command system that allows wireless communication to any number of other devices.  Ex, a module that connects just as a switch controller or such to the serial connection on the base, which pretty much just re-broadcasts the data on another, easier to use, frequency.  

Originally Posted by JohnGaltLine:

... which pretty much just re-broadcasts the data on another, easier to use, frequency.  

that's interesting.  so does the TMCC serial output from a R2LC board exactly mimic some accessible serial stream on the command base?  If that's the case then dump the whole 455 kHz thing, install a 315 MHz, 433 MHz, 2.4 GHz, whatever Hz RF link and it's got to be cheaper than using an ERR module (even with the few buffered outputs it provides).  This would be direct modulation and demodulation.  If you need to packetize the data as on the 99 cent 2.4 GHz 24RF01 module or whatever it is, then not apples-apples.

 

Is this what you mean?

Stan, I'm unsure, with out looking into it further, how the costs, and troubles balance out. the serial port on the tmcc base, (also legacy?) mimics the exact data that is sent over the track signal.  you still need to decode it to know which device is being addressed.  I do this with an ATMega microprocessor, but a PIC will probably do just fine for someone that knows what they are doing. ( not me, as of now.) As for packets and such, it depends what transceivers you decide to use.  I'm using NRF24L01 2.4GHz boards, which can be rather complex.  Fortunately other folks have released open source libraries for Arduino (ATMega) that do all the work for me.  There are 450Mhz boards out there very inexpensively that send a straight serial stream.  Also, slightly pricey bluetooth and standard 2.4GHz ones

many ways to do this.  i'm not familiar with the licensing issues of the R2LC decoder but i can't let go of the onerous cost burden on every piece of rolling stock to achieve remote control.  again, i know little about the tmcc system but it seems to me the MTH dcs system sends some kind of TMCC serial signal to the TMCC command base to talk to Lionel products.  That said, it seems this serial protocol (with the addressing) is a known quantity.  So a simple translator could convert TMCC packets (with addressing) into the eBay 315 MHz packets (with addressing).  This way you don't need TMCC 455 kHz decoders on each piece of rolling stock using just off-the-shelf low-cost eBay RF decoder modules.  Some of these even have relays on board for a few dollars.

 

The curious thing about this approach is a DCS user could talk to multiple rolling stock using TMCC addressing and NOT need an actual TMCC command base since the signal is being sent over RF and not over the 455 kHz signal.  I had previously pondered how to use the MTH TIU or Lionel ASC/SC2 accessory controllers to send the eBay RF signal but you'd quickly consume all available ports.  Using the TMCC addressing mechanism, this would allow a DCS user to address multiple rolling stock devices inexpensively without tying up one TIU relay port per rolling-stock function.

When you read the issues and answers on this forum, one thing becomes apparent, at least to me.  Many folks want something dirt simple, as in turnkey.  Also, starting out to build an RF link isn't something that I want to jump into, certainly not for the first generation of this idea.  As far as some of the more expensive ideas like BT and the like, for the money I might as well just use the TMCC solution that I already understand. 

 

All of these ideas sound really simple when you just write them down in a message, but when you actually have to design, build, implement, and debug it, it always seems to get a bit more complicated.  I'm trying to make something that I can produce in some quantity without too much of an onerous development cycle.  I realize that there's no way that you can please everyone, no matter what the end result is. 

 

One of the nice things about discussing it early here is different ideas get exposed, and maybe something gels.

 

Dear John and Stan

 

I have a question for both of you.  Here is the idea for the proposed build.

 

MTH Rail King 30-7711 NS Caboose that has lighting.

12 RF Wireless Remote

Mini Digital DC 5 V Amp

MP 3 Music Player

AC/DC to DC Buck LM 2596 set at 5V DC.

NE555+CD4017 Light Water Flowing Light LED Module DIY Kit (Knight Rider)

 

Instead of using a box car and then having to change the wheels for power pick up I opted for large caboose that already had power pickups at a great price.

 

Here is my question regarding power management.

 

I would like to also install LED light on the roof of the Caboose and marker lights. Would I need a GRJ special for the LED and marker lights or could I use the power provide by the AC/DC to DC Buck LM 2596 set at 5V DC power the Led and marker lights? Or I am pushing the limit what the AC/DC to DC Buck LM 2596 set at 5V DC can provide?

Given the hassles finding powered-trucks I see you went with a caboose after all as Norton suggested in the other thread

 

https://ogrforum.ogaugerr.com/t...-6000-gondola?page=1

 

So why do you need a 12 RF Wireless Remote?  Why 12 channels if that's what it is?

 

The LM2596 module will have more than enough power to drive additional LEDs - dozens of them including all the LEDs in the 555+4017 module if that's the one I see on eBay for a couple bucks.

 

Now that you have things more focused, perhaps start a new topic specifically on a remote-controlled Knight-Rider sound-light car or something like that.  There might be some confusion with GRJ's project as the underlying sound module is different.  Just a thought though...

 

For clarity

I have not grasped why folks want to change the TMCC/Legacy Operating system, but I have to believe it is a small, small market.  If they can build the operating system, they can build what they need to make John's MP-3 sounds work on their layout.

 

So seems like 2 versions if I have this correct?  The universal remote, which is cheap, universal, but introduces another remote device.

 

And the TMCC device, which operates in TMCC/Legacy, but drives the price up because of the R2LC type device required.

 

Or you have to try and build a R2LC from Ebay parts for cheaper than Lionel and try to get around licensing/patent.  G

My end goal is to have one board that will accept either the RF remote receiver or a serial input from a TMCC board.  That way you can have either version, and I only have to make a single board. You can also select the RF version and not need the TMCC capability or expense of a TMCC receiver.  For in individual, shopping for used parts on eBay is one thing, but if I'm going to make a bunch of these, I have to have a more reliable supply of parts.

 

The combined board will also allow access to more unique sound clips, I think I'm on the verge of working that out so I can access at least a dozen sound clips using the RF remote or TMCC.  It would be really cool to trigger some sounds using RFID sensors along the track.  Since the MP3 player has virtually unlimited potential for the number and length of sound files, anything's possible.

Well, progress.  The RF prototype is done and works great.  I get around 100 feet through several walls as far as range, more than I would have expected.  Clearly, I can get away with the RF module that I'm currently using.

 

This one has the same capability as the MiniCommander version, five sounds, but if you want to have a "shut-off", one of them has to be a null sound.  Obviously, that's not totally necessary, it could be a short clip of something that will run to completion and then stop.

 

I think this version deserves to get a PC board update (which I need to correct some other issues) to allow multiple transmit codes.  That will allow you to separately control multiple sound cars on the same layout.  I was concerned about the range, but after my initial tests, I think that's a non-issue.

 

Yes Stan, you'll be happy to note that the power supply EMI from the MP3 board was obviously the major issue.  The separate regulator for the uP and the receiver solve that problem completely.

 

The next step is a big one, combining both of these capabilities into one board, that's going to be a longer timeframe...

 

 

RF MP3 Interface Module N1

RF MP3 Interface Module N2

RF MP3 Interface Module N3

Attachments

Images (3)
  • RF MP3 Interface Module N1
  • RF MP3 Interface Module N2
  • RF MP3 Interface Module N3
Originally Posted by gunrunnerjohn:
I think this version deserves to get a PC board update (which I need to correct some other issues) to allow multiple transmit codes.  That will allow you to separately control multiple sound cars on the same layout. 

Are you going to use a "learning" receiver to deal with the addressing? 

 

Would the user have to solder pins on the 4-channel transmitter to change/set the address?

The one issue with the learning receiver is it apparently responds to all of the 4-button remotes of the type above when it learns one of them.  Also, I have another set with a similar receiver, but it only recognizes it's own remote, not any of the others.  I have yet one more coming, but from the variability of them, I don't know that's a workable solution. 

 

I'm guessing it'll have to be the jumper trick as I don't think I want to get into screwing around trying to match transmitters and receivers.  I'd like to figure a cute way to have the transmitter be able to select multiple receivers.  I'm also thinking I could have different receivers available and just ship a numbered receiver with the unit.  It's the transmitter selection that I'd like to solve.

 

I'm making final changes to the PCB, things like the missing resistors, adding a more robust secondary voltage regulator, etc.  The TO-92 one gets pretty warm, only 55C-60C, but I'm somewhat of a conservative type, and I'd like it to have a bit more capacity.  The new one is surface mount with a tab do the PCB will soak up some of the heat generated.

 

I also stuck a little SMT LED on the board to indicate you are receiving data, the "busy" on the receiver was a perfect place to pick up that info.

 

Just so I understand how learning works, do you push the button on the receiver, then you have up to X seconds to send any code (1 thru 4) from the transmitter, and the receiver then stores away the upper address bits?  Or did you receive a small instruction sheet and if so can you post it or link it?

 

If it's using the 2262/2272 chip pair set, it could be the data-rate resistor is different for the pair that only works with each other.  That's the resistor with a value in the 500K to 1M range.  Same bit pattern and same 315 MHz carrier but at a slightly different "baud" rate.  The resistors must match on the tx and rx modules.  Just speculation though...as I suppose a smart learning resistor could auto-baud (remember that from the old-days?!) and learn the bit rate coming in as well as the address!

 

In any event, on the receiver learning side, if it responds to all 4-button remotes when it learns "one of them" then what is that learning?  I thought if you mod different transmitters to be at different addresses, then you would press the learn button and within X seconds press any key on the desired transmitter to pair that transmitter and receiver.  Then go to the next receiver, press learn, and within X seconds press any key on a different transmitter (set to different address).  Etc..  No?

 

Yup. Sure would be a hassle having to modify the transmitter remote with a multi-position slide-switch or whatever to select different addresses.  Re-packaging the board into a different case also seems impractical.  This one's a head-scratcher.  Maybe someone else has an idea.

 

And I'll say it again. Ignoring the TMCC licensing thing for a second, it sure would be neat if you can just decode the TMCC serial command with it's address and use that as the address sent over the 4-ch universal remote.  That way you use the TMCC remote (or DCS remote) to select the sound card address, still use the "learn" mode of the receiver; but this would require decoding the TMCC serial command to re-transmit it over the universal RF protocol.

 

 

Originally Posted by stan2004:

Just so I understand how learning works, do you push the button on the receiver, then you have up to X seconds to send any code (1 thru 4) from the transmitter, and the receiver then stores away the upper address bits?  Or did you receive a small instruction sheet and if so can you post it or link it?

 

That's pretty much it.  There was no instruction sheet, I just had to experiment.

 

If it's using the 2262/2272 chip pair set, it could be the data-rate resistor is different for the pair that only works with each other.  That's the resistor with a value in the 500K to 1M range.  Same bit pattern and same 315 MHz carrier but at a slightly different "baud" rate.  The resistors must match on the tx and rx modules.  Just speculation though...as I suppose a smart learning resistor could auto-baud (remember that from the old-days?!) and learn the bit rate coming in as well as the address!

 

The one that didn't work is one of the learning ones with the button, so I thought it was going to be compatible.  I'm still learning about these.

 

In any event, on the receiver learning side, if it responds to all 4-button remotes when it learns "one of them" then what is that learning?  I thought if you mod different transmitters to be at different addresses, then you would press the learn button and within X seconds press any key on the desired transmitter to pair that transmitter and receiver.  Then go to the next receiver, press learn, and within X seconds press any key on a different transmitter (set to different address).  Etc..  No?

 

I honestly can't say what exactly it's "learning". as it does indeed respond to all the buttons, and even properly as well.

 

Yup. Sure would be a hassle having to modify the transmitter remote with a multi-position slide-switch or whatever to select different addresses.  Re-packaging the board into a different case also seems impractical.  This one's a head-scratcher.  Maybe someone else has an idea.

 

Until I come up with a better idea, I'll just plan on numbering the transmitters and use them like the Lionel LionChief stuff, one transmitter for each car.

 

And I'll say it again. Ignoring the TMCC licensing thing for a second, it sure would be neat if you can just decode the TMCC serial command with it's address and use that as the address sent over the 4-ch universal remote.  That way you use the TMCC remote (or DCS remote) to select the sound card address, still use the "learn" mode of the receiver; but this would require decoding the TMCC serial command to re-transmit it over the universal RF protocol.

 

Maybe in the future.  One thing I"m thinking of doing is try to do the serial transmission to the MP3 module and then use combos of the 4 buttons to trigger more sounds, and perhaps even an optional servo output.  The packet interface to the module looks pretty simple, I'm going to dig out my protocol analyzer and shoot some packets at it and see how it works out.  You have a total of 15 combinations possible, and I figure at least one would be a reset.  I could have more sound clip possibilites, that's certain to be useful.  Maybe an input telling me the car was moving?

 

I'm still thinking on those ideas...

 

 

 

I've come up with a tentative "final" configuration for this board.

 

Since these little 4-channel controls allow combinations of keys, here's my plan.

 

I'll have the board run with modes, each mode is selected with a two key combo.  Given that scenario, there are six modes I can select.

 

AB, BD, CD, AC, AD, and CB.  After you select a mode, then you can press single keys to select one of four functions available in that mode.  I figure that perhaps three of them would select sounds, that would give me a dozen sounds.  If I allow two PWM servo outputs, that would be one mode for the two extremes, open and closed.  I could also possibly have one of the servos slew slowly and allow manual positioning by how long you hold the respective key.  One mode would be to activate aux outputs, lights, couplers, etc.  The final mode would be used to calibrate the end points of the two PWM servos.

 

I've also been thinking about how to allow conventional operation without running up the cost and complexity too much.  One thought I had was the Lionel solution, use a 9V Alkaline battery for temporary power during direction changes.  I could add the battery on the input side of the regulator with diode isolation so it would only provide power when power was removed from the primary supply and the filter cap discharged below the nominal 9V available after the diode drop.  The bridge provides isolation from the track impedance when the voltage falls.

 

One issue is how to cut off the battery after a few seconds so we don't simply run it flat.  I'm thinking of a hopefully simple circuit that when the battery is supplying current that after a few seconds delay it cuts off the power.  I haven't worked that out yet.  This would allow me to just add a connector for the 9V battery as it wouldn't be needed for command operation, it would be an option.

 

 

Well, it's going to be considerably more involved.  I think I have a handle on the serial interface to the MP3 boards, that was a sticking point.  Once I've tested that sufficiently, I'll proceed on laying out a modification of my board.  I have to go to the 20 pin PIC to get all the functionality I desire, and my debug board only handles up to 14 pins.  I suspect I'll just try to get as close to the final design as possible and run a set of boards and develop on that. 

 

This is the configuration that I hope will become the basis for an actual product.  Yet to come is what it will actually cost to deliver this, that may be another sticking point.  Of course, with the price of Lionel's cars, maybe not.

 

Originally Posted by gunrunnerjohn:
One issue is how to cut off the battery after a few seconds so we don't simply run it flat.  I'm thinking of a hopefully simple circuit that when the battery is supplying current that after a few seconds delay it cuts off the power.  I haven't worked that out yet.  This would allow me to just add a connector for the 9V battery as it wouldn't be needed for command operation, it would be an option.

 

I'd say the simplest is a PNP transistor switch which should get you well under 1 uA of leakage current.  I can see your uC pins are ever so precious but I'll just comment that what I generally do when there's a uC involved is to use an open-collector or open-drain output pin to shut off the battery switch.

 

grj battery switch

So the uC output would drive point A in the circuit above and the uC output would replace Q2.  In doing so, the power to the uC is cut off and the uC will go into reset or brown-out and that output pin will continue to float.

 

OK, I realize you don't have spare outputs so how about a simple RC circuit to drive the NPN.  Whenever there's track voltage, D1 charges the cap.  So this would be driven by some point in the circuit that has + voltage relative to circuit ground.  35V cap since I'm assuming you would pick off something close to track voltage peak track voltage magnitude.  When track voltage is lost, the RC discharges keeping the PNP switch active for a couple seconds and everything turns off.  I threw in some placeholder starting values.  It depends on how much current you need to run thru the PNP.   In any event, maybe 25 cents or so in parts.  Yes, you can go with FETs instead of bipolars but I like cheap.

 

This basic circuit is just a starting point.  It does not address the scenario where rectified track voltage is just under the battery voltage.  In this case, the battery would be unnecessarily called into service (drained).  Alas, more complexity and additional components to inhibit the switch. 

 

Separately, it's your circus (and your monkeys) but I don't think you want the battery powering "all" 5V loads on the board.  A 5V servo can draw quite a bit a current...much more than the 100mA or whatever you say you're drawing on audio.

 

Attachments

Images (1)
  • grj battery switch

Stan, I was thinking along the lines of a simple RC circuit and a transistor or FET switch.  I don't want to use a uP pin for this function, that seems a waste.  Also, if I use a uP pin, I'd have to have track power monitoring in the uP to know when the track power dies, since the battery is continuing to power the uP, I wouldn't know the track power was gone without some sensing.

 

The battery is on the input side of the switching power supply module that provides the main power, so it actually has slightly less current draw than on the 5V side. 

 

As far as powering the servos, remember I want the battery to cut off after a few seconds, it's just to carry across conventional mode switching or large track interruptions.  The small servos I'm using actually draw very little power, they have a motor that's the diameter of a standard wooden pencil, and about 3/8" long.  They're just heavily geared, but they don't draw much power.  I tested the two sizes I have, the big one draws close to 100ma in continuous operation at 5V, the small one around 50ma in continuous operation.  I can't see this being an issue for 10 seconds or less.  Also, it's probably pretty rare that they'd be running at the brief interval that we'd be on battery power.  I don't see the servos being in continuous use in this application.  They're model airplane servos, FWIW. 

 

I think I'd ignore the scenario where track power was just below battery cutoff to start, that gets trickier.  Another thing is I'm trying to keep the board real estate down for circuitry, not to mention parts count.  More parts, costs more for each board for assembly.  Track power would be down in the 7 volt range to drop the rectified DC below the battery trigger point, I'll just state that you can't run that slow.

 

I am thinking on going to the 20 pin version of the part I'm using for the "enhanced" version.  It simplifies things if I don't have to share the debug interface pins, that always gets tricky if you want to test that part of the circuit while debugging.  That still gives me 15 pins for I/O, I'll run out of board area before I run out of functions to do with the pins.

Originally Posted by gunrunnerjohn:

Stan, I was thinking along the lines of a simple RC circuit and a transistor or FET switch.  I don't want to use a uP pin for this function, that seems a waste.  Also, if I use a uP pin, I'd have to have track power monitoring in the uP to know when the track power dies, since the battery is continuing to power the uP, I wouldn't know the track power was gone without some sensing.

If you're considering a 20-pin version, why not a 28?  Assuming you have these professionally assembled should be no penalty to put a 28-SS pkg vs. a 20-SO pkg.  You'd have to fuss with the hand-built prototypes of course but should free up the debug interface.  I think the conventional battery circuit is still better done with the uC (yes, requiring a track-voltage-presence input pin and a battery-enable output pin).  The circuit I showed earlier suffers from a modest bias current which draws on the battery when track voltage is present.  This would vanish if the uC only turned on the battery when it needs to.  The incremental cost of a larger uC part is probably a wash with the components and real-estate to implement the discrete circuit "logic" to implement a zero bias current battery switch when track-voltage is available. It would also handle that no-man's land situation of the battery powering the entire system at low track voltage.

 

OTOH if you've come up with a low-cost RC circuit to switch the battery I'd like to see it!

One problem with any circuit that directly connects to track voltage is the full wave rectifier that supplies all the power.  I have no common ground, so any sensing of track power will have to be optically isolated.  The good part is the emitter is powered from track voltage, so the power consumption isn't an issue, the output transistor would simply open when track voltage was gone.  I just have to come up with a simple delay before the battery is disconnected.

 

My thinking for conventional operation, or any battery backup, is to just provide a connector for the battery backup circuit.  I can't see saddling every user with the extra costs and board real estate of the battery backup circuit. 

 

I am making provisions for 1100uf of bulk capacitance to better ride out brief power interruptions.  I will say that I didn't have any issue on the club layout with many switches with the existing 330uf, including a number back-to-back.  I figure two 560uf caps should be good protection.  If I decide one will do, I can simply leave one off the assembly.

 

I've currently mapped out a 20 pin device and have most of the circuit drawn.  It allows for two PWM servo connections, three LED's, and one output FET with a diode for higher DC current, similar to what I do for the cab light control on the Super-Chuffer.  I have two pins left, and I'm thinking of optional inputs.  Certainly, one could be for sensing the car was moving with a wheel sensor.  Perhaps I could have alternate sound tracks, one is selected when moving, the other one is selected when stopped.

 

On the positive side, I got the serial interface working to the MP3 modules, turns out it's enabled in the default configuration.  I used my serial protocol analyzer to fire off commands to play various clips.  Other than it missing the first one after a power-up, it went great.  I think the analyzer doesn't give it time after the interface is switched on, but I figured that was a minor issue to be dealt with later.

 

Last edited by gunrunnerjohn
Originally Posted by gunrunnerjohn:

One problem with any circuit that directly connects to track voltage is the full wave rectifier that supplies all the power.  I have no common ground, so any sensing of track power will have to be optically isolated.  The good part is the emitter is powered from track voltage, so the power consumption isn't an issue, the output transistor would simply open when track voltage was gone.

I'll cease and desist on this battery backup thing...after one more comment.  Seems you could skip the (cost of) optical isolation and detect the presence of track voltage using a diode and driving a transistor - plus an R and a C to smooth the half-wave.  Presumably you have a bridge somewhere in your circuit so the track voltage is referenced (not floating) to your local circuit common.

I have two pins left, and I'm thinking of optional inputs.  Certainly, one could be for sensing the car was moving with a wheel sensor.  Perhaps I could have alternate sound tracks, one is selected when moving, the other one is selected when stopped.

 

More board space but suggest these inputs have 3 pins...2 to provide, say, +5V and GND to the sensor.  There are so many of these tiny $1 motion, vibration, optical, humidity(!), etc. eBay modules for the Arduino market.  Many are 3-pins, 2 for power, 1 for the sensor output.

I'm not understanding the lack of isolation, I actually do not have a frame ground reference to the internal electronics, with a full-wave bridge from the track voltage, there's no easy way to do that.  This is the same issue that the RS5 boards and the MTH DCS electronics has, no common to the frame, and it's for the same reason.  The Legacy boards also don't have a common frame ground.  Lionel uses an opto-isolated serial input to receive serial data from TMCC as well.  I don't see an easy way to frame ground reference after the bridge rectifier for the power, unless I'm missing something.  I could go with a simple diode, but that would require much more filtering and higher voltages before drop-out.

 

The three pins for the inputs aren't a problem, though I may have to go with finer pitch connectors.  One significant cost driver is how to get cables & connectors made for a reasonable price, the quotes I get are in the stratosphere!  In small quantities I can make them myself, but if I have several hundred connectors to crank out, I really don't want to be the one to do that!  Right now the board is 2.0" x 1.1" and there's probably space for some small connectors for the input pins. 

 

I did provide the standard .1" spaced three-pin connectors for the servos, power, ground, and PWM signal.  They're powered from the supply that feeds the MP3 module, and I did beef up the supply for the receiver and uP a bit, it's a 150ma SMT part that has heat-sinking to the board.  The To-92 was working, but it was running at 55C, so I figured I should add a little "heft".

 

Here's the current trial layout.  Note that it doesn't include the connections for the input pins.

 

 

 

MP3 Sound Module PCB R3

Attachments

Images (1)
  • MP3 Sound Module PCB R3

Maybe we're talking apples-oranges? 

 

Say you put a scope's common on your circuit ground (i.e., the "-" pin of the bridge).  If you probe track voltage, it should be a track-voltage magnitude half-wave signal on one half-cycle and a clamped diode drop on the other half-cycle.  If the objective is "just" to sense track voltage is present, then this 60 Hz pulsing, half-wave signal that can be 10-20V or more could drive a grounded transistor.  The current would be in the microamps for basic on/off sensing so a small cap could smooth the ripple if you need a steady on-off.

 

I'm not familiar with TMCC board isolation issues.  That said, I can imagine situations where you have two separate circuits each with bridge rectifiers powered by a common AC track voltage.  Depending on current and such, the two local circuit grounds will be moving around relative to each other.  In such cases, I can imagine using an optical isolator to send low-voltage, high-speed signals between the two.  The two circuits are not truly floating/isolated in the galvanic transformer isolation sense.

 

But in this case we're talking a slow-speed detection problem with a huge available signal level that is referenced to local ground.  Again, we may not be talking about the same thing?!

OK, that makes sense, I truthfully didn't think of it that way.  We are looking for a pretty simple detection.  I still don't like it depleting the battery as we run, perhaps a FET would give lower leakage.  I don't visualize the issue of the threshold where we are floating between to be a serious issue, that should be a pretty narrow range.  If the circuit is still sensing track voltage and holding off the battery, maybe that solves it?

 

I haven't really given the battery too much thought yet, though I can see it would be a nice feature to have.

 

Last edited by gunrunnerjohn

Again, I'm not familiar with how Lionel does their wiring but I notice how MTH switched from multiple connectors on their PS2 boards to one big fine-pitch connector on PS3 that has all the signals, track-power, etc.  It seems to me that the level of DIY skill needed to apply this board is considerably different than the LED lighting kit.  I'd say the noble idea of no-solder, plug-and-play, can't-go-wrong, etc. is not as relevant.  That said, dealing with fine-pitch pre-crimped wires that a user has to pop in/out of the housing to configure a particular combination of lights, servos, sensors, etc. may be OK.  Just my opinion of course.

 

Oh, and if your regulator is that SO-89 in pink why not add some more heat-sink copper around it?  Now I also have to throw in my sucker-punch about fattening the traces of your power leads.  Fatter traces on that regulator will draw heat from the package via the pins.  So it only lowers the device a degree or two - it's free.

 

Originally Posted by gunrunnerjohn:

My thinking for conventional operation, or any battery backup, is to just provide a connector for the battery backup circuit.  I can't see saddling every user with the extra costs and board real estate of the battery backup circuit.

I hear you on this.  And the board is getting somewhat busy!  Anyway, I'm not sure you can break the circuit and do this with only 2-pins to the external keep-alive circuit/battery.  But if you use a higher-density connector you could allocate 3 or whatever pins to this external/optional circuit. 

 

Originally Posted by gunrunnerjohn:

I still don't like it depleting the battery as we run, perhaps a FET would give lower leakage.  I don't visualize the issue of the threshold where we are floating between to be a serious issue, that should be a pretty narrow range.  If the circuit is still sensing track voltage and holding off the battery, maybe that solves it?

 

I haven't really given the battery too much thought yet, though I can see it would be a nice feature to have.

 

And here I said I would stop harping on the battery circuit.  Well, I think that narrow voltage range is not as narrow as one might think.  In conventional, I think it quite common to lower track voltage to slow then stop and just sit there for a (long) while.  So your 1100uF or whatever will only be charged to 10V or whatever.  If Direction button is now pressed, is there enough capacitance?  If the engine is slowly accelerated and hits a patch of dirty track is there enough capacitance?

 

What's also tricky is the accuracy of detector switch.  Under reasonable load at low track voltage the rectified voltage will probably have 120 Hz ripple.  I can imagine a situation where the battery is called into service at 120 Hz on each valley if using "just" simple diode or'ing to allow whichever source (capacitor or battery) has more voltage.

 

There are so many dag nab scenarios with AC conventional that this is not trivial!  Yes, a FET would lower the bias current at a cost, but it may be time to re-group and demand a specification from the marketing department!  Another solution is to kick the can down the road, pony up pins on the uC, and deal with it in software later; yikes, I can't believe I just said that.

I did actually fatten the ground traces slightly, the trace widths are all .01", and the ground I upped to .012".  I was thinking of putting a copper pour around the regulator as well in the final product.  If I do that, I'll try to isolate it apart from the other parts to give it a larger heatsink area.  Of course, this layout is all tentative, I just do these to make sure all the parts fit and I can get a routable board design.  Many times it just takes moving a part a bit and the routes fall in place.  It's really to see if I have to up-size the board.  So far, there seems to be plenty of space.  Actually, if I shrink the area for the connectors a bit, I could fit it on a slightly smaller board.  However, the two rather large 560uf capacitors take up a lot of board space, and of course the MP3 module takes up close to half.  I do put stuff under the MP3 module, but I can't stick the tall stuff under there.

 

I got so many complaints about soldering the 2.54mm stuff on the Super-Chuffer, I didn't want to have the same issue with this board.  OTOH, with the cost of connectors and the issues of getting them fabricated, that's still a viable option.  I suppose I could offer an option where all the wires were soldered and the customer cuts them to suit for extra cost.  I could probably do a jumper field of 2mm spaced holes for the external connections.

 

Originally Posted by stan2004:

Again, I'm not familiar with how Lionel does their wiring but I notice how MTH switched from multiple connectors on their PS2 boards to one big fine-pitch connector on PS3 that has all the signals, track-power, etc.  It seems to me that the level of DIY skill needed to apply this board is considerably different than the LED lighting kit.  I'd say the noble idea of no-solder, plug-and-play, can't-go-wrong, etc. is not as relevant.  That said, dealing with fine-pitch pre-crimped wires that a user has to pop in/out of the housing to configure a particular combination of lights, servos, sensors, etc. may be OK.  Just my opinion of course.

 

Oh, and if your regulator is that SO-89 in pink why not add some more heat-sink copper around it?  Now I also have to throw in my sucker-punch about fattening the traces of your power leads.  Fatter traces on that regulator will draw heat from the package via the pins.  So it only lowers the device a degree or two - it's free.

 

Not True.  MTH still has larger pitch 8 pin connector for the heavy loads including track power.  In fact I had 4 connectors to remove on a recent Tender board replacement.  G

Originally Posted by GGG:

Not True.  MTH still has larger pitch 8 pin connector for the heavy loads including track power.  In fact I had 4 connectors to remove on a recent Tender board replacement.  G

Maybe I'm thinking of the PS3 HO?  Seems one of the new versions has all wiring including track power coming thru one connector.  The task at hand is for GRJ to come up with a connector strategy that supports a wide variety of applications and configurations - some of which have not even been imagined yet.

It's just that "stocking" multiple connectors on the male and female sides seems a burden.  And if going with polarized connectors it can add space, and still doesn't solve the problem of someone plugging in a 3-pin cable into the wrong 3-pin socket...unless you have the luxury of providing different connector sizes for each connector type.  I don't know if there's a simple answer, but I'd lean toward the single-connector and assume that the user has the wherewithal to insert/remove the crimped wires into the correct positions.

 

I don't imagine any of the wires carrying over 1 Amp continuous.

 

Again, I see this product as being for the more advanced DIY enthusiast.  It will surely cost several times that of the LED controller and I'd think more than your Super Chuffer.  I imagine some users will have others install the board for them...sort of like the MTH PS2 upgrade kit where, it seems anyway, lots of guys have someone else do the install.  It seems simple enough to download and program a microSD card with multiple MP3 files...but then again is it really?! 

The idea of one connector for everything but the servo connection is appealing, maybe I'll use the 2mm size that Lionel uses.  I believe that you can get pre-crimped wires from Lionel, so that would work.  The reason I leaned to separate connections for the power and speaker is that the optional connections may not be used in many applications, so you wouldn't have to deal with the large connector.  I can put the LED's, optional outputs and inputs all on one connector.

 

For the servos, there is a standard 3-pin 2.54mm spaced header defined by a pretty universal standard, and all the servos come with that connector.  If you plug them in backwards, they just don't work, but it doesn't damage them, so there's little risk.  And I don't want to have to change the connectors on those to use them.

 

The really small 1.25mm connector isn't worrying me, as that's strictly for "factory" programming, it's the one that Lionel uses on much of the Legacy stuff, as well as the ERR RS5 & CC-lite boards.

 

I'd like to find a connector that's universally available.  One option is dual-row ribbon connectors, you can find those and pre-crimped ribbon cables pretty cheaply, that would be an option.  Also, I happen to have the real tools to crimp ribbon cables, so I could build those pretty easily.  For installation, you just peel the ribbon cable conductors down and cut to size.

Originally Posted by gunrunnerjohn:

The idea of one connector for everything but the servo connection is appealing, maybe I'll use the 2mm size that Lionel uses.  I believe that you can get pre-crimped wires from Lionel, so that would work.  The reason I leaned to separate connections for the power and speaker is that the optional connections may not be used in many applications, so you wouldn't have to deal with the large connector.  I can put the LED's, optional outputs and inputs all on one connector.

DigiKey sells pre-crimped wires too.  They have 2mm, 1.25mm, etc. for some of the connector lines they carry.  You choose wire color, size, crimped one end or both, etc..  They've been doing this for years but I suppose they could stop at any time.  Here's an example of a 10" wire crimped both ends for the 1.25mm Hirose DF13 connector.  70 cents each in small qty...not cheap.  Since for this kind of project you only need a crimp on one end, I generally buy a longer wire crimped both ends and cut it in half.

 

http://www.digikey.com/product...T-10110-A8-ND/425389

 

As you say Stan, NOT CHEAP!  Even if I bought 100 of the 12" pre-crimped wires, that's 30 cents a wire.  I was hoping for a lot cheaper solution, though that may be a pipe dream.  By the time I buy the connector shells, a 14 pin connection is around $5 cost.  If I extend that to 1,000 unit pricing, I guess it comes down some to 21 cents a wire.  That's still $3 or so cost.

 

I was looking at stuff like these 14 pin IDC connectors for $30 for 200 of them, and matching 14 pin rainbow ribbon cable, 15ft for $10.24.

 

I could make 120 six inch connecting cables for $70, and have all 14 pins supplied.  This would allow including the connector with wire in the package, which I believe would be a big bonus.

 

Last edited by gunrunnerjohn
Originally Posted by GGG:

Now we are starting to see why the manufactures sell these car for $120 or go the cheaper route of a sound chip blob, like a Christmas car for $80.  G

Does anyone know what quality sound is in these $120 sound cars?  I'd be surprised if they are using MP3 technology.  While it's arguable whether you "need" MP3 quality sounds in a "toy" train, the fact is it really sounds good and you can create long, imaginative, and quite interesting sound effects.  I think earlier in this thread someone mentioned the Polar Express.  With the huge memory in any MP3 player module, it's no problem to put the entire narration of the Polar Express story.  Obviously no manufacturer could do this because of licensing or whatever, but with GRJ's module it would be easy for an end-user to do so for "personal use".

GRJ, so what's your thinking on the battery-backup issue at this point?

 

I understand your thinking on not wanting to burden the main uC with the battery-backup code and pin count.  I understand the idea of making this an option though I think that introduces logistical nuisances (not just a battery but a battery with a bunch of circuitry and a PCB board).  I still believe if you want to support conventional there should NOT be a restriction or an "oh by the way" that you don't want to operate at low track voltage in case the battery is unnecessarily drained.

 

But it is that narrow low-voltage range which is challenging to design a practical, low-parts-count, 25 cent solution.  For example, if you don't want to burden the main uC, I was considering one of those 5 or 6 pin uC chip for 50 cents or so with the sole purpose of managing the battery for conventional; this uC chip could reside on that optional board.

 

Your switching 5V regulator module operates down to 7V (according to datasheet) and presumably it "behaves" well below 7V - in the same way as a linear 7805 regulator that is.  A discrete circuit has to deal with a partially depleted 9V battery at 8V, 7V or whatever.  It's not rocket science, but not trivial without breaking the bank...

 

 

I'm leaning to maybe considering supercaps again.  I get away from any issues of depleting batteries or having to replace them. 

 

I did a little experiment.  I set the input to the module voltage to give me exactly 10 volts out of the bridge and series connected two 2.5F 5V caps across that output.  When I pull the power, I get 19 seconds of normal operation before it dies.

 

Obviously, that's not in itself a truly workable solution, but it demonstrates that the supercaps certainly have the energy to solve the problem.

 

I could probably do something kinda' absurd, but maybe not.  How about a 10V regulator charging the supercaps directly from track power  They are connected to the output of the bridge rectifier with the blocking diode, probably a Schottky diode to minimize the voltage drop.  When the voltage out of the bridge falls below the supercap charge, they will supply current.

 

A diode, cap, and the supercaps.  I'd probably have a small value resistor to  limit the inrush current since there's no fire to get them fully charged.  The trick is to keep the below their rated maximum voltage.

Well, if you're leaning toward supercap, I'd want a way to get by with just 1 5V part using the existing 5V power supply to charge it.  Then I'd take the $3-4 I just "saved" by using only 1 supercap and apply that to whatever power circuit to either step it up to 7+ volts.  Or see if the supercap can run the 5V supply itself down to 4V without resetting the system.  The volume will fade a bit and maybe the lights will dim a bit but slowly.

 

Given the price of a supercap, the "option" approach makes sense.  So if the 1100uF works OK for command, then (more than 2 wires) could go to this optional conventional board. I'm thinking even a stepup module ($1.50 qty 1 on eBay) could be soldered to this optional board to supply a full 10V (or whatever) into the 5V regulator.  Seems kludgy but combined volume (supercap+charging components+stepup module) ought to be about the same as a 9V battery.

 

ebay stepup voltage regulator module

Photo recycled from another but showing the tiny size of the stepup module.  Could almost soldering a supercap to the back of this module, plus a resistor for charge current limiting from 5V, plus a diode or two...and then shrink wrapping it.  Just thinking out loud here!

 

Perhaps apples-oranges but I make the observation how MTH went from 9V battery to 2.4V battery.  I'm pretty sure 2 x 1.2V batteries is cheaper than the 9V style.  So while there are obviously differences in the applications, space available, etc. in the 2.4V case a stepup regulator is used to generate the 5V needed for conventional operation.  And of course with the supercap-based battery replacements, the cost of the 9V style is substantially more than the 2.4V style as there are more of those spendy caps inside.

 

Attachments

Images (1)
  • ebay stepup voltage regulator module

I actually ordered a couple of those modules to take a look at them, they should be here soon.  I think the connector for connecting the "battery" board makes sense, that way you have more mounting flexibility.

 

I figure if I have the unregulated positive, the regulated positive, and the DC ground, I can come up with something to hold up the power for a few seconds with a supercap. I'll have to draw this out and make sure it makes sense as far as current flow and current paths.

 

 

 

 

I wonder if I can get perpetual motion going here?  I have the cap charging from the supply that I've feeding from the cap?

 

Originally Posted by gunrunnerjohn:
I wonder if I can get perpetual motion going here?  I have the cap charging from the supply that I've feeding from the cap?

 

As we all know, the typical perpetual motion machine fails to account for an external power source feeding the beast...in this case the bridge.

 

 

ogr grj supercap stepup

Edit: diagram changed to show charging cutoff switch.

Attachments

Images (1)
  • ogr grj supercap stepup
Last edited by stan2004

That looks good, pretty much what I envisioned.  I was thinking a slightly higher voltage out, say 10 volts, so I could take advantage of a bit more of the capacitor charge when the power goes out.  It only has to handle a few seconds, but with one of the caps, that might be close at 8 volts.  I wonder how low a voltage that switching board cuts out at, that could be a factor...

 

 

Last edited by gunrunnerjohn
Originally Posted by stan2004:
Originally Posted by GGG:

Now we are starting to see why the manufactures sell these car for $120 or go the cheaper route of a sound chip blob, like a Christmas car for $80.  G

Does anyone know what quality sound is in these $120 sound cars?  I'd be surprised if they are using MP3 technology.  While it's arguable whether you "need" MP3 quality sounds in a "toy" train, the fact is it really sounds good and you can create long, imaginative, and quite interesting sound effects.  I think earlier in this thread someone mentioned the Polar Express.  With the huge memory in any MP3 player module, it's no problem to put the entire narration of the Polar Express story.  Obviously no manufacturer could do this because of licensing or whatever, but with GRJ's module it would be easy for an end-user to do so for "personal use".

The Lionel tended to follow the RS tech so 2.5, 4.0 and I would think the Legacy could use Legacy Lite if they want.  So as good as your engine.

 

Some of the MTH accessories with sounds have the same memory chip on a PS-2 board.  Sounds were very good.

 

Other just used a simple chip so lesser quality.

 

I understand where this is going, but at some point your quality is limited by your audio amp and speaker/enclosure regardless of MP-3 tech.

 

What is funny is most MTH PCB for accessories only run about $30.  They are larger but also drive motors, lights and sounds.

 

You would think they could create this too and allow you to load different sound files. similar to the engine.  Especially with the Flash 4Meg memory chips they are using.

 

But they are not doing it so it is up to the entrepreneur to fill the gap!  G

 

 

Originally Posted by gunrunnerjohn:

That looks good, pretty much what I envisioned. 

Well, I'm back to the drawing board.  Upon reflection, the now edited diagram needs a cutoff switch to turn off the perpetual motion machine when the supercap is discharging.  Otherwise it's like stepping on the accelerator and brake pedals at the same time.

 

Question.  Can you run the 5V circuitry at, say, 4.7V?  In other words a Schottky drop from the 5V regulator.  I'm pretty sure hobby servos run fine at 4.5V. 

 

I'm thinking of another way where voltage is or'd at the 5V level rather than the higher rectified voltage level.  The above diagram still has a quirky zone at low track voltages where the supercap is supplying power when it does not have to.

Stan, I know the MP3 board will run at lower voltages, and I'm pretty sure the servos will too.  The uP and receiver run off a separate regulator and so wouldn't be involved in the feedback loop.  Funny thing, I was looking at the battery circuit last night and thinking about the same issue.  The issue is trickier than it appears.

 

Doing the battery at the 5V level is complicated by the fact that I have two regulators to isolate the high current stuff from the receiver and uP.

 

I have a feeling that I'm going to have to live with the issue of the supercap switching in at low voltages, I don't know how I can make that go away.

 

I keep looking at this issue, and a relay is looking better and better.

 

Add Reply

Post

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

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