Arduino weighing scale (electronic weighing machine) with an analog display

Arduino weighing scale

With this retro-style scale, the result is shown on the galvanometer rather than an LCD display.

What is Arduino weighing scale ?

The Arduino weighing scale machine is a digital scale that uses an analog display to show the weight of an object.

The scale has a capacity of up to 50kg and is accurate to within 1g. The scale is powered by a 9V battery and can be used with any type of load cell.

An Arduino weighing scale is a device that uses the Arduino platform to weigh objects. The Arduino platform is a popular choice for DIY electronics projects because it is easy to use and has a large community of users who can provide support. There are many different types of Arduino weighing scales, but they all work by using sensors to measure the weight of an object and then displaying the weight on a screen.

An Arduino weighing scale is a type of electronic scale that uses an Arduino microcontroller to weigh objects. The scale consists of four load cells, which are placed under the object to be weighed, and an Arduino board. The load cells convert the weight of the object into an electrical signal, which is then processed by the Arduino board to calculate the weight. The scale can be used to weigh objects up to a maximum of 50 kg.

Arduino weighing scale Materials Requirements:

  • Arduino Nano 3
  • Load cell 5kg
  • Breakout boardHX711
  • Galvanometer or 5V voltmeter
  • Trimmer Potentiometer 10 kohm
  • Through Hole Resistor, 470 ohm
  • LED (generic) 
  • Slide Switch

Arduino weighing scale Software Requirements: 

  • Arduino IDE

TOOLS needed:

The load cell, a type of transducer used in the electronic weighing scale, generates an electrical signal whose strength is precisely proportionate to the force being measured. A compact breakout board equipped with the 24-bit high precision A/D converter HX711 IC serves as the amplifier and processor for this signal.

In this instance, I updated the standard code so that the calibration process is presented via LEDs and the weight is displayed on an analog instrument instead of the usual LCD display or serial monitor.

This substantially simplifies the construction of the device, which has only a few components and has a unique retro look:

Arduino nano microcontroller

  • – Load cell
  • – brakot board HX711
  • – Galvanometer or Voltmeter
  • – two resistors
  • – power switch
  • – trimer potentiometer
  • – and four LEDs

Although the cell can hold weights of up to 5 kg, I mapped the maximum weight in the code to 1 kg to provide greater accuracy when measuring light weights.

The galvanometer is tested once the switch is turned on, and then the arrow moves to the end position before returning. The trimmer potentiometer is used to calibrate the scale if there is a variation from the marked scale. The blue LED now flashes, signaling that the scale is now calibrating itself. This process involves zeroing while ignoring the weight of the plate that the measuring weight is resting on. Following that, the yellow LED turns on as a signal that you should insert a known weight previously specified in the code; in our case, that known weight is 100 grams. The white LED turns on after the calibration is finished, indicating that the scale is prepared for measurement.

I’ll also give you an example where we need to determine an object’s weight without determining the weight of the container it is in. You can see the prototype, where in addition to the LEDs, there is also an LCD Display that displays the weight and scales’ current status. Due to the project’s simplicity, the LCD Display was excluded from the construction process.

Finally, the device is put inside a 3-millimeter thick PVC board enclosure that is appropriate.

parts

  • 5kg Load cell
  • Building
  • Schematic diagram

Arduino weighing scale CODE

#define DT A0

#define SCK A1

 

long sample=0;

float val=0;

long count=0;

int WEIGHT=0;

 

unsigned long readCount(void)

{

unsigned long Count;

unsigned char i;

pinMode(DT, OUTPUT);

digitalWrite(DT,HIGH);

digitalWrite(SCK,LOW);

Count=0;

pinMode(DT, INPUT);

while(digitalRead(DT));

for (i=0;i<24;i++)

{

digitalWrite(SCK,HIGH);

Count=Count<<1;

digitalWrite(SCK,LOW);

if(digitalRead(DT))

Count++;

}

digitalWrite(SCK,HIGH);

Count=Count^0x800000;

digitalWrite(SCK,LOW);

return(Count);

}

 

void setup()

{

 pinMode(6, OUTPUT); 

 pinMode(7, OUTPUT);

 pinMode(8, OUTPUT); 

 pinMode(10, OUTPUT);  

pinMode(SCK, OUTPUT);

delay(500);

test();

calibrate();

}

void loop(

{

count= readCount();

int w=(((count-sample)/val)-2*((count-sample)/val));

 WEIGHT = map(w,0,1000,0,255);

 analogWrite (6,WEIGHT);

}

void calibrate()

{

  digitalWrite(7, HIGH);

for(int i=0;i<100;i++)

{

count=readCount();

sample+=count;

}

sample/=100;

digitalWrite(7, LOW);

digitalWrite(8, HIGH);

count=0;

while(count<1000)

{

count=readCount();

count=sample-count;

}

delay(2000);

for(int i=0;i<100;i++)

{

count=readCount();

val+=sample-count;

}

val=val/100.0;

val=val/100.0; // put here your calibrating weight

digitalWrite(8, LOW);

digitalWrite(10, HIGH);

}

void test() {

for (int i=1;i<=255;i++)

{

analogWrite (6, i);  

delay (15);

}

for (int i=255;i>=1;i–)

{

analogWrite (6, i);  

delay (15);

}

}