This Guide is part of my upcoming book Prototyping with Lego, M5Stack and UIFLow Expected December 2022.
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 analogue device but 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 programs catalogue.
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 tube connect to the flow switch to the piston to control the position of the end.
Programmingin UIFlow.
When it come 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.
Where as 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 pressurises a lego air tank if the sensor pressure reading drops too low.
Comments
Please log in or sign up to comment.