Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
About a year ago I wrote about how to measure the air quality with a Raspberry Pi and a cheap sensor. Make sure to read that article first! Weâve been using this setup in our school and privately for a few years now. However, this project has one disadvantage: it is not portable, but depends on a WLAN network or a wired network connection. You actually cannot access the measurements if the Raspberry Pi and the smartphone or computer are not in the same network. Thatâs why some time ago we added a small screen to the Raspberry Pi so that you can read the values directly from the device. How to set up this screen for our mobile fine particulate matter sensor and which additional configurations are necessary, I would like to describe in this article.
Setting up the screen for the Raspberry Pi
On Amazon or AliExpress there are different displays for the Raspberry Pi. These range from ePaper screens to LCDs with touch function. We chose a 3,5âł LCD with touch, that has a resolution of 320Ă480 pixels (model MPI3501). You can simply plug this screen onto the GPIO pins. It costs only 10â20$. Itâs also nice that a 3,5âł display is about the same size like a Raspberry Pi.
If you put on the screen and start the Raspberry Pi, the screen stays white. That normal, because the driver is missing. You have to install the appropriate drivers for the display first. To do this, log in via SSH and execute the following commands:
$ rm -rf LCD-show $ git clone https://github.com/goodtft/LCD-show.git $ chmod -R 755 LCD-show $ cd LCD-show/
Depending on the screen model you have to execute the appropriate command to install the drivers. In our case (for the model MPI3501):
$ sudo ./LCD35-show
This command installs the appropriate drivers and then restarts the Raspberry Pi.
Installing the Pixel Desktop and Setting Up Autostart
Here is what we want: if the Raspberry Pi boots up we want to display our small website with the measurements. So first you have to install the pixel desktop environment (if you have used Raspian Lite before)Â with
$ sudo apt install raspberrypi-ui-mods
Then the Chromium browser (we need it to display the website):
$ sudo apt install chromium-browser
By default, the autologin is not configured for the user âpiâ. However, this is necessary so that the measured values can be displayed directly after the start. Otherwise you will only see the login screen. You can configure the autologin with the raspi-config tool:
In the menu select 3 Boot Options â B1 Desktop / CLI â B4 Desktop Autologin.
There is one step missing to start chromium right after bootup with our website. Create the folder /home/pi/.config/lxsession/LXDE-pi/:
$ mkdir -p /home/pi/config/lxsession/LXDE-pi/
Then create the autostart file in this folder.
$ nano /home/pi/.config/lxsession/LXDE-pi/autostart
and paste the following code:
#@unclutter @xset s off @xset -dpms @xset s noblank
# Open Chrome in full screen mode after boot@chromium-browser â incognito â kiosk http://localhost
If you want to hide the mouse pointer, you have to install the package unclutter and remove the comment character at the beginning of the autostart file:
$ sudo apt install unclutter
Since I made a few small changes to the code last year, it is recommended to re-download the script and the files of the AQI website (see the original article for how to do this).
Conclusion
With the touch screen added you now have a mobile particulate matter sensor! We use it at our school to check the quality of the air in the classrooms or to do comparative measurements. With this setup, you are no longer dependent on a network connection or WLAN. You can use the small measuring station everywhereâââwith a power bank even independent of the power grid.
Originally published at openschoolsolutions.org.
How to Build a Mobile Particulate Matter Sensor was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.