M5Stack AirTube Unit
2022-07-05 | By M5Stack
License: General Public License Air Pressure Arduino
* Thanks for the source code and project information provided by @AJB2K3
Things used in this project
M5Stack Core2 ESP32 IoT Development Kit
M5Stack Air Pressure Unit
Software apps and online services
M5Stack Tube/ Air Pressure Sensor.
In this guide I will show you how to use the M5Stack tube air pressure sensor which just happens to be compatible with Lego Technic Pneumatic range of products.
The M5Stack Tube Pressure sensor is an analog device built around the MCP-H10-B200KPPN that needs to be connected to Port B of the Core2. The sensor can measure between -100 and +200Kpa with a resolution of 15Kpa and outputs a voltage between 0.1 and 3.1V depending on the air pressure it senses.
The air inlet tube is just the right size to fit Lego Technic Pneumatic tubes and so perfect for use with Lego technic projects.
Assembling the test bench.
You can find downloadable instructions for the test Bench at this link but the hoses are not shown due to a limitation of the software used to draw the instructions.
The M5Stack components are also not shown as only Lego parts exist in the program's catalog.
The one end of the hose is connected to the sensor and the other end to a technic "T" piece. From this, a tube connects to the pump and then to the flow switch. Two more tubes connect to the flow switch to the piston to control the position of the end.
Programmingin UIFlow.
When it comes to programming or reading the sensor in UIFlow we only have two blocks available to use.
The Get Pressure block is used to return the pressure in Kpa.
Whereas the Get ADC Raw Value block is used to display the voltage read by the Core2's ADC pins.
The following example will show the Pressure and ADC values on the Core2's screen.
One of the possible uses for this is to make a compressor that automatically pressurizes a Lego air tank if the sensor pressure reading drops too low.