MP3 Sound for Crossing Gate

I want to add sound to my crossing gates. I have the approach from Stan (previously posted in the "IR or Optical Sensors" forum), but had some questions with regard to his post. Stan suggested that I move that discussion to a new forum, so here we are.

I purchased an MP3 player on ebay and audio amplifier card from same. In Stan's post, he shows a capacitor adder to both the player and the amp. The pictures do not provide enough detail for me to determine where the cap's should be added. If I had bought the same player & amp that Stan used, I could make a pretty good guess. I will repost the pic's of my player, and per Stan's request, I will post the ebay location of the amp I bought along with a pic.

The reason for the cap additions  was never mentioned, but someone suggested it might be to improve sound quality???

Stan also suggested that I put an MP3 file on the player and see if it auto plays. I did that and it does not. I believe everything on these players is display-driven. However, Stan has never been stumped before--so we will see.

Ken

Attachments

Photos (6)
Original Post

Thanks Bruk, but if you go to their website, it is a mess. I don't trust any company that overwrites the key elements of their product descriptions.

Also, they don't talk about a unit for o-scale (which is what I want). With Stan's design, I have to have an SD Card, but if all I want to play is the bell ringing of a crossing gate, I can create an MP3 file of that sound, put it on the card, and when the player is activated by a gate sensor, the sound will play continuously (not for a max. of 5 min.), until the sensor is de-activated. It's a little more work, but I believe provides more flexibility (plus I like to fiddle with new designs).

Thanks again for the input.

Ken

ken's trains posted:

Thanks Bruk, but if you go to their website, it is a mess. I don't trust any company that overwrites the key elements of their product descriptions.

Also, they don't talk about a unit for o-scale (which is what I want). With Stan's design, I have to have an SD Card, but if all I want to play is the bell ringing of a crossing gate, I can create an MP3 file of that sound, put it on the card, and when the player is activated by a gate sensor, the sound will play continuously (not for a max. of 5 min.), until the sensor is de-activated. It's a little more work, but I believe provides more flexibility (plus I like to fiddle with new designs).

Thanks again for the input.

Ken

I understand. Tim is the owner of the company. He is a really cool and knowledgeable gentlemen. I work with him all the time. He can be over descriptive sometimes because he's passionate about what he does. He makes me custom sound boards and lighting boards for projects for all scales. (he is also local to me) We stock his lighting products at our store.

Also you can change the speakers out for larger applications.

In your application, what provides power to the player/amp?  And what voltages are available?

For the player, the added 5 cent capacitor was attached to the + and - pads of the battery (which was removed).   A battery provides a relatively steady voltage so without the battery there, the capacitor a similar smoothing function which aids with audio quality.

For the amplifier, the added 5 cent capacitor is added as shown int he photo; it appears you have the identical board.  The function here is a bit more nuanced.  In this case it affects the startup time of the amplifier which helps to demote the initial pop/click you frequently hear when turning on an audio amplifier.  It additionally assists with audio quality.

It's a nuisance if your player does not start playing when you turn it on.  So what exactly happens and how do you get it to start playing?  Does the display come up with a scroll-able list of all the .MP3 files stored on the SD card?  Then even if only 1 choice, it makes you select it for it to start?

I'm sure we can eventually figure something out to get your $1.79 player to work, but is procuring the 99 cent player I used an option you'd consider?

For example, in addition to the automatically-start "feature" that I think is handy, another sleuthing task is to determine if the player module can directly accept 5V in "play" mode if one has removed the ~3.8V Lithium battery (see comment below).  Some MP3 players let you transfer your MP3 files into the microSD card via the USB cable while the USB is charging the battery.  Others let you stream MP3 files over USB.  And so on.  I've not found datasheets for the magic chips used in these low-cost player to understand the voltage limitations or modes of operation.

Separately, as a general comment about these $1-2 MP3 players.  Some listings on eBay have a warning about NOT overcharging the battery - such as don't leave it plugged in to the USB 5V port for more than some number of hours or something like that:

battery warning

I have indeed had these tiny rechargeable Lithium batteries bulge and fail in my messing around with these modules.  Note that these devices have very simplistic battery-charging circuits unlike the sophisticated chargers in smartphones or whatever that know when to stop pushing power into the cells.  In any event, I recommend simply removing the battery for DIY track-side sound accessories when using these modules.  There is a separate discussion about rolling-stock sound and if/how a battery might be applicable but that's for another day.

Attachments

Photos (1)

Hi Guys,

Bruk I'm sure their great products, but if you go to the web page you linked, you will see that it's a page of product descriptions where most of the text is overwritten with other text and is mostly unreadable. So I cannot get a good description of his products.

Stan I thought the amps were the same, but I did want to understand the reason for the caps--so thank you for that. I also tried to look up the chip on the player (had to take a pic with cell phone to read no.), with no result. I only loaded a single file on the player and when it turns on, it comes up in the "Music Mode". If you select 'ff right' you get to the "Set Mode" where you can select 'language' , 'contrast', 'light', or 'return'. If you press the "M" button in the Music Mode, you get a list of songs and must select one to play by pressing the 'play/pause' button (center button).

With the description of the player you used, I was able to find them on ebay and have ordered some. I don't know why they didn't come up in my initial search for players before. If the display version is not doable, that's ok, I will just wait a month till the one you used arrives.

As always, thanks much.

Ken

Sorry, forgot question about power. At this time, friend has printed a crossing gate with a servo motor and controlled by an Arduino. We are using the side-by-side led emitter-sensor combo for crossing detection which triggers the Arduino. The plan for sound was to have the Arduiino also trigger a channel of an 8-ch relay I have several of. That would provide 5 VDC to the player and amp.

Ken

If you go with the 99 cent MP3 player and separate amplifier, I dug up photos from earlier threads but collected here with additional comments to summarize one way to do it.

ogr stereo sound hack

Not necessarily for crossing gates, but since the MP3 player is STEREO, you can play two completely independent sounds.  So for a track-side layout sounds that run all the time, just add a 2nd speaker and store sound #1 on the left-channel and sound #2 on the right-channel.

ogr mp3 player backside

Above shows the guts of the MP3 player.  The battery is disconnected and unused.  The volume controls are not used; as per the discussion, this player will automatically start playing whatever MP3 file/song/sound is stored on the microSD memory car when power is initially applied.

insanely priced mp3 sound accessory

Above shows the general concept of a MP3 player + audio amplifier + speaker.  The battery is not used in your application.  Again, these are re-cycled photos.  The point here is to put the speaker in a chamber which greatly improves audio performance.  Note that the IC amplifier chip (PAM8403) can drive a 4 ohm, 8 ohm, or whatever ohm speaker you have lying around.

ogr mp3 player wiring

Above shows the 1uF capacitor (polarized so mind the + and -) installed in place of the Lithium battery.  The player's ON/OFF slide switch is placed in the ON position.  5V DC is applied as shown.  These are the same connection points as the +5V and GROUND connections on the mini-USB but the cable is somewhat bulky and by the time you cut, splice, strip, etc. the cable, it's probably easier (and certainly more compact) to just wire in +5V and ground as shown.  Ground is soldered to the mini-USB connector tab as shown.

The two audio outputs (if you are even using both), are as shown.  It is very important to note that the audio common is not used when the MP3 player is mated to the amplifier module.  

ogr mp3 amp wiring

Above is audio amplifier module.  Capacitor is added as shown; note polarity.  Again, note that the audio common (the pad between the two audio inputs) is NOT used when mated with the MP3 player.

power and audio connections if not using cables

Above shows you do not need to use the 3.5mm earbud connector between the MP3 player and the audio amp.  You can save substantial space by dispensing with the 3.5mm plug and simply tacking a wire to one (or both if needed) audio outputs as shown.  Again, you do not use the common audio output connection.

------------------

Separately, if you want manual volume control you can get what amounts to the same PAM8403 IC amplifier electronics except with potentiometer.  Here's how you'd attach the capacitor on the eBay module which is also about $1 shipped.  As noted earlier, the capacitor is optional.  For a layout accessory sound that is continuously running, I don't think it matters or that you'd even notice the one time pop/click when you power up your layout for an operating session.

capacitor on amp with volume control

pam8403 amp with volume

The other connections to the MP3 player, speaker(s), 5V DC are the same.

pam8403 amp with volume knob

I figure you would only set the volume once for a crossing gate and never change it.  So the fixed volume module works fine with any one-time volume setting done by simply modifying the MP3 file itself within a sound-editor (Audacity or whatever).

Attachments

Photos (9)
ken's trains posted:

...The plan for sound was to have the Arduiino also trigger a channel of an 8-ch relay I have several of. That would provide 5 VDC to the player and amp.

Understood.

OK.  So the described configuration above will directly take the 5V switched-DC from your relay module and "automatically" start playing the crossing gate MP3 file.  Very simple.

But as you patiently wait for your MP3 players to transit the Pacific, note that another way to manage power is to keep the audio amplifier module continuously powered with 5V DC (since your Arduino module is presumably always powered).  Then when you need crossing-gate audio, you simply power-up JUST the MP3 player module which draws a very small current relative to the audio amp module.  The point being you can use the modest output drive capability of an Arduino to switch power to JUST the MP3 player electronics.  This way you don't need to use the relay module with its 10 Amps (!) of switching capability.  Of course if you're already using the 8-channel relay module "nearby" then so be it.  If this is something you'd like to pursue, it may cost 10 cents or so in parts (e.g., a transistor or whatever) but if space is an issue or you just like to tinker with stuff, I will elaborate.

ken's trains posted:

...At this time, friend has printed a crossing gate with a servo motor and controlled by an Arduino. We are using the side-by-side led emitter-sensor combo for crossing detection which triggers the Arduino.

When you get it all together, can you post a photo of what your friend printed.  With all the 3-D printing activity, I figure at some point someone will want a track-side enclosure to house the LED-sensor combo for a DIY IR occupancy detector (MTH ITAD or Lionel 153IR).  The off-the-shelf versions run $30-40 or so whereas the underlying electronics is less than $5 if going the DIY route.  I've figured a stumbling block has been a suitable enclosure to mount/disguise the LED-sensor combo...but if you've come up with a share-able (printable) solution, I'd be interested in seeing it.

Stan, thank you so much for the details. I will get to it when the correct players arrive. At this time, my friend is refining his crossing gate design (I will post pics when complete), and then he will start on a design for the LED-sensor module enclosure and I will post that. The turntable is coming along pretty good also (but it's been a much bigger project).

Ken

ken's trains posted:

Hi Guys,

Bruk I'm sure their great products, but if you go to the web page you linked, you will see that it's a page of product descriptions where most of the text is overwritten with other text and is mostly unreadable. So I cannot get a good description of his products.

 

It's the browser you are using. I get the same thing with Chrome, but it works fine when using Edge. The website does have some interesting products, definitely worthy of consideration.

Having said that, I like Stan's projects as well. He has posted some great things here on the forum and is always very helpful to anyone in need.

Add Reply

Likes (2)
jimcotterrepair technician


OGR Publishing, Inc.
33 Sheridan Road, Poland, OH 44514
330-757-3020

www.ogaugerr.com
×
×
×
×
×