rcsoundcard

A new widget I’m working on. R/C sound card. My favorite 1634 Attiny micro controls an mp3 player. Supports up to 200 mp3 files on a 32G Micro SD. Built-in 1 Watt amplifier drives a speaker directly.

It also has 8 sound triggers using buttons or switches in addition to the R/C interface.

You can arrange the sounds with your computer to play anything you like. Engine sounds, horns, bells, music, speech, anything.

First prototype power up has the board LED blinking and the mp3 board online. Yep. Like it.

P1030718P1030721

In a related area, an offshoot of Xbee research I guess, I’m hacking up a $35 Hobby King transmitter and turning all the channels into knobs. It’s a simple matter to remove the joysticks, each axis is a 5k pot. I have a bunch of cheap 5k pots I got from mouser for another project that I can use for this application. Once I have the circuit working, I’ll make a 3D print of a console to hold the electronics and use that to control 6 trains with one transmitter. Probably better would be 3 trains plus two discrete functions per transmitter but either way, it’s an easy mod. I’m pretty sure I can sync 3-6 receivers to one transmitter, but I will get a couple to test with soon just to make sure. Using an ESC with reverse, it should be possible to control direction and speed for six channels of trains with this.

October 27 2013:

This progresses, I’ve decided however to not use the pots I had and instead use 3 from Radio Shack to make mounting them easier. I’ve also decided to take this to three throttle controls with several push buttons for the second channel.

dash9

It figures that the only modern large scale GE Evolution series locomotive (or at least a predecessor, the Dash 9-40CW evolved into the ES44 series) is available no more. Aristocraft is out of business and basically having a fire sale on all their remaining stock. So I count myself lucky to get one of these. Perhaps another used one somewhere someday and have it custom painted in NS heritage colors? Ah well.

P1030716

Image1

After two designs, I finally have the servos working. I can drive pretty much any number of them, I’ve got four going here. Currently the plan for the ‘client’ node is four servos, four mosfet switches, a serial port for intercepting RFID and a transmit only serial port (in s/w) to drive two channels of mp3 sound. There will also be two input pins left over for a current sensor and a speed/distance counter.

I have the transmitter/hand held prototype sending values read from the knob to the client and out to the servos now. Nothing fancy, read, transmit, repeat every 10ms and all the servos are sent the same value, but it does work well.

Still a bit of R&D, I’m not sure on the speed of the transmit to the Xbee module, currently it’s 9600 baud, I may have to increase that, but that’s not a real problem. I think other than that, most of my h/w design is working and has the appropriate low level support.

dash9

Not much new, I have gotten the Xbees to communicate in API mode. The only subsystem left to develop is the servo driver. Turns out I’m going to have to roll my own incarnation using timer 1. But that’s actually good, I don’t like depending on ‘libraries’ from third parties which often have deep dependency lists.

I’m also doing another pass on the RaspberryPi/Wixel/HTML5/Websockets project with the idea of releasing it open source or at least a collection of source code that mostly works. I hope to include the Master/Slave Wixel protocol thing I’ve had laying around for a while too.

Some very sad news too, Aristocraft Trains, who make one of the locomotives I really really want (pic above), is going out of business. Perhaps I can pick up a NS Dash9 before they go completely extinct but damn, that messes up some of my plans. Oh well. Shit happens.

xbeeProd

Have everything in terms of h/w working now. Just getting started on the UART drivers and then the formatting methods to build xbee frames. I’m going for the super simple series one point to point protocol. Technically this is not a ‘mesh’ network but for my purposes, it should do fine. The idea is to have any node talk to any other node directly. I don’t really need any sort of node hopping or self healing right now so I’ll opt for the simple first.

The handheld will function just like a standard R/C transmitter, moving servos and the motor controller in the locomotive. It will also be able to set various switches and relays and trigger sounds.

The big difference here between regular R/C and this- with this method I can do bi-directional data flows. So I can pick up position, speed and current consumption from the locomotive as well as send it commands. Also, since each device is a just another node on the network, an Xbee connected to my Raspberry Pi server will allow me to both control the locomotive and monitor it, the same as from the handheld.

In theory of course. However it is looking good so far. My h/w designs have proved both minimalistic and functional, so far anyhow, so I have a good feeling about getting all this working. The last stage will be the html5 tablet interface I did for the wixel, but that’s way down the road.

I’ve gotten both the client and master widgets working in terms of downloading and testing code. The display on the throttle is working great, the keyboard, not so much. Spent half a day before I realized I had wired the switch matrix sideways. Software comes up short when the h/w is hooked up wrong, eh?

The client node is simple, not much there other than the xbee interface via a dedicated serial link.

I have one more set of parts for the computer node, have not put them together yet. Really don’t need them that much now that I think about it, the Parallax xbee usb board I have should do it- but not sure yet.

9-12-2013: Have not had much time to finish up the keyboard but hopefully that will be done by the weekend. Other household repairs and refurbishments are taking up my time but they need to be finished up over the next few months as we move toward the cooler weather.

newradio

Spent most of the Holiday weekend finishing up the soldering on my various train widgets.

On the left is the Pololu 18v7 7 amp DC motor controller. This is a commercial board. It works great in my Aristo RS3 and allows bi-directional control without a reversing switch. It’s very configurable. You can run it bi-directional or single direction and it has configuration items for acceleration and braking although I have not tried those yet.

To the right of that is my ‘helper r/c’ design. This board reads r/c channels and converts the servo pulses to flip a relay (for reverse) and turn on up to three MOSFETs (for lights) using standard R/C airplane sorts of radios (one channel per). I noticed some people who use cheaper airplane ESCs are dedicating a servo to flipping a toggle switch onboard the locomotive, this eliminates that. (Personally, I like having a reverse switch so I configure my Pololu that way anyhow). This is a very inexpensive board based on the ATTiny84 micro-controller.

Not shown is an R/C sound board, it allows you to play any mp3 sound, triggered by a channel on the radio. Stick all the way to the left, play sound 1, all the way to the right, trigger sound 2, in the middle, silence. So horns, bells, or music even if you are so inclined. I’m thinking 1-4 channels of sound depending but I have not finalized that yet.

Next on the left, below the motor controller is my Xbee widget. This is going to be the basis of all of my new wireless designs. I can re-use the basice design and populate the board with different s/w only, no need to change the h/w to have several different ‘widgets’.

Depending on the s/w, I’ll be able to control servos, DC motor controllers, MOSFETS (on/off power switches) and drive my 4 channel mp3 sound card. I’d also like to provide the option of DCC outputs to feed various decoders but that s/w hasn’t been developed yet.

It will also provide serial inputs for things like RFID readers, speed and distance counters, current sensors and other things like that. Note that this doesn’t have to be a locomotive unit, this node could go anywhere to control turnouts or animatronics, etc.

With another set of firmware, it will act as a hand-held controller. A rather large prototype of that is in the center of the picture. (This should fit down into a nice sized handheld unit once it’s put on a PCB)

Yet another incarnation of s/w will produce a widget that will interface to your computer, allowing control of any other widget.

The radio for the wireless is the Xbee series 1. These are low cost radio nodes, come ALREADY FCC certified and have a range of 300ft. They also provide a set of firmware called digimesh that turns your network of nodes into a self-healing mesh network. VERY COOL. The proctocol is also open source so no more proprietary radio communications! Love that.

zigbee

This is the client node. Three servo outputs, five mosfet outputs, serial out for sound card (up to 4 channels), serial in for RFID reader. Two inputs left over for speed sensor and/or current sensor. If I can come up with the proper code, I can drive DCC out of one of the Mosfets. There is some open source DCC code floating around but I wasn’t impressed with what I saw so that will probably have to be developed from scratch if I decide to.