More Progress on the Android Bluetooth Throttle App. I’ve been working on this for several months as time permits. I’m very close to an initial release of it. Below are screen shots of each of the pages. This is what I call the base level app- I also have several special screens I’ll add later that will allow the configuration of the SoundTraxx and TCS Decoders using plain text selections instead of having to punch in CV numbers. I also have some battery only sorts of screens that I’ll add later on.
This is the first screen. Use the plus/minus buttons to view which paired device (locomotive) you want to control, the press select. Once selected, the app will remember the last setup you made with it and set all of the buttons, function codes and screen configurations.
These are what I call the ‘main’ screens. They have the most used functions, horn, bell, direction, grade crossing, etc. Each of these icons is programmable, you can set the picture as well as the DCC function code it sends out. (see below)
The above two are ‘generic’ DCC command screens. These are not programmable but you can show or hide them. These send the corresponding DCC function code.
This is the CV programing screen. Use this to set CV address and data for a particular function.
This is the page configuration screen. You can set each of the above pages to display or not here. The ‘Cancel’ button will clear the current configuration and set everything back to defaults. Cancel requires that you press it 5 times in order to clear to prevent hitting the key by mistake.
Tapping the ‘Main Screen’ entry will take you to a screen that allows you to set the icon and function code for each of the buttons. You can also tap the ‘Board Control’ entry to configure that screen as well. See below.
The above are the two screen configurations. Use the plus minus to change the icon picture. Press the icon and the number turns green so you can enter the associated function code for that button.
Blu Phone Sends Bluetooth to control Aristo U25B with Soundtraxx TSU-4400. 2200 mAh Lipo battery, Full range TangBang speaker with passive radiator. Rewired the lights for LEDs. Good speed and power on the U25 at 14.8v.
Since my Python Apps do not work on any Android Version greater than 6, I am working on re-writing them in Android Studio. At first I was not particularly thrilled that I had to re-write everything but now I’m starting to really like Android Studio. I’ve decided to add additional functionality so that I only need one App. The name of the bluetooth device (the locomotive name) will now allow the app to ‘configure itself’ when the locomotive is chosen on the phone. If the locomotive uses a TSU-4400 SoundTraxx decoder, the appropriate screens will come up for that. I am also going to allow the main screen to be programmed, change the icons and what function codes are associated with them.
I’m getting great backwards motor drive but forward is not good. Not sure why that is. Taken apart on the bench I get a solid torque but out in the real world, not so much. More investigation required.
I already had this locomotive hooked up for the most part, I was driving it with my Xbee Board so I swapped that out with the Bluetooth version. I also replaced a tiny speaker I had in the front with the one in the picture (on the left). Much Much cleaner sound mix. Bells and horns out of the front and the prime mover going to the back speaker with the passive radiator.
Here it is out on the layout, ready for a test run.
Here is a video of some basic testing. It still needs some tweaking on momentum and motor voltages. Please forgive the poor video and sound quality- my nice camera died and this is my backup.
I also ran my latest version of the Generic DCC Phone app. Works quite well now. The QSI is a tad on the finicky side however so I made a very small mod to the firmware in the Bluetooth Widget. Once I back test that on the other decoders I’ll roll it into the firmware release.
You can find all of my Android Train Control Apps on Google Play.
Something different, a gadget for the airplane. This is my incarnation of the Stratux open source ADS-B unit. It uses a Raspberry Pi3 along with a couple of high gain antennas, two radio receivers and a GPS unit to snatch weather and traffic data out of the air. For free! Can’t beat that. I think I spent a little over $100 on it, but I already had the Raspberry Pi3.
I also have an AHRS module plugged into it which should give me a basic Synthetic Vision system. Now I just have to figure out how to mount it ‘semi-permanent’ into the airplane. It has to be removable and used for ‘situational awareness only’ to be legal.
But one thing at a time. I’ve tried it with my two BLU phones and also my ASUS 7 inch tablet. So far so good. Works really well. Just plugged all the parts together, flashed the SD card with the free software and it comes up and runs. I’m trying out a couple of Android Apps that will work with it- they overlay the weather and traffic data on a current FAA sectional moving map plus let you do other cool stuff like plot out your file plan, get airport info and such. Neat.
Got all the parts and pieces together (well almost) and did some testing outside on the layout. I was very impressed with the range, I have a new $50 BLU Studio phone and I’m getting a good 100ft. So far I have not seen any of the problems mentioned by other users of the TCS Wow 5amp. I did talk to tech support at TCS and they indicated that there had been some hardware changes to the 5amp since it was first released. He didn’t go into what they were and was not clear if the firmware changed or not. Mine is pretty new, I got it from RP about a month ago. He said there was no way to read the s/w version so I don’t know exactly what rev of firmware is in there. That is obviously on purpose for whatever reason.
But so far, I really like this decoder. Crisp sounds and I like the brake feature. Very cool that it ‘coasts’ when you shut down the throttle.
First Power up of the TCS decoder and the Bluetooth Enabled Control Widget
This is the first power on test of the decoder. I have not changed anything in the firmware or Android App from what I had with the Economi Decoder. I am using the 28/128 speed step which is the default in both decoders – so the extended packet format of DCC. The throttle, Bell and Horn all work out of the box, no configuration was done to the decoder before I tried this.
Because the TCS has some additional features and requirements, I will probably have to change the firmware and app side a little from the Economi implementation. It also has some sort of ‘mode’ to switch between the lights and sound functions so I will have to figure that out. That is the nice thing about a custom app, I can tailor it to each decoder.
I also will be controlling a few extra things with this particular installation – I’ve got a temperature sensor mounted on the heatsink of the DCC amp. I also had a current sensor in there but it proved to be defective so I had to remove it for now. I’ve got two fans wired to function outputs on the decoder so I can turn those on and off. Two servos will be used to control the couplers as well. These will be implemented in the widget layer, they won’t be controlled by DCC so I can tailor that profile as well. Just yanking the couplers open doesn’t work very well, you need a smooth motion.
One other option will require a PCB mod. I want to be able to ‘name’ each BT module so it shows up in the phone as a locomotive number and description. The docs say I can use up to 20 characters for this. However it requires that you power up the device with a pin held low, then let it go high so it enters ‘AT’ mode. This will require either a special app or an extension to the one I have to set this plus a jumper on the PCB. I can work around this for now but I will add it to the PCB layout along with a couple of other spacing fixes for the next pass.
I think I’ve finally gotten to a beta release point on my Phone App and Widget Firmware. The firmware is universal but the phone app is customized for the Soundtraxx Economi DCC decoder. This app lets you control and program a battery powered locomotive via wireless DCC on your Android phone.. Above are the four screens. Some of the controls, the couplers in particular, are not implemented quite yet, or are implemented but untested. Everything else works. The coupler buttons are intended to control servos to actuate the couplers ala switching moves.
Below is a (rather long) video of the app driving the decoder on my little test setup. The blue readout is a current meter. Not pulling much here.
I have a new locomotive, a USAT GP9, that I will be putting a TCS WOW decoder into. That will get it’s own phone app, although it should look very similar to this one. I’m finding the various decoders, while all adhering to the DCC spec, are a little different in certain areas, particularly the CV programming. Also, one thing I didn’t consider is getting data FROM the decoder. I have the circuit and s/w design for that but it’s not implemented yet. That’s next.
At some point I may try to merge the various incarnations of the phone app into one, but for now I’ll be doing one for each. I plan to support the three decoders I currently have, the QSI, the Economi and the TCS Wow.
Here is a demo of the phone app. It doesn’t actually do anything, just lets you change screens and move the throttle slider etc. But I’d be interested in feedback from other train folks – Drop me an email: firstname.lastname@example.org
Got my new boards in for the latest widget design. On the left is the DCC Amplifier, it turns the logic level signal from the widget into a 15v DCC signal. The board on the right is the new Megawidget.
I have moved away from SOIC components as they are hard as heck to solder by hand. So this one sports an Atmega328 28 pin thru-hole microcontroller. I still have one SOIC component, the 3.3v regulator for the network module but it’s a pretty easy hand solder and the thru-hole version is ridiculously large.
Another advantage to this microcontroller is I can run it at 16mhz using an external crystal. It’s a pretty speedy little sucker at that clock rate.
The boards came out perfect in terms of electrical connections, I didn’t have to cut any traces or add any jumper wires. However I do have a bit of a spacing problem on both the controller and the DCC amp that I will have to address on the next pass. The ISP programmer port is too close to the bluetooth module and the logic input on the AMP requires that I wire it instead of putting a pin header – but for now they are ok.
The plan is to refactor all of my existing code on the firmware side and get it all squeaky clean- bluetooth network, servo control and the DCC output. Hope to have that done this weekend. Eventually it will drive a TCS WOW Sound 5A DCC controller.