Crowtail-Weight Sensor

From Elecrow
(Difference between revisions)
Jump to: navigation, search
(Usage)
(Usage)
Line 23: Line 23:
 
[[File:connection of Crowtail-Weight Sensor.jpg |600px]]
 
[[File:connection of Crowtail-Weight Sensor.jpg |600px]]
  
2.Download the [http://www.elecrow.com/wiki/index.php?title=File:SparkFunHTU21D.zip  HTU21D Humidity&Temperature Sensor] Library. Unzip and put it in the libraries file of Arduino IDE by the path: ..File/arduino IDE/Arduino/library/SparkFunHTU21D. You can also copy the following program to Arduino IDE and upload to your Arduino/Crowduino.  
+
2.Download the [http://www.elecrow.com/wiki/index.php?title=File:hx711.zip  hx711] Library. Unzip and put it in the libraries file of Arduino IDE by the path: ..File/arduino IDE/Arduino/library/hx711. You can also copy the following program to Arduino IDE and upload to your Arduino/Crowduino.  
 
<BR>
 
<BR>
  
3.Open “SparkFunHTU21D” example:
 
 
<pre>
 
<pre>
  
#include <Wire.h>
+
#include "hx711.h"
#include "SparkFunHTU21D.h"
+
  
//Create an instance of the object
+
Hx711 scale(SCL, SDA);
HTU21D myHumidity;
+
 
 +
void setup() {
  
void setup()
 
{
 
 
   Serial.begin(9600);
 
   Serial.begin(9600);
  Serial.println("HTU21D Example!");
 
  
  myHumidity.begin();
 
 
}
 
}
  
void loop()
+
void loop() {
{
+
  float humd = myHumidity.readHumidity();
+
  float temp = myHumidity.readTemperature();
+
  
   Serial.print("Time:");
+
   Serial.print(scale.getGram(), 1);
  Serial.print(millis());
+
   Serial.println(" g");
  Serial.print(" Temperature:");
+
  Serial.print(temp, 1);
+
  Serial.print("C");
+
  Serial.print(" Humidity:");
+
  Serial.print(humd, 1);
+
   Serial.print("%");
+
  
  Serial.println();
+
   delay(200);
   delay(1000);
+
 
}
 
}
  
 
</pre>
 
</pre>
4.Upload it into your Arduino board and open the serial monitor to observe the temperature and relative humidity information of the environment.
+
4.Upload it into your Arduino board and open the serial monitor to observe the weight information after put things on the weighting pan.
  
[[File:result of HTU21D Humidity&Temperature Sensor.png |400px]]
+
[[File:result of Weight Sensor.png |400px]]

Revision as of 08:27, 10 February 2017

Description

The Crowtail-Weight Sensor uses 24-bit high-precision A / D converter chip HX711, is a high-precision electronic design, with two analog channel input, the internal integrated 128-fold gain programmable Amplifier, the pressure signal into analog voltage signal after the AD module to enlarge to digital signals. The input circuit can be configured to provide bridged bridge-type (such as pressure, weighing) sensor mode, is an ideal high-precision, low-cost sampling front-end module; module output four lines,

Model:Sensor-p-1229.html Crowtail-XXXXX

400px

Specification

  • Weighing pan size: 10cm × 7cm.
  • Operating voltage: 5V.
  • Maximum range: 5Kg.
  • Total height (including pillars): 3.5cm.
  • Measurement accuracy: not more than 1g.

Usage

This demo is going to show you how to read weight information from this Crowtail-Weight Sensor.

1.Hardware Connection
The Crowtail-Weight Sensor is connecting to I2C port of Crowtail - Base Shield.

Connection of Crowtail-Weight Sensor.jpg

2.Download the hx711 Library. Unzip and put it in the libraries file of Arduino IDE by the path: ..File/arduino IDE/Arduino/library/hx711. You can also copy the following program to Arduino IDE and upload to your Arduino/Crowduino.


#include "hx711.h"

Hx711 scale(SCL, SDA);

void setup() {

  Serial.begin(9600);

}

void loop() {

  Serial.print(scale.getGram(), 1);
  Serial.println(" g");

  delay(200);
}

4.Upload it into your Arduino board and open the serial monitor to observe the weight information after put things on the weighting pan.

Result of Weight Sensor.png

Personal tools
Namespaces

Variants
Actions
Elecrow Store
Navigation
Elecrow Products
Toolbox