i have auto filling project, which can use load sensor to regulate quantity of product from one place to another.
i use driver HX711 to communicate I2C to arduino.digital output 13 connect to relay 5V for handle solenoid valve 220VAC.
condition process of autofilling is:
0% -80% : normal filling (relay always ON)
80%-100% : autoon-off filling (relay ON-OFF)
in position 80% of desire input(total quantity product) ,pin13 will switch ON-OFF without delay until finished (desire input achieved) . my problem is: while condition auto on-off (relay on-off),any some noise from 220VAC which can disturbe read of sensor (disorder value).
how to solve that problem?? thx so much...
That is one of the most difficult things to solve from a distance.
The HX711 is a load cell amplifier. Those are very sensitive.
The most important thing is to have good grounding, or seperate grounds with opto-coupler. The HX711 needs also good shielding. And the power supply for the Arduino and HX711 has to be properly decoupled. The wires should be close next to each other, or in a shielded cable. Can the aluminum of the load cells pick up some 230V noise ? Is the ground of the Arduino board connected somehow to something ?
There is a lot more to say about this subject.
You can use the average of a few samples to have a better weight measurement, but the grounding and shielding has to be fixed first.
The I2C data wires SDA and SCL should have minimal influence on each other, and have minimal capacitance to ground.
A shielded cable is in most cases a bad idea, because of the capacitance to ground.
Also a flat ribbon cable is not good for I2C, but a twisted-pair cable is even worse for I2C.
A normal 4 wire cable (not twisted pair) can be used, as long as the wires and isolation are not too thing. Some USB cables use very thin wires and very thin isolation. More isolation around the wires means less influence between the wires. Some use cat5 cable and use one and a half twisted pair for the I2C.
I would say 50cm is about the maximum for I2C, but 2 meters should be no problem with a good cable.