# Any experience with analog inputs for load cell

**URL:** <https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939>\
**Category:** ArduSub\
**Created:** [August 9, 2020, 10:34pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939 "2020-08-09T22:34:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew.keefe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/andrew.keefe/32/5798_2.png) [@andrew.keefe](https://discuss.bluerobotics.com/u/andrew.keefe)\
**Post date:** [August 9, 2020, 10:34pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/1 "2020-08-09T22:34:46Z")

</div>

My semi-autonomous tow vehicle is being fitted with a load cell to help us measure drag. Does anyone have any experience using an analog input for this type of sensor on a Pixhawk, and if so did you make any modifications to the firmware?

I know I saw some people have mapped analog sensors as hydrophones and then post processed accordingly.

Does anyone know the resolution of the A/Ds on the Pixhawk 4? It’s not in the documentation.

---

<div class="post-metadata">

**Author:** ![williangalvani](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@williangalvani](https://discuss.bluerobotics.com/u/williangalvani)\
**Post date:** [August 10, 2020, 2:33pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/2 "2020-08-10T14:33:05Z")

</div>

IIRC to get readable voltages out of this kind of sensors, you usually need a wheatstone bridge.  
I have used the HX711 before (on a different project, no ardupilot involved) but that outputs SPI instead of an analog voltage.

You should be able to set up a circuit that outputs from 0 V to 3.3 V, or 0 V to 6.6 V.

---

<div class="post-metadata">

**Author:** ![andrew.keefe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/andrew.keefe/32/5798_2.png) [@andrew.keefe](https://discuss.bluerobotics.com/u/andrew.keefe)\
**Post date:** [August 10, 2020, 2:47pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/3 "2020-08-10T14:47:20Z")

</div>

Thanks William, but I’d prefer to keep this on topic. Methods of adding the capability are well established.

---

<div class="post-metadata">

**Author:** ![rjehangir](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/rjehangir/32/671_2.png) [@rjehangir](https://discuss.bluerobotics.com/u/rjehangir)\
**Post date:** [August 12, 2020, 2:02pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/4 "2020-08-12T14:02:05Z")

</div>

Hey Andrew,

Can you share more about the load cell output? Is it a raw connection to the strain gauge or do you have a load cell with a conditioned output?

-Rusty

---

<div class="post-metadata">

**Author:** ![andrew.keefe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/andrew.keefe/32/5798_2.png) [@andrew.keefe](https://discuss.bluerobotics.com/u/andrew.keefe)\
**Post date:** [August 18, 2020, 2:36pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/5 "2020-08-18T14:36:55Z")

</div>

I just got the specs on the load cell, and we’ll need to use an external A/D and then talk SPI to the Pixhawk. I wish there was a way to know the bits of the onboard A/D. Maybe if I took the cover off and inspected the PCB.

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 20, 2020, 8:43pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/6 "2020-08-20T20:43:46Z")

</div>

The A/D used on the pixhawk is the one internal to the stm32. It’s 12 bit. There’s no support for reporting the a/d measurement directly for arbitrary analog sensors. I did try to pull in support for this functionality in the past. You can find that work here: [Sub: send AP\_ADC by jaxxzer · Pull Request #8296 · ArduPilot/ardupilot · GitHub](https://github.com/ArduPilot/ardupilot/pull/8296)

---

<div class="post-metadata">

**Author:** ![jwalser](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/jwalser/32/2234_2.png) [@jwalser](https://discuss.bluerobotics.com/u/jwalser)\
**Post date:** [August 20, 2020, 8:47pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/7 "2020-08-20T20:47:27Z")

</div>

> [@jwalser](#):
>
> The A/D used on the pixhawk is the one internal to the stm32. It’s 12 bit.

This applies to pixhawk 1 i’m not sure about pixhawk 4.

---

<div class="post-metadata">

**Author:** ![andrew.keefe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/andrew.keefe/32/5798_2.png) [@andrew.keefe](https://discuss.bluerobotics.com/u/andrew.keefe)\
**Post date:** [September 15, 2020, 3:38pm UTC](https://discuss.bluerobotics.com/t/any-experience-with-analog-inputs-for-load-cell/7939/8 "2020-09-15T15:38:36Z")

</div>

We’ve decided to use a separate driver board and communicate the load cell data to the PX4 over CAN.
