티스토리 뷰

Technology/Arduino

Pressure Module Control

캡틴테크 2018. 1. 29. 23:30
반응형



Today, I would like to describe how to check the weigh using pressure module. Once I had researched what kind of pressure modules are often to use.

* Piezo buzzer

First and for most, piezo buzzer is useful to check pressure from a user. When a user knocks to the sensor module, it will be detected and get the signal. We can utilize the sensor data to express like lighting led and on. As well as, the piezo buzzer makes some sound according to pressure. Therefore, It would be 'touch sensor'. If you search the google, you can find proper site to get much information. I would share the link to follow it.

https://kocoafab.cc/tutorial/view/461

Arduino will receive sensor data from analog pin and it'll be coded like the blow.

const int knock = A0; int sensorVal = 0; void setup() { Serial.begin(9600); } void loop() { // If the value is under 3, it will not be worked while ((sensorVal = analogRead(knock)) < 3) { } //If the value is over 3, it will be printed Serial.print(sensorVal); Serial.println(" knock"); //a part of making sound tone(knock,2093,100); delay(250); //After stoping the sound, change input mode. noTone(knock); pinMode(knock, INPUT); 

}

* Loadcell

My goal is to get around 500 g in order to make solution whether a person drinks a cup of beer or not. Piezo is pretty good to use, but it is less capacity to check the weight so, I have researched again to find proper pressure sensor module. 

The picture indicates load cell to measure up to 500 g. I had placed an order in Aliexpress to check functionality. Even though it takes longer than buying in Korea, It would be much cheaper. So that I decided to buy it in Aliexpress. As well as I bought the amplifier to get data from load cell which is called as 'HX711'

The thing is, load cell is required to connect 4 line between load cell and amplifier board. The board would be connected to the Arduino with 4 lines including VCC and GND. After checking the circuit how to make the entire connection from Load cell to Arduino and then design the out of shape how to install load cell to check the weight. Here is the first sample. I am not sure what a type of share is fitted. In the long run, It should be upgraded. Currently, the size of shape is a little bit bigger than I expected. But I had started to print from 3D printer.

Let's assemble it together.

There is a gap between upper side of shape and bottom side of shape. It should have reduced in order to make compact size. But it's okay, I am convinced that It should be upgraded in no time. The code is referred to Sparkfun's reference site. Therefore, I do not post it to explain, If It is needed, I would describe it later. Also, There is a few things to do more like how to deal with the line from the board and sensor. All things should be hided to be clear when people see the product. Here is the GitHub to take the library and sample code.

https://github.com/sparkfun/HX711-Load-Cell-Amplifier


반응형
댓글