Read PMS5001 or PMS7001 data from Android

Pawit Pornkitprasan
1 min readJan 13, 2019

--

I’ve recently got a PMS5001 air quality sensor to detect the air pollution in Bangkok which has gotten bad lately. It communicates via 3.3V TTL and thus a USB to UART adapter must be used to read data from it (I use the CP2102). To facilitate using this sensor outside, I wrote a simple Android app which connects to the adapter via USB-OTG.

I haven’t touched Android app development in a while and I’m surprised at how well USB-OTG works in Android. The Java application can get direct access to the USB device and use a Java-based driver to communicate with it. Thus, even if the device’s kernel doesn’t have support for CP2102, it doesn’t matter! This allows this application be to root-less and allows it to work any device that supports USB-OTG.

You can find the application on the Play Store and the source code on GitHub.

--

--

Responses (1)