Project tutorial
A Cool Scale

A Cool Scale © GPL3+

This tutorial aims to show how to make a cool scale for your bag using a lilypad and cool plug and wear stuff!

  • 2,307 views
  • 0 comments
  • 0 respects

Components and supplies

Ard lilusb
Arduino LilyPad USB
×1
10 Red LED 5mm
×1
10 Green LED 5mm
×1
10 10k 1/4w resistor
×1
10 1k 1/4w resistor
×1

About this project

1. Schematic

Build the simple circuits posted below! You can use standard AWG wire or the conductive cotton! As you prefer! The black box in the schematic represent the Textile Analog Pressure Sensor.

2. How it works

First of all you have to sew the Textile Analog Pressure Sensor on the handle of your bag (as shown below).

The Textile Analog Pressure Sensor is used in a voltage divider with a 10k resistor and the resulting voltage is read by the Arduino. The voltage divider is empirically calibrated to measure a weight range between 100g and 4kg.

3. Code

The working principle is very simple: based on an analogRead function two LEDs (Green and Red) are driven:

  • the LEDs are both OFF with no load conditions;
  • the Green LED lights up with a weight between 100g and 2kg;
  • the LEDs are both ON with a weight between 2.1kg and 3kg;
  • the LEDs are blinking over 3kg.
/*
Use your Arduino and your plug and wear accessories as a cool scale!
Working principle:
There are 2 LEDs (Green and Red):
- the LEDs are both OFF with no load conditions;
- the Green LED lights up with a weight between 100g and 2kg;
- the LEDs are both ON with a weight between 2.1kg and 3kg;
- the LEDs are blinking over 3kg
BOM:
Arduino lilypad
Textile Analog Pressure Sensor
Conductive wire
1x 10k resistor
2x 1k resistor
1x Green LED
1x Red LED
Approximated reference table:
0g    -> analogRead = 860
557g  -> analogRead = 630
945g  -> analogRead = 550
2121g -> analogRead = 410
4000g -> analogRead = 250
created by Arturo Guadalupi <a.guadalupi@arduino.cc>
*/
const int no = 850;
const int ok = 530;
const int mmh = 410;
const int argh = 330;
const int sensor = A0;
const int greenLED = 5;
const int redLED = 6;
int analogVal;
void setup() {
  // put your setup code here, to run once:
  pinMode(sensor, INPUT);
  pinMode(greenLED, OUTPUT); //green LED
  pinMode(redLED, OUTPUT); //red LED
}
void loop() {
  // put your main code here, to run repeatedly:
  analogVal = analogRead(A5);
  if (analogVal >= no) //no load
  {
    digitalWrite(greenLED, LOW);
    digitalWrite(redLED, LOW);
  }
  if (analogVal >= ok && analogVal < no) //100g < weight < 2kg;
  {
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, LOW);
  }
  if (analogVal >= mmh && analogVal < ok) //2.1kg < weight < 3kg;
  {
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, HIGH);
  }
  if (analogVal <= argh) //weight > 3kg;
  {
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, HIGH);
    delay(150);
    digitalWrite(greenLED, LOW);
    digitalWrite(redLED, LOW);
    delay(150);
  }
}

Code

Code snippet #1Arduino
/*
Use your Arduino and your plug and wear accessories as a cool scale!
Working principle:
There are 2 LEDs (Green and Red):
- the LEDs are both OFF with no load conditions;
- the Green LED lights up with a weight between 100g and 2kg;
- the LEDs are both ON with a weight between 2.1kg and 3kg;
- the LEDs are blinking over 3kg

BOM:
Arduino lilypad
Textile Analog Pressure Sensor
Conductive wire
1x 10k resistor
2x 1k resistor
1x Green LED
1x Red LED

Approximated reference table:
0g    -> analogRead = 860
557g  -> analogRead = 630
945g  -> analogRead = 550
2121g -> analogRead = 410
4000g -> analogRead = 250

created by Arturo Guadalupi <a.guadalupi@arduino.cc>
*/
const int no = 850;
const int ok = 530;
const int mmh = 410;
const int argh = 330;
const int sensor = A0;
const int greenLED = 5;
const int redLED = 6;
int analogVal;

void setup() {
  // put your setup code here, to run once:
  pinMode(sensor, INPUT);
  pinMode(greenLED, OUTPUT); //green LED
  pinMode(redLED, OUTPUT); //red LED
}

void loop() {
  // put your main code here, to run repeatedly:
  analogVal = analogRead(A5);

  if (analogVal >= no) //no load
  {
    digitalWrite(greenLED, LOW);
    digitalWrite(redLED, LOW);
  }

  if (analogVal >= ok && analogVal < no) //100g < weight < 2kg;
  {
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, LOW);
  }

  if (analogVal >= mmh && analogVal < ok) //2.1kg < weight < 3kg;
  {
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, HIGH);
  }

  if (analogVal <= argh) //weight > 3kg;
  {
    digitalWrite(greenLED, HIGH);
    digitalWrite(redLED, HIGH);
    delay(150);
    digitalWrite(greenLED, LOW);
    digitalWrite(redLED, LOW);
    delay(150);
  }

}

Schematics

750x750_5410205d8a9571_uoDJil0M6q.jpg
750x750 5410205d8a9571 uodjil0m6q

Comments

Similar projects you might like

Weigh Objects with an Arduino Scale

Project showcase by Arduinotronics

  • 71,014 views
  • 22 comments
  • 36 respects

Arduino UNO High Precision Counting Scale

Project showcase by Fedeasche

  • 13,341 views
  • 9 comments
  • 43 respects

FizViz - Large Scale Physical Visualizations for Your Stats!

Project tutorial by Team IoT Design Shop

  • 21,087 views
  • 11 comments
  • 87 respects

High Precision Scale with Arduino

Project showcase by mPelectronic

  • 8,706 views
  • 13 comments
  • 37 respects

Arduino-based Digital Scale with HX711 and VFD Display

Project showcase by antiElectron

  • 4,643 views
  • 0 comments
  • 20 respects

Connected Weight Scale Using Sigfox

Project in progress by Polytech Sorbonne - EISE5 - Levert, Maury, Rosanne

  • 1,248 views
  • 0 comments
  • 4 respects
Add projectSign up / Login