# How do I read ADC values with the Navigator board?

**URL:** <https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599>\
**Category:** Blue Robotics Products\
**Created:** [June 30, 2023, 10:02am UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599 "2023-06-30T10:02:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![abroun\_beholder](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@abroun\_beholder](https://discuss.bluerobotics.com/u/abroun_beholder)\
**Post date:** [June 30, 2023, 10:02am UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/1 "2023-06-30T10:02:24Z")

</div>

Hi there,

I’m currently working with a Pi 4 and the Blue Robotics Navigator board, pulling sensor data back to a control program using MAVLink. So far all has been going well, I’ve been able to get accelerometer and depth sensor readings from MAVLink, and I was recently able to pull temperature sensor readings in from the SCALED\_PRESSURE3 message.

I’m a bit stuck though getting readings from the 2 ADC connectors on the Navigator board because from what I can tell, there doesn’t seem to be support for the ADC, either in the MAVLink messages, or in the ArduSub firmware.

Is this correct? Is there any plan to introduce support for the ADC, and if so what is the timeline? Currently it’s hard to see how these ADC ports are usable without software support. 😛

If I was to try and implement support myself, am I correct in understanding that the best way would be to create a patched version of ArduSub, and then add in a new MAVLink message? I’m assuming that creating a standalone program that tried to talk I2C to the ADC chip using the PI GPIO pins would be a bit of a non starter because it would interfere with ArduSub trying to talk I2C to the other chips on the same pins at the same time?

Any suggestions or advice on how to proceed here would be much appreciated.

Many thanks

Alan

---

<div class="post-metadata">

**Author:** ![abroun\_beholder](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@abroun\_beholder](https://discuss.bluerobotics.com/u/abroun_beholder)\
**Post date:** [July 4, 2023, 9:20pm UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/2 "2023-07-04T21:20:19Z")

</div>

Hello,  
Just a bump to see if anyone can help with this.  
Regards  
Alan

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [July 7, 2023, 11:24pm UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/3 "2023-07-07T23:24:48Z")

</div>

Hi @abroun_beholder, welcome to the forum 🙂

Apologies for the delay on this - it took some time to get confirmation on the current state of things.

> [@abroun\_beholder](#):
>
> … there doesn’t seem to be support for the ADC, either in the MAVLink messages, or in the ArduSub firmware.
> 
> Is this correct?

Somewhat, but not entirely. There is an [`AP_ADC`](https://mavlink.io/en/messages/ardupilotmega.html#AP_ADC) MAVLink message in the ArduPilotMega message set, and it’s even technically [supported by ArduPilot firmwares](https://github.com/ArduPilot/ardupilot/blob/Sub-4.1/libraries/AP_HAL_ChibiOS/AnalogIn.cpp). The caveat is that it’s currently compiled out for most flight controller types (including the Navigator) unless they’re compiled in a debug mode, which in practice means it doesn’t actually get sent.

> [@abroun\_beholder](#):
>
> Is there any plan to introduce support for the ADC, and if so what is the timeline?

I spoke with the software team and we agreed that it seems like a valuable feature to have, especially since it’s [been asked about before](https://discuss.bluerobotics.com/t/cathodic-protection-adding-voltage-to-telemetry-overlay/10927/13). That said, it’s not an immediate priority for us (since it’s new functionality that’s not strictly required for effective operation and standard use of a vehicle), so I can’t provide a timeline for it.

For what it’s worth [there’s an open issue about it](https://github.com/ArduPilot/ardupilot/issues/8527) that you’re welcome to comment on and/or provide contributions towards if you’d like to help/encourage the feature to get implemented.

As a side note, it may be possible to get access to the ADC readings in the interim via a workaround, whereby you configure an additional battery monitor and set it up with an offset of 0v and a multiplier of 1.

> [@abroun\_beholder](#):
>
> I’m assuming that creating a standalone program that tried to talk I2C to the ADC chip using the PI GPIO pins would be a bit of a non starter because it would interfere with ArduSub trying to talk I2C to the other chips on the same pins at the same time?

There’s some possibility this could work, but it’s likely preferable to do something else instead, especially since there are other known approaches (as discussed above) that are less likely to cause conflicts.

---

<div class="post-metadata">

**Author:** ![bommix](https://avatars.discourse-cdn.com/v4/letter/b/f05b48/32.png) [@bommix](https://discuss.bluerobotics.com/u/bommix)\
**Post date:** [June 29, 2023, 10:54pm UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/4 "2023-06-29T22:54:04Z")

</div>

How can i read the ADC from the Flightboard Controller? How is it connected is there any tutorial?

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [July 8, 2023, 12:17am UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/5 "2023-07-08T00:17:13Z")

</div>

Hi @bommix,

I’ve moved your post to this thread because it’s on the same topic.

Please see my response above. Feel free to ask follow ups if there’s something that’s not clear 🙂

---

<div class="post-metadata">

**Author:** ![abroun\_beholder](https://avatars.discourse-cdn.com/v4/letter/a/3ab097/32.png) [@abroun\_beholder](https://discuss.bluerobotics.com/u/abroun_beholder)\
**Post date:** [July 10, 2023, 4:31pm UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/6 "2023-07-10T16:31:59Z")

</div>

Hi @EliotBR, thanks for the information, that’s much appreciated.

Regards  
Alan

---

<div class="post-metadata">

**Author:** ![MattyD797](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@MattyD797](https://discuss.bluerobotics.com/u/MattyD797)\
**Post date:** [September 17, 2024, 3:16am UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/7 "2024-09-17T03:16:12Z")

</div>

Has there been updated support or a workaround for ADC readings from the Navigator while running ArduSub?

---

<div class="post-metadata">

**Author:** ![tony-white](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/tony-white/32/13297_2.png) [@tony-white](https://discuss.bluerobotics.com/u/tony-white)\
**Post date:** [September 17, 2024, 4:58pm UTC](https://discuss.bluerobotics.com/t/how-do-i-read-adc-values-with-the-navigator-board/14599/8 "2024-09-17T16:58:13Z")

</div>

Hi @MattyD797 -  
I’ve had success reading the ADC with Lua scripts, but you’ll need to be running ArduSub beta (4.5+)  
You can find an example [here](https://github.com/vshie/luascript_library_BlueRobotics/blob/main/adc_test.lua)!
