Atmospheric Pressure Measurement Using XinaBox XChips
by dsberman in Circuits > Arduino
11 Views, 0 Favorites, 0 Comments
Atmospheric Pressure Measurement Using XinaBox XChips

Create a project that measures the atmospheric pressure in under 20mins using XinaBox xChips.
Things Used in This Project
Hardware components
- XinaBox SW01 x 1
xChip Temperature, humidity and atmospheric pressure sensor based on the BME280 from Bosch. - XinaBox PU01 x 1
xChip USB (Type A) Power Supply - XinaBox IP01 x 1
xChip USB Programmer based on FT232R From FTDI Limited - XinaBox OD01 x 1
xChip 128x64 Pixel OLED Display - 5V USB Power Supply x 1
Power Bank or similar product - XinaBox XC10 x 4
xChip Bus Connectors - XinaBox CC01 x 1
xChip version of Arduino Uno based on ATmega328P
Software apps and online services
- Arduino IDE
Development environment for programming
Story
Introduction
I built this project to measure the atmospheric pressure in my location with the SW01 multi-functional sensor. It can measure temperature, atmospheric pressure, humidity and altitude. I've used an ATmega328P based xChip, the CC01, coupled with the sensor and an OD01 OLED display to complete the project.
Download Necessary Files
You will need the following libraries and software:
- xSW01 - Multi-functional sensor
- xOD01 - OLED display library
- Arduino IDE - Development environment
Click here to see how to install the libraries.
Once you've installed the Arduino IDE, open it up and select the "Arduino Pro or Pro Mini" as the board to upload your program to. Also make sure the ATmega328P (5V, 16MHz) processor is selected. See image below.
Select the Arduino Pro or Pro Mini and the ATmega328P (5V, 16Mhz) processor
Assemble
Click the programmer xChip, IP01, and the ATmega328P based CC01 xChip together using XC10 bus connectors as shown below. In order to upload to the CC01 you'll need to place the switches in the 'A' and 'DCE' positions respectively.
IP01 and CC01 clicked together
Next, combine the sensor, SW01, and the OLED display, OD01, as shown below. Simply click them together. It's impossible to get it wrong.
Assembly in order to program
Program
Insert the unit into the USB port on your computer. Download or copy and paste the code below into your Arduino IDE. Compile and upload the code to your board. Once uploaded your program should start running. You may read the comments within the code to grasp the syntax. The below image shows the atmospheric pressure once the upload has completed.
Observe the atmospheric pressure once you've uploaded
External Power Source
Remove the unit from your computer. Disassemble the unit and reassemble it using PU01 instead of IP01. See below.
Final assembly not powered up
Now take your 5V USB portable power supply such as a power bank or similar and insert the new assembly into it. You can now observe the atmospheric pressure on the OLED display and measure the pressure in any location.
Complete project powered on
Conclusion
This project took under 10min to assemble and another 10min to program. The xChips just click together making it very convenient.
Code
Pressure_display.ino Arduino
Simple code to indicate atmospheric pressure on an OLED display.
#include <xCore.h> // include core library for xCHIPS #include <xSW01.h> // include pressure sensor library #include <xOD01.h> // include OLED display library<br><br>xSW01 SW01; float atm_pres; // variable containing the pressure void setup() { // put your setup code here, to run once: // initialize pressure variable to 0 atm_pres = 0; // start i2c communication Wire.begin(); // start pressure sensor SW01.begin(); // start OLED display OLED.begin(); // clear display OD01.clear(); // delay for normalization delay(2000); } void loop() { // put your main code here, to run repeatedly: // read pressure constantly SW01.poll(); // retrieve pressure and store it atm_pres = SW01.getPressure(); // print pressure on OLED display OD01.set1X(); OD01.println(" ATMOSPHERIC PRESSURE"); OD01.println(""); OD01.set2X(); OD01.println(""); OD01.print(" "); OD01.println(atm_pres); delay(5000); // update display every 5 seconds }