Creating a function to check sensor's connection first

Hello all,

I'm using HX711 modules with multiple Load cells with Arduino. I have no problems with the use of these modules or reading data.
However, I would like to add one more function that tests the availability and connection of the load cells before doing anything else and blink a specific led indicating a wiring issue

Any thoughts on how to approach that?

Note: you know the load cell has four wires connected to the HX711 and sometimes one of these wires gets loos for any possible reason so the readings that come to the Arduino in that event are not really consistent as sometimes you will end up with random big numbers that make no sense and other times where multiple wires are disconnected then you will get a zero.

Hello khamis98
Design and code a plausibilty check for the values measured.

Have a nice day and enjoy coding in C++.
Дайте миру шанс!

In my code, I start with identifying the calibration factor, followed by a tare function to remove the zero offset. So, supposedly, all scales at this point have the reading of zero. After that, I proceed to apply load into these loadcells, and then base on the measured value i should be giving a signal. The system is more complex and I can't risk starting to apply the load unless I'm sure the load cell is ready.

Should I run that code before I tare the scales, and if so, how can approach that? What should i be testing? The change in readings without load?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.