Rahmen mit 4 Wägezellen (pro Ecke eine)

Hi Markus,
I was concerned about number of digital pins (8) needed if I had 4 independent ADCs. Then I realized I can drive all ADCs with just single clock line needing in total just 5 digital pins while having results immediately from all of them. Reading from 4 (or whatever number) ADCs is then the same as you would read from single one. When reading bit levels from DOUT you just need to cycle through all of the DOUT lines on single CLK pulse, then move on with next clock pulse. But of course, you can read ADCs one by one independently, it just takes some miliseconds more time and takes 3 more digital pins.
No, I am not calibrating cells separately. To save time I just sum-up values from all ADCs, then doing conversion to weighting units (kilogram). I am doing the same as you would hooking up all cells in analog domain. I am doing this just in digital domain. But of course, having enough time, you can calibrate all of them separately, then sum-up.

Code example how my array of HX711 is bit-banged:
value is an array of converted results, _pin_slk is digital out clock pin, _pin_dout[ ] is array of digital input DOUT pins. Code from mbed:

long value[CELL_COUNT];
        for(i=0;i<24;i++)
        { 
            _pin_slk = 1;
            for(j=0;j<CELL_COUNT;j++){
                value[j]=value[j]<<1;
            }
            _pin_slk = 0;
            for(j=0;j<CELL_COUNT;j++){
                if(_pin_dout[j]){
                     value[j]++;
                }
            }
        }

image

Peter

1 Like