lonelysushi
Posts: 4
Joined: Sat Jun 04, 2016 7:17 am

Multiple ADC?

Sat Jun 04, 2016 7:24 am

Hello,

I just got my pi3 and still very new at doing this. I am looking into writing a program to read 4 load cell weight scales individually in each corner of the car.

I then found out I needed ADC for the load cells to amplify and convert the signals to digital (HX711 from what I read). However, I am not sure if I can connect 4 different ADC to the Pi and have it recognize each separately? is this possible?

Thanks

mthomason
Posts: 113
Joined: Sun Apr 24, 2016 12:28 pm

Re: Multiple ADC?

Sat Jun 04, 2016 12:56 pm

You'll probably want an external ADC chip that can handle multiple inputs.

Adafruit have a 4-channel ADC and even have a Raspberry Pi-specific tutorial for it.

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Multiple ADC?

Sat Jun 04, 2016 1:30 pm

The HX711 is a pretty specialised ADC specifically designed for load cells. A normal ADC will be pretty useless with load cells.

You can connect multiple HX711, one per pair of spare GPIO.

lonelysushi
Posts: 4
Joined: Sat Jun 04, 2016 7:17 am

Re: Multiple ADC?

Sat Jun 04, 2016 2:05 pm

thank you,

yes, looking at the pin connection for the 4 channel ADC im not quite sure how to continue from there since the load cells are 4 wire load cells.

I thought I had to use multiple HX711 to wire these up, but one part confused me is (very new at this so bear with me) that it has a clk and dat pin and the pi only has one set that I see in the GPIO, and i dont think i can share the clk pin with multiple baord right...?or is it something i can configure to add?

also, can i share the 3.3v pin with all 4 HX711 boards?

thanks

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Multiple ADC?

Sat Jun 04, 2016 2:19 pm

lonelysushi wrote:thank you,

yes, looking at the pin connection for the 4 channel ADC im not quite sure how to continue from there since the load cells are 4 wire load cells.

I thought I had to use multiple HX711 to wire these up, but one part confused me is (very new at this so bear with me) that it has a clk and dat pin and the pi only has one set that I see in the GPIO, and i dont think i can share the clk pin with multiple baord right...?or is it something i can configure to add?

also, can i share the 3.3v pin with all 4 HX711 boards?

thanks
The (two) 3V3 pins form part of the 3V3 power rail. You can connect as many thing as you want. Each HX711 uses a few milliamps.

The clock signal may be generated by any GPIO, there is nothing special about the HX711 clock (apart from a maximum pulse width of 60 µs).

I'd be tempted to drive each HX711 from the same clock GPIO so that you would get simultaneous readings from each sensor.

Here is example code for one sensor, http://abyz.co.uk/rpi/pigpio/examples.h ... n_HX711_py

lonelysushi
Posts: 4
Joined: Sat Jun 04, 2016 7:17 am

Re: Multiple ADC?

Sat Jun 04, 2016 2:33 pm

joan wrote:
lonelysushi wrote:thank you,

yes, looking at the pin connection for the 4 channel ADC im not quite sure how to continue from there since the load cells are 4 wire load cells.

I thought I had to use multiple HX711 to wire these up, but one part confused me is (very new at this so bear with me) that it has a clk and dat pin and the pi only has one set that I see in the GPIO, and i dont think i can share the clk pin with multiple baord right...?or is it something i can configure to add?

also, can i share the 3.3v pin with all 4 HX711 boards?

thanks
The (two) 3V3 pins form part of the 3V3 power rail. You can connect as many thing as you want. Each HX711 uses a few milliamps.

The clock signal may be generated by any GPIO, there is nothing special about the HX711 clock (apart from a maximum pulse width of 60 µs).

I'd be tempted to drive each HX711 from the same clock GPIO so that you would get simultaneous readings from each sensor.

Here is example code for one sensor, http://abyz.co.uk/rpi/pigpio/examples.h ... n_HX711_py

awesome thanks, I will give that a try next few days to get a single one working first... once one is working, i just have to connect the other three to any three other pairs of pins and it should read them together?

thanks again!

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Multiple ADC?

Sat Jun 04, 2016 2:46 pm

lonelysushi wrote: ...
awesome thanks, I will give that a try next few days to get a single one working first... once one is working, i just have to connect the other three to any three other pairs of pins and it should read them together?

thanks again!
Not quite, because of the way I generate the clock to be sure it is always less than 60 µs. If you want to use that code as is I'd instantiate an object per HX711 (separate clock and data) but only have one operational at a time.

Something like.

Code: Select all

s1 = HX711.sensor(pi, DATA=9, CLOCK=10, mode=CH_A_GAIN_128)
s2 = HX711.sensor(pi, DATA=11, CLOCK=12, mode=CH_A_GAIN_128)
s3 = HX711.sensor(pi, DATA=13, CLOCK=14, mode=CH_A_GAIN_128)
s4 = HX711.sensor(pi, DATA=15, CLOCK=16, mode=CH_A_GAIN_128)

sensors =[s1, s2, s3, s4]

for s in sensors:
   s.pause()

while True:

   for s in sensors:
      s.start()
      time.sleep(0.2)
      count, mode, reading = s.get_reading()
      s.pause()

lonelysushi
Posts: 4
Joined: Sat Jun 04, 2016 7:17 am

Re: Multiple ADC?

Sun Jun 05, 2016 3:18 am

joan wrote:
lonelysushi wrote: ...
awesome thanks, I will give that a try next few days to get a single one working first... once one is working, i just have to connect the other three to any three other pairs of pins and it should read them together?

thanks again!
Not quite, because of the way I generate the clock to be sure it is always less than 60 µs. If you want to use that code as is I'd instantiate an object per HX711 (separate clock and data) but only have one operational at a time.

Something like.

Code: Select all

s1 = HX711.sensor(pi, DATA=9, CLOCK=10, mode=CH_A_GAIN_128)
s2 = HX711.sensor(pi, DATA=11, CLOCK=12, mode=CH_A_GAIN_128)
s3 = HX711.sensor(pi, DATA=13, CLOCK=14, mode=CH_A_GAIN_128)
s4 = HX711.sensor(pi, DATA=15, CLOCK=16, mode=CH_A_GAIN_128)

sensors =[s1, s2, s3, s4]

for s in sensors:
   s.pause()

while True:

   for s in sensors:
      s.start()
      time.sleep(0.2)
      count, mode, reading = s.get_reading()
      s.pause()

Thanks! I will give it a try... one step at a time (first need to find more HX711)

sonarscope
Posts: 2
Joined: Thu Apr 05, 2018 8:53 am

Re: Multiple ADC?

Thu Apr 05, 2018 9:12 am

hi do You manage to make all 4 Sensor HX711 it work ?
thanx best emil

Idahowalker
Posts: 504
Joined: Wed Jan 03, 2018 5:43 pm

Re: Multiple ADC?

Thu Apr 05, 2018 11:21 am

One could just use 1 ADC and multiplex the inputs to the ADC.
Without knowing why you are deleting my postings, I will not know how...

andros
Posts: 1
Joined: Sat Sep 07, 2019 3:48 pm

Re: Multiple ADC?

Sat Sep 07, 2019 3:54 pm

Hi. I am very new to Raspberry Pi and this is the project I would like to try.
Did the OP ever get this working and can you or anyone else provide more specific details on how this is accomplished?

I am aiming to utilize multiple load cells with one RPi.

Thanks!

06GTODriver
Posts: 4
Joined: Sat Feb 08, 2020 4:14 pm

Re: Multiple ADC?

Sat Feb 08, 2020 4:18 pm

holy smokes, im lookin to do the exact same thing did you ever get this to work?? I too am very new to this whole raspberry pi world and need lots of help.
I have my pi, 4 hx711 's and a load cell (just to start with 1 for now) but have no idea about programming. can you shed some light on this for me?? I have checked out numerous git hubs and cant get anything to work lol

Return to “Beginners”