arduino ติดต่อ load cell 2 แสนง่าย
หลายคนเจอปัญหาในการต่อใช้งาน load cell กับ micrcontroller ดังนั้นทางเราจึงได้นำเสนอตัวอุปกรณ์ที่ทำหน้าที่ขยาย การทำงานของตัว load cell
โดยใช้ตัว Grove - Differential Amplifier
Specification
| Item | Min | Typical | Max | Unit | ||
|---|---|---|---|---|---|---|
| Operating Voltage | 2.7 | 5.0 | 36 | VDC | ||
| Input Voltage | 0.1 | \ | (Vcc-0.8)/Gain | mV | ||
| Output Voltage | 0 | \ | Vcc-0.80 | mV | ||
| Gain | Select 304 | 297.92 | 304 | 310.08 | / | |
| Select 971 | 951.58 | 971 | 990.42 |
|||
J2:Signal Source Interface
J1:Output Interface, Standard Grove Interface
R1:62Ω gain resistor
R3: 200Ω gain resistor
U1: INA125 IC, Instrumentation amplifier
ซึ่งตัว Grove - Differential Amplifier จะทำหน้าที่ในการขยาย gain ให้กับตัววงจรของเรา
การต่อใช้งานระหว่าง arduino กับ Grove - Differential Amplifier

เมื่อต่อ วงจรตามรูปเสร็จแล้ว ก็มาดูตรง code กันครับ
void setup()
{
Serial.begin(9600);
Serial.println("start");
}
void loop()
{
int i;
int value;
float V,Vo;
float Sum=0;
for(i=0;i<10;i++)
{
value=analogRead(4);
V=value*5.00/1023;
Sum+=V;
delay(10);
}
Vo=Sum/10;
Serial.print("Output score:");
Serial.println(Vo);
delay(1000);
}
code ตัวนี้เป็นตัวอย่างที่ลองนำค่าที่ได้แสดงออก output serial monitor
การทดสอบ สามารถทดสอลโดยการกดลงบน load cell แล้วจะเห็นการเปลี่ยนแปลง
เช่น เมื่อกด load cell จะเห็นตัวเลขที่เพิ่มขึ้นตามน้ำหนักที่เรากดลงไป
clip ตัวอย่างการใช้งาน


