Weight Measurement (Load Cell and Force-Sensitive Resistor)

EarthWearth: Lulu Wein, Matthew Siegel, Ron Wolf, and Marci Brustman

eToolpage:

Weight Measurement – Load Cell, Force-Sensitive Resistor

The load cell is a small metal bar that is designed to convert the forces placed on it into electrical signals, which can be measured by a computer like the Arduino. Basically, it measures weight. It does this, using variable resistors on both sides of the cell, which measure tension and compression. The signals from these resistors are sent through an operational amplifier (described below) and read by the Arduino.

Source: seeedstudio

The force-sensitive resistor works in the same way, but it is much thinner, longer, and a little easier to use.

Source: Trossenrobotics

These sensors are used mainly in scales, but you could use them for any project where you want to measure force. In our own project, we tried to use them to measure the weight of objects dropped onto a platform in order to separate garbage and recyclable materials. Weight served as the differentiating factor between garbage and recyclable materials. We knew that when we saw heavier readings on the Arduino, garbage had been dropped onto the platform, and when recyclable items like plastic forks were dropped onto the platform, the readings gave much smaller values.

Availability:

Instructions:

The process of wiring and programming the load cell is much more difficult than doing so for the force-sensitive resistor, which is why it is recommended that you use the force-sensitive resistor, if possible. Instructions for both devices are found below.

There is no need to worry about any safety precautions because you will be dealing with low voltages and devices that are very safe! However, it is always a good idea to unplug your Arduino from its power source whenever you are working with it.

Materials:

• Arduino Board
• INA125 chip
• Wires
• Power source (computer, battery etc.)
• Kilo-ohm resistor

The load cell measures the change in voltage when force is applied, so when the voltage values are high, it means a heavier force has been applied.

However, the load cell only outputs a small signal, so in order to actually see how much force has been applied, you have to use an amplifier to boost the signal and make the values larger.

We used the INA125 chip:

• 16 pins, labelled 1-16
• If you hold up the amplifier vertically, with the “INA125” label at the top, the pin numbers on the left side are 1 through 8 from top to bottom
• On the right side, the pins are numbered 16-9 from top to bottom.
• As soon as you begin wiring, disregard pins 13, 14 and 16. They will not be used.

The load cell has four wires, and each one is a different color. Each wire has a different function:

• Red = excitation wire – provides cell with power
• Use alligator clips or breadboard:
• Plug into 5V pin on Arduino.
• Plug into pins 1, 2 (INA125).
• Black = excitation wire – provides cell with power
• Use alligator clips or breadboard:
• Plug into GND pin on Arduino.
• Plug into pins 3, 5 (INA125).
• Pin 12 connects to GND via black wire.
• Green (or yellow) = signal wire – works with amplifier
• Plug into pin 6 of INA125 (amplifier).
• White
• Plug into pin 7 of INA125 (amplifier).

Other wiring steps/information:

• Pin 11 (INA125) = “Sense pin”
• Plug into Analog 0 pin on Arduino.
• Pin 10 also connects to Analog 0 → use alligator clips.
• Pins 8, 9 (INA125) = “Rg pins”
• Connect to each other with a resistor in between
• Resistor color code = brown, black, red (1 kilo-ohm)
• You can move it up or down to change how sensitive it is
• Connect pins 4 and 15 = Vrefout and Vref5

Source: edg.uchicago.edu

Code:

Once you have finished wiring the load cell, it is time to program it! See the “smoothing” code under “Resource Files” below to see how to get started with the load cell’s code. Then, simply adjust the code so that the load cell will function the way you want it to for your project.

Push down on the load cell to see a change in the readings on the Arduino’s serial monitor! Pressing down on the sides yields the most change because of the compression it causes on the load cell. If you need help, consult the diagram below.

https://igcdn-videos-c-17-a.akamaihd.net/hphotos-ak-xtf1/t50.2886-16/11083285_1437285143231097_1738476503_n.mp4

Force-sensitive Resistor:

Materials:

• Force-sensitive resistor
• Arduino Board
• Wires
• Power source (computer or battery pack)
• 1000 kilo ohm resistor

The wiring for the load cell can be a very tedious and frustrating process, so if you are successful with it that is great! If not, there is no need to worry because there is another “load-measuring” option that works just as well as the load cell.

The readings that will be displayed on the serial monitor will change based on how much force is applied to the circle at the top of the force-sensitive resistor. The readings show the voltage between the two outer leads of the resistor. When force is applied, the voltage increases.

Wiring:

• Connect one lead (silver piece at bottom of force-sensitive resistor) to GND on Arduino.
• Resistor between lead and GND – 1000 kilo ohm (brown, black, green)
• Connect other lead to 5V on Arduino.

Force-Sensitive Resistor Wiring:

Source: sparkfun

Code:

Once you have finished wiring the force-sensitive resistor, it is time to program it! See the “smoothing” code under “Resource Files” below to see how to get started with the resistor’s code. Then, simply adjust the code so that the load cell will function the way you want it to for your project.

Working Force-Sensitive Resistor:

Once you have completed all of these steps, push on the circle at the top of the force-sensitive resistor to see a change in the readings printed to the Arduino’s serial monitor.

Resource Files:

We used a few libraries and code samples in our final sketch. Our readings from the load cell and, later, the force-sensitive resistor were very noisy (viz. they varied a lot). Because of this, we couldn’t use the resulting values to differentiate between garbage and recycling, which was what our project aimed to do. We did some research and found quite a few solutions, some from Arduino’s official site and some by enthusiasts. We ultimately settled on one of the official code samples rather than a full-fledged library to keep our code manageable. We also used the standard Arduino library for controlling Servo motors, SoftwareServo, to control our platform’s rotation. Luckily, since both the load cell and theforce-sensitive resistor return easy-to-read analog values from 0 to 5 volts, this code applies to both. Just make sure to check what values your weapon of choice returns using AnalogReadSerial so you know where your readings end up.

Here is the important part of the smoothing code, slightly modified:

1 void loop() {

5   index++;

7     index = 0;

8   average = total / reading_count;

9   Serial.println(average);

10 }