I want to go into a bit more detail on this just for those who are curious. While I believe a video will be far more efficient and better to understand, I'll try to lay the groundwork for those so inclined to tinker.
The
openXsensor project has been going on since at least 2013 over at the OpenRC Forums. Essentially these folks, primarily user mstrens, have compiled the sensor libraries and integrated the code for Arduino use. The linked website has the download of the latest version that you simply open in Arduino IDE software and navigate to the oXs.config.h part of the sketch. For those ENTIRELY unfamiliar with Arduino... You can open the entire sketch by navigating to the folder and open the openXsensor.ino file with Arduino IDE. Then the oXs.config.h tab will be at the top and you will likely need to use the drop down tool to navigate there.
A little bit more information here so we know what and why we are making changes to the code. I'll not cover basic connection and uploading of sketches as there are lots of tutorials out there for that.
The arduino will operate off the 5V receiver supply voltage however the Smart Port (FrSky) for telemetry is a 3.3V signal. Therefore you need a 5.6K resistor in line with the signal wire. Picked up a set of 5 at the LHS for $2. This signal wire will be solder to a digital signal pad that we will define in the sketch. There are a few of these on an arduino nano and I used D2. For those electrically disinclined, there is no polarity for resistors so just solder it in line with the wire any way you want. Your + wire will be soldered to the VCC pad and - to GND or ground. This is just to get the arduino powered and potentially talking to your receiver. The digital pad you solder to must now be selected in the sketch under oXs.config.h. Line titled "2 - Serial data pin choice" is pretty close to the top and I used pin #2 as it was closer to the end of the board for my purpose but you can use whatever you want as long is it does not conflict with other default signals from the sketch. I believe D2 and D4 are available by default and it seems that D2 is the default that comes with the download. Save your selection and then write the sketch to the arduino board.
So, now you can connect the arduino to the receiver, turn on your transmitter, power up your receiver, and you should be able to navigate to the telemetry page in your transmitter and discover the new sensor. It should automatically be detected.
For the pressure sensor I had a few constraints to consider when selecting what sensor I wanted to actually buy. I'm working within a 5V system so an operating voltage (nominal) is one. I need a pretty high
operating pressure but to what point? Normal operating pressure of a retract system is around 100psi. To factor environmental conditions I figured a max of 120psi. This means, that should I charge the system with air and the airplane sits in the hot sun, the air may expand due to heat which will increase the pressure in the system. Now I need an overhead and based off of higher pressures available from manufacturers 150psi was selected as those were the only option. That said, I selected
this sensor. That's right, $38 for one little sensor. By comparison, I got my entire arduino board for $6. The data sheet is critical here as it provides information for you to figure out what pin to solder where. I'll note that while there are 8 pins on this sensor, only 3 are active and used. There is a ground, power, and output pin. The output is in voltage between 0 and 5V that correlates with pressure. There is also a transfer function sheet that includes the math associated with the expected output.
From here we wire the ground and positive wires from the arduino... same ones that are powering it... to the sensor itself. Then wire the output pin to an
analog pad on the arduino. I used analog pad 7 (A7) because again, it was close to the one end of the arduino so it made the package a bit neater for the final assembly.
Back to oXs.config.h but now line titled "6 - Voltages & Current sensor settings" where we start with assigning pad 7 under section 6.2, PIN_VOLTAGE. Each number there is associated with different pins available separated by a comma. I changed the first number to 7. Now, each subsequent row I will only be changing the first number. RESISTOR_TO_GROUND and RESISTOR_TO_VOLTAGE should both be 0 as we have no further resistance to account for. OFFSET_VOLTAGE I set to 0 and SCALE_VOLTAGE I set to 1.0. These numbers we can and will play with in the transmitter. The last part to edit is is under section 6.1. This is the part I had to learn a bit about from
@Craftydan. The voltage that is passed through is either
referenced to the internal regulated voltage from the arduino or the VCC voltage coming from the receiver. You can use either one. Save and upload to your arduino board.
I did create a spreadsheet where I could use the equation from the sensor data sheet to spit out the expected voltage on the output given the pressure and input voltage. This is where things went a bit sideways as the raw voltage measurements from the sensor using a voltmeter were pretty much dead on +/- 0.02V which is within the precision of the sensor. However, no matter which way I used the
reference voltage, I never saw on my transmitter what I saw on the voltmeter. Regardless, we can now move to the next step.
We should now be seeing some sort of reading on the transmitter with everything powered up. In the transmitter telemetry settings, make sure that no units are selected as there is no option for psi. We can not try to change the offset to get a zero reading with no pressure. Now, while applying pressure with a pump that has a gauge, we can modify the scale so that the pressure on the transmitter matches what is observed on the gauge. I used 40 and 60 psi as references. By the time I got to 100psi I was off by about 3psi but I figured that was acceptable since I'm just trying to get a rough idea of how "full" the tank is at that point. I only really need it to be accurate at around 60psi.
It's long, it's a bit dirty, but there you go.