Can logic shifters work with DT/SCK I/Os of HX711

Trying to figure out if level shifters can link the 5v levels of HX711 SCK/DT I/Os to the 3.3v levels of low power MCU digital pins when the HX711 VCC input is driven at 5v.

Generally accepted practices appear to be either to switch to a sparkfun board which separates VCC from VDD or to hack the module as per the sparkfun design pattern.

Is there any specific reason why the SCK/DT lines can't just be shifted low to connect with 3.3v pins directly? I have searched all over google but can't find any explanations for why this should not be done.

A bidirectional logic level shifter like this one should work fine. The two Vccs (LV and HV) need to be connected appropriately.

Why don't you try it with a 2k:1k voltage divider on the Data output.
Leo..

Thanks for the responses.

Tried Jremington's board suggestion a few times but the HX711_ADC library I used throws up this error.

"Timeout, check MCU>HX711 wiring and pin designations"

I had both data and clock lines on the level shifter though.

Edit: Everything works fine when the HX711 module is powered with 3.3v. Error only shows up when i try to power it with 5v and then shift the signal lines lower. [End Edit]

Haven't attempted using voltage dividers on the data line.

Going by your inputs, it seems there should be no reason why changing levels on SCK/DT shouldn't work. However, most of the stuff i read on this forum went straight to one of the two options i mentioned earlier.

@Leo: can the pin connected to SCK feed the HX711 board with 3.3v logic directly?

The data pin of the HX711 is an output, and the clock pin is an input.
That makes me think you only need to level shift the data pin.
Not sure if the HX711 accepts a 3.3volt-logic clock signal.

Why don't you try changing that HX711 board for dual supply.
Leo..

:smirk: sparkfun, dual input module....

I will try shifting just the data line to see if HX711 will accept 3.3v clock logic in a couple hours (away from my desk ATM).

Howdy folks. Got round to testing with only DT going through the logic converter. Worked splendidly on the first try. Big thanks to Leo and Jremington.

Added a few pics of my setup. My soldering skills aren't spectacular but nothing seems to shake if I pull at the wires lightly.

Image 1: wired HX711 module

Image 2: closeup shot of breadboard side wires

Image 3: closeup shot of load cell side wires

Image 4: working 3.3v breadboard setup

Image 5: nonfunctioning 5v breadboard setup

Image 6: functional 5v breadboard setup

It seems strange that running SCK through the shifter throws up the error. One would expect that to be the standard way of wiring the module to the nano (33 BLE). Any thoughts on what might be happening there?

Those level shifters are designed for I2C, which is passive pull up and active pull down.
To level shift a digital push/pull signal, you should use digital ports, like this one.

Can you still try the 1k:2k (2k2) voltage divider I mentioned, no level shift boards.
Leo..

1 Like

Howdy. I'll try the resistors in the coming week and report back here. I expect it'll work okay anyways.

OTOH, your last reply's got me studying up on level shifters generally. I think the answer to my SCK question is related to how they work.

Tried the 1k:2k voltage divider and it worked fine (no suprises there).

I suppose it's more efficient compared to using level shifters cos there are fewer components and smaller resistances involved, hence less power draw. Thanks for the tip Leo.

Comes in smaller foot prints too.

image

Yeah, Leo mentioned that one a few posts up.

Basically, HX711 SCK port is not compatible with level shifter conversion techniques. Use a digital port instead. However, SCK port accepts 3.3v straight from 3.3v MCU so digital port is not strictly necessary.

Thanks everybody.

As a side note, anyone looking to use the HX711_ADC library for a nano 33 BLE will have to:

  1. change INPUT to INPUT_PULLUP in the .cpp file of the library
  2. modify appropriately or comment out all the sections of code related to EEPROM.

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