HX711 Excitation Voltage and What You Need to Know

preview_player
Показать описание
If you want to minimize noise on the output data I would recommend understanding how to ensure the external transistor is fully used.
This video explains the potential divider used to control the excitation voltage (E+) and the corrected equation for calculating resistances. Data sheet is incorrect and should be VAVDD=VBG*(R1+R2)/ R2 or E+ = 1.25*(R1+R2)/R2

Example code to get you started, demonstrating features from the previous video. Edit out what you don't need if you just want to get the HX711 working.

Copy and paste into a blank sketch in Arduino IDE or similar. Unfortunately Youtube won't allow greater than symbol near end of code so you will need to replace it in the IDE. Just try to compile the code and it will find it for you.

//Timer and PWM setup works for Uno or Nano only (ATmega328P)
#include "HX711.h"

// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 4; //Can be another pin
const int LOADCELL_SCK_PIN = 5; //Can be another pin
const int RATE = 8;

HX711 scale;

long reading;
unsigned long previousMillis = 0;
int counter = 0;
int sampleTime = 0;
float samplePerSec = 0;
bool rate = 0;

void setup() {
//Set up PWM on pin 3
TCCR2A = bit(COM2A1) | bit(COM2B1) | bit(WGM21) | bit(WGM20);
TCCR2B = bit(WGM22) | bit(CS20);
OCR2A = 2; // 14 for 1MHz min recommended, 1 for 8MHz
OCR2B = 1; // half of OCR2A for 50% duty, 0 for 8MHz
pinMode(3, OUTPUT); // Output pin 3 for OCR2B connected to XI via 20pF capacitor
pinMode(RATE, OUTPUT); //Change sample rate with pin 8
digitalWrite(RATE, LOW); //set HX711 sample rate to slow
}

void loop() {
counter ++;
}
if (counter == 10) { // average over 10 samples can be changed for high or low sample rates but change value 4 lines below from 10000.0
counter = 0;
sampleTime = millis() - previousMillis;
previousMillis = millis();
samplePerSec = 10000.0 / sampleTime; // 10000 = 1000 x counter

digitalWrite(RATE, rate);
}
}
}
Рекомендации по теме
Комментарии
Автор

Exelente trabajo desarrollado lo felicito y se aprende bastante gracias y adelante

josemanuelriosgonzales
Автор

Obrigado pela dica do gnd, no meu sistema esta placa estava se comportando de maneira diferente do esperado.

carlos.csbr
Автор

Hello, thank you so much for your video. I’m using the hx711 and inputting 5v from my arduino, but when I measure the E+ voltage output, it gives 0.4 ish volts, which is really low. I thought it might be the board, but I swapped it and it did the same thing. I’m using the chip with a half Wheatstone bridge and 2 strain gauges. I ended up hooking up the Wheatstone bridge to a 9V battery instead of connecting it to the E+ and E-. When it was connected to the E+ and E- and I tried calibrating to get a load cell output, it would give nan, or 0. After connecting it to the 9v battery, the load cell output gave me a reading but it was fluctuating a lot and did not give any consistent values. How can I fix this issue with the E+ and E-, and do u think that hooking it up to a 9V battery was ok to do? Do you think that is what’s contributing to the fluctuations?

asalaahmad
Автор

Thank you so much. I will try this later as I was trying to figure out why I had fluctuations in readings of a load cell. I don't know if that will help but it sounds like it will. I will try it tommorrow and let you know.

РосенПашов-щф
Автор

Wouah, on peut avoir le montage final s'il vous plaît, merci beaucoup. J'avais eu ce problème de stabilité lors de la lecture de la sortie.

sandratraandrianarisoa
Автор

@Ed R, is it possible to get correct readings within 1 seconds of time? I saw in many videos that it takes areound 2-2.5 sec to settle down and measure the load weight correctly.

shoaibahmedsiddique
Автор

Thank for sharing this. I am just arduino hobbyist.
I saw a uA meter based on this sensor. I don't understand nothing at all, but it is the only project to build a micro ammeter on the web I have found. Author does not answer at all my doubts. There's a way you may help me to build it? I need to sense load lines from a cellphone. I'd like to DYI instead of read under a common DMM without any possible way to send to a computer. Thank you so much if you are able to.

svsv
Автор

sir please can you demonstrate why is vfb is equal to vbg

mimechehoussam
Автор

Do you have any measurement result before and after the connection to compare ?

ahmedmoustafa
Автор

If I need actual 5V as excitation, and 3.3V vcc/logic levels, I need to use an external regulator, correct?

gustavrsh
Автор

Very useful! You say to fix the missing ground link, and I'm sure that you are correct, however, my device seems to work well and I've not implemented the fix. What would I notice to be different if I do?

mindracing