Sunday, March 30, 2014

Getting Back at It

I've finished my other Android app. It is non- aviation related, and it doesn't use an Arduino, but it proves my skill as an Android developer (or not). It may be in the Playstore real soon now. The weather is warming, and I can get at the plane in the hangar, so I am going at least make an effort to move forward with the engine monitor project.

I've been playing with the Android PFD that I really like. The  A-EFIS is really nice, and I can see this as the primary display I use going forward. Long term, before I would fly any tablet in IFR conditions, I would like a AHRS system bolted to the aircraft, and connected to the tablet. This app is good enough for daily use otherwise using only the tablet gyros. I tested this while flying on a commercial flight (I wouldn't want to test and document while flying solo in GA). 

It is time to replace the engine instruments with an Android app. I have the skills, and proved that I can get the data, I just need to put it all together. So I will document my design with this post, and move on to actually finishing it, showing my test results. I look forward to your feedback, and want to know your thoughts.

I am trying to use best practices, so I will try to use modern technology, and communications. It will still use the Arduino, since that platform is reliable and well documented.

Using the 3 layer design Model, View Controller (MVC) pattern, I will use the Arduino output as the Model, the Android display as the View and the logic to monitor and log the data as the controller. There may be redundant logging on both the Arduino and the Android. The Arduino will be attached to the aircraft, and have the aircraft data. The Android will be removable, and allow interpretation and modeling at remote locations.

The Arduino will read all the raw values from the sensors, and convert those values to actual real numbers. The actual message will contain units, so the numbers have a context.

The output from the Arduino will be in JSON format, allowing different platforms to use the information.  Someday someone may want to replace the Android display with another platform, and that will be possible using this design. The message will be sent from the Arduino about once a second, but can come more often.  A sample message will be similar to:

        "Cyl1": "340F", "Cyl2": "341F", "Cyl3":"348F", "Cyl4":"333F" ],
        "Cyl1":"1530F", "Cyl2":"1520F", "Cyl3":"1550F", "Cyl4":"1545F" ],
      "RPM": 2330,
      "OilPress": "50lb",
      "OilTemp": "220F",
      "Volts" : 14.2,
      "Amps" : +12.3,
      "ManifoldPress", "32.29InHg",

      "Timestamp", "2142325533.5sec"]}

The Android will use this information to display graphically the current engine situation. The Android will be able to interpret these values and display the data in other units, set monitoring points with alarms, and other alerting mechanisms. Logging will try to be as similar to the Insight engine monitoring data formats (CSV), allowing existing analysis tools to utilize this data, and make common sense results.

Some of the alerts will include:
  • Low oil pressure
  • High CHT
  • High oil temprature
  • Low voltage
  • Low charge (amps)
As well as others can be programmed in.  Blinking displays and audible alerts are possible, and a combination will be used. The audio output from the Android device can be routed to most audio panels. The Android device may allow playing music, podcasts  and other entertainment functions along with the alerting functions.

Using the JSON input format can allow debugging and testing on a desktop computer. Creating or using recorded data can allow playback to the Android device. The Android emulator included with the ADK is very good, and allows devices of all types to be used, to insure the display will work. I can start working on the Android code without having a functioning Arduino device working.

I welcome your input

Saturday, March 8, 2014

Android ADS/B in for $20 available NOW!

It is finally available! I predicted it about a year ago, when I first ordered my tablet, and thought about writing it myself, and asked for help. I am glad there are more ambitious people out there, because they get it done. My Android development skills aren't there yet either. I am working on an app that will use maps, but haven't got to that part yet.

The app is $1.50 in the PlayStore, called ADS-B on USB SDR RTL (beta)  it shows up in apps called "USB ADSB..." on the tablet. The USB dongles are really only about $15-20 US, plus shipping. You will probably need an OTG cable or adapter for a phone or tablet. (The OTG cable allows attaching USB client devices like mice and keyboards to a phone or tablet). Really the cost may approach $50 plus a tablet.

The app shows promise, and really looks nice. It starts the map centered on Lakeland Florida, so it needs to be adjusted to where you are. The maps can be sectional, WAC, IFR, and street maps, and can be selected from a menu. The pinch to zoom works, but the menu allows zooming, along with buttons in the upper corners.

When the app comes up, it displays all the available devices, selecting the available device starts the app. The top part shows the map, the bottom part shows a list of the aircraft that the software has heard recently (can be adjusted in startup menu, defaults to 60 seconds).

It appears to be listening for 1090MHz Mode S with Extended Squitter (ES) transponders. 1090ES is the world wide standard. GA in the US will probably focus mostly on the 978MHz UAT devices, since there is more bandwidth available to those devices. See UAT or 1090ES in my other blog).

The developer says it will have weather eventually. Weather alone would make this app worth while, but the aircraft positions is a huge benefit. "Mounting" a tablet in an aircraft isn't hard, and there are a few adapters to make it easy. 

This doesn't completely compete with the Garmin GDL-39, and their Pilot app, but it will give you the chance to see what is possible, and the benefits to having ADS/B service.

I had trouble using it. The SDR dongle is very sensitive to the antenna chosen. I found a link to a site were there are extensive design and testing of antennas especially for ADS-B reception:

I chose the simple 1/4 wave dipole and was able to get some reception. I didn't want a large antenna, nor an amplified one. I want to be able to use this portable in rental aircraft and such. It did seem if I got the SDR farther away from the tablet, it worked better. I used a USB extender to do that.

The battery life doesn't seem to be negatively affected running the SDR dongle, the screen still eats most of the battery. Someone suggested a split OTG cable, so it could be connected to power while running the SDR dongle. That is a great idea.

I can't say this will save a life, or replace TCAS for alerting, but it could help someone get the big picture when ATC calls out traffic.

If everyone only does ADS-B in, it looses some of the benefit. The future will require us to use ADS-B out as well, then everyone should be on the same level.

Tuesday, March 4, 2014

A Quick Look at A Couple Android Gyro Apps

Tonight I was flying from KDAL to KMSP on Southwest. Now with the technology on all the time policy, I've been getting more bold. I actually try to use aviation apps on the plane while riding in the back. I've tried GPS based apps, and the metal tubes that are commercial aviation make using the built in phone and tablet GPS unreliable at best, and mostly unusable. I have maybe gotten 4 satellites at once on my tablet.

Gyro apps should be usable on aircraft, no matter where you are sitting. I tried a couple at random while coming home. I didn't start using them until we penetrated the clouds just north of KRST. We were supposed to be flying the KASPR4 arrival, but when we got in close, the controllers gave us all routing.

From my window, is seemed like we got much closer to KMSP than flight aware shows, but this will show that we did do some maneuverin, especially out past Lake Minnetonka.

The two apps I used were Sensors and Gyro.  Both apps portray an aircraft Attitude Indicator (AI), where gyro also displays a Directional Gyro (DG).They both rely on the sensors in the tablet or phone. I tested both on my Samsung Galaxy Note 10.1 (classic?).

I've written before about how the gyros work on an Android device. The gyros in the device are rate sensors, and to display current attitude information, they need to be integrated over time. Both apps seem to have done this well, with limits.

Sensors, (I can't find it in the play store any more, I did crash it this evening, so I was able to send the author a note about me wanting to get in touch with him/her)  is a really basic AI. It is probably designed for a phone, but it seems really reliable.  The gaps around the angle display seem to be quite revealing on the tablet, but probably look good on a phone. The calibrate button is needed, and should be set while the aircraft is on the ground.

Where the Sensors app has trouble, is the coarseness of the changes. I had to integrate its reading to determine our attitude. I don't want to be too harsh on this app, it does well. It is a little jerky, and tended to not lock in to a particular pitch or bank angle. The bottom numbers are always integer values, so I wonder if there is some rounding going on, and that makes it less smooth. Overall, I really like the work that went into this app.

The other app, Gyro, or Inflight Instruments looks really good. It has a ton of settings. I've said before the Galaxy Note 10.1 sometimes doesn't work with some apps, because of the gyros, but this app lets you adjust around it with different Gyro configurations (in the settings menu). Once I found that my tablet seems to have the gyroscope orientation "C" with the tablet in portrait mode, and set the calibration, I could see it work.
The AI wasn't as sensitive as I might like. During the big right turn in the picture at the top, it seemed like we were doing a 15 degree bank, and the AI only showed about half a line of turn. The DG seemed right on, or very close. I got myself turned around, and thought the DG was pointing the wrong way, but let it go, it turns out it was pretty much right on.


Right now, I wouldn't use either of these for instrument replacements in actual IFR conditions. They show promise. I probably won't write my own gyro instrument app.

I did want to try A-EFIS, but thought it needed GPS (it does for altitude). That appears to be a reliable panel replacement.  Next time, I will try it.