Fun fact: I’ve been growing chocolate ghost pepper plants in my office for the past year. Although, due to the oversight of growing these in an office building, I’ve produced plenty of flowers but no peppers because there’s nothing flying around to pollinate them. But, that’s a problem for another day.
One problem I don’t have is maintaining adequate soil moisture. That’s because I’ve built a system using a Raspberry Pi Zero W and some capacitive soil moisture sensors to monitor the soil and change the color of an LED accordingly. Now, my coworkers know to water the plants when they notice a red light. And if they notice a red light along with an annoying sound emitted by a piezoelectric buzzer, they know the helpless office foliage needs water NOW!
After a false start with a defective Adafruit STEMMA Soil Sensor, my friend Tim showed me an awesome Analog-to-Digital converter which converts analog signals to I2C for use with the GPIO pins on the Raspberry Pi. This particular chip has four input channels which paired nicely with the 3-pack of analog moisture sensors I found on Amazon.
Once all the hardware was wired up, I wrote a bit of Python that utilized Adafruit’s ADS1x15 library to query the value reported by each sensor, average them together, and update the LED accordingly. The script is automatically executed by a cron job every minute.
Was all of this really necessary? Absolutely not. But it was a fun weekend project which reminded me that my Computer Engineering degree might have been worth it after all.
|10mm RGB LED [10x]||$3.99||Micro Center|
|ADS1115 16-bit I2C Analog-to-Digital Converter||$6.99||Amazon|
|Capacitive Soil Moisture Sensor [3x]||$10.99||Amazon|
|Piezoelectric Buzzer [3x]||$4.99||Amazon|
|Raspberry Pi Zero Case – Clear/Black||$4.99||Micro Center|
|Raspberry Pi Zero W||$5.00||Micro Center|
Circuit Wiring Schematic
pepperbot2.py source code
Muzei is a pretty awesome live wallpaper app for Android created by Google developers Roman Nurik and Ian Lake. It has an API that allows it to be extended and use custom sources that change throughout the day. I’ve been using it (somewhat ironically) to change my Android wallpaper to the Bing Image of the Day for the past several years. Because sometimes I like to download the artwork and because Muzei makes this really easy with its API, I created a simple Android app called Muzei Saver.
A user recently emailed me with a feature request. Apparently some Muzei source plugins always publish their artwork with the same title/byline. Since the app constructs the filename from this metadata, downloading subsequent artwork would overwrite the previous file.
The user requested that I add a timestamp to the filename. “No problemo”, I thought. Then as I pulled the source code down from GitHub, I realized it was over three years old! A lot has changed with Android since then and this incredibly simple app needed to be rewritten to support modern standards.
The first step was to update the target SDK version from 21 (Lollipop) to 28 (Pie), Gradle from 2.2.1 to 4.10.1, and the Android Studio Gradle plugin from 1.0.0 to 3.3.1. I also took the opportunity to migrate from the old Android Support Library to the new AndroidX namespace. Then, because the old app was written in Java and I’ve since decided that Kotlin is amazing for Android development, I took the opportunity to rewrite it. The app is incredibly simple, so this was trivial. When I did so, I remembered to add a timestamp to the filename, per the original request. 🙂
Finally, I had one more unanticipated hurdle. Android introduced runtime permissions back in API 23 (Marshmallow). Because the app requires the
WRITE_EXTERNAL_STORAGE permission in order to save the artwork to disk, I now had to prompt the user to authorize this permission before saving the file the first time. At this point I was getting slightly irritated, so I pulled in the EasyPermissions library which made this relatively straightforward.
Finally, what I casually assumed would be a one or two line code change resulted in a complete rewrite over the course of an evening. It was a fun exercise, if for no reason than to remind myself how much Android development has changed over the years. And with that, the brand new version 2.0.0 was christened. Check it out for yourself with the links below.
This app provides an Android Quick Settings tile which launches an OpenVPN Connect intent to connect/disconnect a specific VPN profile.
One day I’ll release this to Google Play. Or, even write the actual README file for the GitHub repo. But, in the meantime, here it is.
When running @ 1440p with Ultra graphics settings, on average enabling SLI results in an additional 19 frames-per-second (an increase of 24.7%). Worth it? Even with a 144 Hz G-Sync monitor, probably not.
|GPU 0 Temperature||82° C||80° C |
|GPU 1 Temperature||37° C||67° C |
|Average Frame Rate||77 FPS||96 FPS|
Here’s the fancy output from the game’s built-in benchmark with SLI enabled.
I guess I have a blog now. This is a place mostly for me to document things I’ve done or think are otherwise interesting.
Actually, I’m just copying my friend Tim. He documents his computer builds on his blog.