HX711 module - How to read from a digital bathroom scale?

Post Reply
natenho
Posts: 17
Joined: Fri Aug 14, 2015 10:13 pm
languages_spoken: english, brazilian portuguese
ODROIDs: C1, C1+, C2, U3, XU4
Has thanked: 0
Been thanked: 0
Contact:

HX711 module - How to read from a digital bathroom scale?

Unread post by natenho » Mon Jul 22, 2019 9:35 am

Hello, I'm trying to setup an ODROID-C1 to read from a digital bathroom scale, using the HX711 module amplifier

Image

But I have no clues on how to do the wiring. I've tried to use several examples from Raspberry Pi, but with no success. I don't know which pins I should connect to these DT/SCK ports in the shield.

Could someone help me?

Thanks!!

User avatar
mad_ady
Posts: 6363
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 144 times
Been thanked: 105 times
Contact:

Re: HX711 module - How to read from a digital bathroom scale?

Unread post by mad_ady » Mon Jul 22, 2019 1:56 pm

Note that you need a level shifter since that circuit works with 5V.
For the two signal pins you need 2 gpio pins. You may need to adapt this arduino code: https://www.instructables.com/id/How-to ... h-Load-Ce/, or wait for @tobetter's suggestion on how to run it.

User avatar
tobetter
Posts: 3764
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 128 times
Contact:

Re: HX711 module - How to read from a digital bathroom scale?

Unread post by tobetter » Mon Jul 22, 2019 5:20 pm

Ok, since @mad_ady mentioned me...

I've looked into the datasheet of XH711 and its operating voltage is 2.6V~5.5V so...it's ok to connect with ODROID-C1.
https://cdn.sparkfun.com/datasheets/Sen ... nglish.pdf

For the wiring, since the board can be interfaced through I2C, please visit the link for the detail of GPIO.
https://wiki.odroid.com/odroid-c1/hardw ... connectors

Code: Select all

VCC -> GPIO pin #1
SCK -> GPIO pin #5
DT -> GPIO ping #3
GND ->  GPIO pin #7
https://wiki.odroid.com/odroid-c1/appli ... e/gpio/i2c

The problem is that there is no driver for XH711, AFAIK, so you would need to access the I2C bus and read raw data to part it. Since there are some example for Arduino, you would be able to find the code of how you can parse it or you already have it.
In order to verify if I2C bus works, you will need to run i2cdetect. Sorry...this is the link for ODROID-XU4 but can have the same idea to run on ODROID-C1.
https://wiki.odroid.com/old_product/acc ... _i2c-tools

natenho
Posts: 17
Joined: Fri Aug 14, 2015 10:13 pm
languages_spoken: english, brazilian portuguese
ODROIDs: C1, C1+, C2, U3, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: HX711 module - How to read from a digital bathroom scale?

Unread post by natenho » Wed Jul 24, 2019 12:59 pm

Hi!

I have some possibly dumb questions:

1) Why would I need a level shifter when ODROID-C1 has a 3.3v and also a 5.0v pin?

2) My hx711 module and that instructables example link module have the same specs, so
Operation supply voltage range: 4.8 ~ 5.5V
Could you tell me why it is different from the chip datasheet (>2.6v)?

3) I've purchased the module from http://www.baudaeletronica.com.br/modu ... eso.html . There says that the interface is SPI. @tobetter, how exactly do you know that it's I2C?

4) I've tried I2Cdetect and it shows that all the ports are occupied with random numbers, so there's something very very wrong.. Should I care about the clock speed and maybe follow the clock freq change procedure from odroid wiki?

Thank you guys very much!

User avatar
tobetter
Posts: 3764
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 28 times
Been thanked: 128 times
Contact:

Re: HX711 module - How to read from a digital bathroom scale?

Unread post by tobetter » Wed Jul 24, 2019 1:13 pm

3) I've purchased the module from http://www.baudaeletronica.com.br/modu ... eso.html . There says that the interface is SPI. @tobetter, how exactly do you know that it's I2C?

4) I've tried I2Cdetect and it shows that all the ports are occupied with random numbers, so there's something very very wrong.. Should I care about the clock speed and maybe follow the clock freq change procedure from odroid wiki?
My bad, it's indeed SPI, not I2C. I read the Arduino code again.
Since it's SPI, SCK to PIN #23 and DT to PIN #21 or PIN #19, since the sensor module probably only provide the data to the master device periodically, PIN #21 would be correct.
https://wiki.odroid.com/odroid-c1/hardw ... connectors

In order to run SPI, you will need the driver set up on ODROID-C1.
https://wiki.odroid.com/odroid-c1/appli ... pio/spi#c1

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest