Height sensor for hydrofoil boat + I2C sensor

Hi guys,

I’m new on this forum so tell me if I’m not on the right section of the forum…
I’m doing a project for a hydrfoil boat (which flies and when it flies, it’s like an inverted pendulum… So very unstable)
To control this guy we are using a height sensor (called Teraranger one with 600Hz update rate) with I2C wiring to an APM2 autopilot.
The problem is:
The sensor is compatible with the I2C port of the Pixhawk autopilot but not with the Arduflyers. The guys of the sensor told me that either I have to switch to Pixhawk board or either writing my own code to “make” this sensor compatible with APM2.
I don’t know if someone has some information about that kind of code for an uncompatible sensor? How to do it? Where to write the code? On the Arduino IDE?
And if it’s possible, will it be possible to read the sensor data on Mission planner?

Thank you in advance

Kind regads

I do not know enough about the APM code to give any detailed help.
I suggest that you look at Dronecode for software development. dronecode.org

It maybe possible to use a Teensy, or some other ‘fast’ Arduino compatible micro for signal conditioning . It could also re-scale the range measurements and signal format to make it friendly with APM2.

Wen you say that “it flies” do you mean figuratively or that it is a “flying boat” , like a seaplane ?


Hi Chris,

Thank you for your answer.

So first when I say ‘it flies’ it mean that there is two foils under the hull of the boat and when the speed of the boat increases, the hull starts to fly. So the foils are like two airplane wings that must stay in the water to make the hull ‘fly’. This type of boat is meant to decrease the drag of the boat, in more common terms decrease the friction between the boat and the water as the hull (biggest part of the boat) is no more immersed. Hope you see what I mean?!

You can find an example here : hydrofoil.org/images/Jetfoil-pass.jpg

Our boat as only two centered foils so we have to control the roll and pitch angles of the hull with two flaps that stay in the water, so I really need an autopilot (like APM). Will be more or less like the control of a plane in the pitch and roll direction.

So I will check your suggestion and if you or someone can suggest anything else it would be very helpful :wink:

Thank you

(sorry for my ‘not very accurate’ English, I’m french --’)