Saturday, December 31, 2022

Some C++ hacking

Happy new year (in a few hours...) everyone! :)

Over the past few days, I've been hacking the Raspberry Pi C++ display code to make it more manageable. Previously, it was a pile of spaghetti that grew like a mushroom. Now I have a new repo for the code:

https://github.com/airball-aero/airball-display

In particular, I needed to add support for an adjustment knob, and this required dealing with Linux input events and multi-threading and what not, and if I had not cleaned up the code first, it would have been well nigh unintelligible.

The basic abstraction I added is a class Application which contains an instance of IEventQueue. The event queue acts like any other in a GUI app -- GUI events are posted to it by various threads, and the paint thread processes these events and paints, according to the frame rate. A better or worse human than I would have made the event queue a singleton, but I am worse or better than that, and am for now trying to stick to my "singletons are evil" religion.

This allowed me to add a bunch of code in class Settings so there is very rudimentary support for a (usually USB) adjustment knob -- either a commodity one like this; an Adafruit Rotary Trinkey for more embedded cases; and a custom circuit for even more embedded cases. By using the Linux HID support, I can just plug in via USB and don't have to deal with reading button presses via GPIOs and what-not.

It works, at least on my PC. I'm calling it a night. Here's to a productive and happy 2023!!! <3

Sunday, December 18, 2022

Mounting details for new probe concept

As promised, I did some more CAD work to describe how I imagine the new probe fitting into the scheme of things. Recall the "less is more" mantra. With that in mind, this is how I imagine it will work with the kinds of strut mounting systems we've been building so far:


The thing at the rear is the battery holder part of a flashlight. These are actually sold for $12-$15 as "flashlight hosts" for DIY flashlight makers, for example:

https://www.mtnelectronics.com/index.php?route=product/product&product_id=412

It should be easy to make electrical and mechanical adapters to fit a 18650 version on the end of one of our poles, and run a power wire to the probe. The good thing is, these things come with a water-resistant power switch built in:


That way, we abdicate all responsibility for battery charging -- just replace the battery -- and we also avoid the mechanical hassle of having to create a moisture-resistant battery holder ourselves from scratch.

For a more permanent installation, I imagine mounting as a pole on the wingtip. My friend Paul Eastham (an early Airball supporter) wrote an article for the EAA about these, where a certain you-know-what was featured, using ... um ... "repurposed bicycle inner tubes". Engineering on the cheap is where it's at here. Check out Paul's article here:

Great Airborne Images Within Reach

So given a 3/4" pole of any sort, it is easy to imagine mounting this probe to the end of it, and running a thin power wire in the obvious way -- perhaps into the wingtip of the airplane, and perhaps to sip a little bit of power from the wingtip lights.


It is possible to imagine feeding data via a wired method, so I am hoping to add the ability to send RS-232 signals as well. As for how to step-down an aircraft's power to something that 5V electronics can use, what I've been using is these super-cheap "battery eliminator circuits" from the radio-control world. You can get them at the hobby store, and even Adafruit has caught on!

Stay tuned as I iterate on these designs. Hopefully they can come to fruition in the next few months!