American Flyer Arduino Danger Bell and Crossing Gate

This version is based on an Arduino chip. I laid out a circuit boatrd for it and orderd them. This is a description of how they work and some assembly tips.

The control board is designed to work with a standard AC powered American Flyer train layout. For more realistic effect, the 759 and 761 Danger lights need to be modified as shown above to allow each lamp to be controlled individually.

The circuit description is a s follows:

Power from the 16 volts of the train transformer is rectified by a bridge rectifier where it becomes about 22 volts DC. It is fed to the buck convertor module which is adjusted to provide 5 volts DC for the ATmega 328 processor chip.

The processor chip is triggered into running it's program when pin 13 is pulled low. U8 which is an opto isolater consists of a LED and photo transistor embedded in a plastic chip. When the LED is powered, the transistor turns on and pulls the processor input pin low. The resistor and diode connected to the opto isolator rectifies the AC from the 696 track trip and drops the voltage to a level that will not damage the LED. The diode protects the opto isolater LED from excessive reverse voltages.

Once the program is triggered, outputs from the ATmega processor turn on the LED's in a sequence in U1, U2, U4, and U5. These are actually triacs that are triggered by LED, very similar to the optoisolater desribed above.

These in turn trigger the larger triacs which switch the 16 volts AC on and off for the lights, bell, and crossing gate. The resistor and capacitor across each triac provides a "snubber" network. When driving inductive loads such as the coil in the bell and crossing gates, they may generate a spike of voltage when turned off and the snubber networks keep that from retriggering the triac before intended.

The reason for the opto isolors was to isolate the 16 volts AC from the processor as it would destroy the chip immediately. The circuit is a bit of over kill but the parts are extremely cheap from many of the vendors on eBay. For example, the buck convertor module is about $1.45 which is cheaper than trying to use a linear regulator like an LM7805 and it's associated support components.

A short YouTube video showing an early prototype board in operation can be seen https://www.youtube.com/watch?v=5p-5GDG8pxI. The revised board can be seen in https://www.youtube.com/watch?v=5p-5GDG8pxI video. Some notes on hooking it up are http://www.gwcohn.com/cg_operation.htm.

June 2020 - I had a thought that not everyone had or wanted a 759 Danger Bell or even that the bell might be damaged. So how else to produce the sounds of a bell and use it just with a 760 flasher? How about adding a tiny sound card with a built in amplifier?

The unit I found came in two versions, one with a built in ROM for storage (DY-SV8F) and one with an external SD card (DY-SV5F). These are available on eBay for under $3.00 each. I found that both work but the one with built in storage was very usable as all I wanted was to have one or two different crossing bell sounds.

Search the Internet and you can find various train crossing bell sounds or you can purchase some from various sound-effects sellers. I found that for the best effect, the sound file should be at least 60 seconds long. Shorter files will work, but if your train takes longer than the length of the sound file, there will be a brief interruption in the sound while the file restarts.

Modification of the the original 759-Danger Bell Crossing printed circuit consists of soldering a wire to pin 4 of the Atmega 328 chip, Soldering a wire to the + output of the buck regulator, and soldering a wire to the Ground of the buck regulator.

The wires from +5V and ground on the buck convertor go to the Gnd and +5V pins on the sound card. The wire from pin 4 on the Atmega 328 chip is the select line and goes to pin I00 through I07, depending on the name of your sound file. The sounds have to be called 00001.mp3 through 00008.mp3 for the card to be able to play them. Therefore if you use a header and Dupont pins for the select pins, you can manually choose one of 8 different bell sounds.

The code is revised slightly so you will have to remove the Atmega 328 chip and burn the new code.The revised code is now available at https://www.gwcohn.com/cg_operation.htm>,

These are pictures of the appropriate sound cards. The left one uses a sd card to store sound files and the right one has a built in ROM to store the sound files. The wire from pin 4 on the Atmega 328 chip acts as a pushbutton to select the appropriate bell sound. They have a built-in 5 watt amplifier so they can drive a speaker directly.