I’ll likely turn this into something that interfaces with my Home Assistant server to control different devices around my house.
The PyPortal has been sitting on a shelf ever since. Way back in February, it caught my eye, and I picked it up, not remembering what it’s capabilities were. Then I started upgrading IKEA air quality monitors and even made my own. Since I’m at the desk in my office a large portion of the week I thought I would make that 2019 prediction come true.
I could show a bunch of data on the screen and the PyPortal has a touchscreen, so I could display buttons for triggering things around the house. The device also has connectors for doing GPIO, so I got the idea of adding an LED strip, which I could use for notifications. I even had a meter long strip of Adafruit Mini Skinny NeoPixels I had bought in 2017 and never touched that would be perfect. I needed to buy a 2.0mm JST PH Connector kit in order to make a wire that would connect to the pack of the PyPortal. I ended up using a piece of Cat6 cable, even though I only needed 3 of the 8 wires inside.
All of this was done back in March. I quickly began having issues with the ethernet cable and the small JST connectors, so I put this post on pause. Figured it was time to finally fix this before the end of the year. While testing, I determined the LED strip got fried up at some point. It was probably some kind of short from the janky wire.
Here’s what my display looks like.
My favorite aspect of the project and code is being able to publish MQTT messages from Home Assistant, which the PyPortal listens for and reacts to. I can send various commands, such as fill:blue, which turns all of the LEDs blue, or whatever color I set. I have commands to chase a color from one side to the other, bounce a color from left to right and back to the left, pulse the entire strip, animate a rainbow, or set the brightness. Since I don’t have another strip of Neopixels, in order to create a demo video, I wired up a 24 LED circle. You’ll have to imagine the effects on the back of my desk, lighting up the wall.
I can manually send these MQTT messages as shown in the demo, but the real power comes from automations. For example, the LEDs automatically pulse blue when the washing machine is done and pink when the dryer is done.
With the different effects and color combinations, the possibilities are endless. What kind of automations would you run?
Over the years, I’ve seen many versions of a shop air filter, made from box fans and 20×20 inch furnace filters. A few years ago I picked up some old box fans on Facebook Marketplace and bought a pack of filters from Sam’s Club. They’ve been stacked in the corner.
It was finally time to build my air filter. I removed the back covers, feet, handles, and knobs from the fans. I got my first look at the switches inside, which are nearly identical.
I’d easily be able to wire the fans together, so I removed the switches and power cords.
I put together a frame from OSB, cut slots to feed the wires through, and screwed the box fans in.
Then I grabbed wood that had been salvaged from a pallet to construct a door.
On the back side, I used glue and brad nails to attach plywood rails. I also made tabs to hold the filters secure.
I attached the door with a couple hinges and made some notched tabs to hold the door shut.
A plastic screw container was a good side, so I used hot glue to secure the boards and then wired up all of the fan connections.
I’m not sure if I’ll ever use the button, but it allows me to cycle between the three speeds and turn it off. The three LEDs show which speed is currently running. The only thing I got wrong was reversing the low and high speeds, which was a quick fix in the ESPHome code. Speaking of the code, here’s mine.
I used Google Gemini to help and it had a great suggestion to track the run time and add a maintenance reminder when it was time to replace the filters.
In Home Assistant I created some automations. My dust collector uses a smart plug, so when it draws electricity, the air filter automatically turns on at high speed. When the dust collector turns off, the air filter continues to run for 15 minutes before turning off. If I had to remember to turn on the air filter all the time, it would rarely happen, so this is amazing.
I’m still on lifting restrictions for several weeks so Brandi helped me install the air filter on the ceiling.
In our basement we have a baby gate, which surprisingly keeps our cat out of the gym and golf sim areas.
Sometimes we forget to close the gate, so I needed a sensor to monitor its state. I still had the breadboard from the air quality monitor project, so it was quick to add a magnetic door switch and test things out with the D1 Mini clone.
I have extra sensors, so those were kept in the project and allowed me to get rid of the shitty DHT22 I added to the golf remote. Everything worked, but I want to save my last two D1 minis and use them for something with the screens I have for them. So I swapped in an Adafruit Feather HUZZAH ESP8266, which I got with AdaBox 3 or 4 in 2017 and made minor changes to the code.
I figured I might as well use one of the fancy Adafruit Perma-Proto boards I had, which makes soldering all of the connections much easier. As a bonus it was nearly a perfect fit for the case.
The magnetic switch and Si7021 will live outside the box, so those couldn’t get soldered yet. After connecting power I checked the ESPHome logs to make sure everything was working.
I cut holes in a project box, finished soldering, and used hot glue to secure the board..
I reversed the swing of the gate, placed my device, and attached the two sides of the magnetic switch to the gate.
In Home Assistant an automation runs whenever the stairs light is turned off to check the state of the gate. If it’s open, a notification is sent to our phones.
I’m enjoying these little electronics projects, and it feels good to finally put various parts to use.
I’ve had this Rigid shop vacuum, from Home Depot, for about 20 years.
At some point in the last year, the switch started having issues. The vacuum would only turn on if the switch was actually pressed in, instead of toggled. I’ve never seen that happen, but I’m guessing it was from the accumulation of dirt and dust getting inside the switch body. Then the switch wouldn’t even push in, so the vacuum wouldn’t run.
I figured it would be an easy switch replacement, so I removed a bunch of screws to take off the cover. Sure enough, the switch had two wires clipped on to it, and was held in place by the case.
I had a perfect replacement, salvaged from some device I don’t remember, in my collection of electronics parts.
It fit like a glove and the vacuum turned on as if it was brand new. I screwed the case back together and called it done.
The upgraded IKEA air quality monitors I did work great, but the LED indication isn’t great for a bedroom and the fan noise was annoying in my office. So I wanted to create a couple of my own devices for those locations. I used:
The SEN50 is a big upgrade over the PM sensors used in the IKEA devices and I used the Si7021 in place of the BME280 I had used because I think they’re a bit better. I soldered 47µF electrolytic capacitors from a big kit I’ve had (similar on Amazon) to the ENS150 modules to improve their power.
Then I attached 5 of the crimped wires to a 6P JST connector, which is what the SEN50 modules require. I’m note sure why buying the actual cable for these SEN50s are so expensive, but I got the entire JST kit for cheaper than a couple of the special cables.
All three sensors communicate with the microcontroller over I²C, so a breadboard test was easy to wire up. The SEN50 does require 5 volts instead of 3.3, so I’m glad I checked.
The ESPHome YAML code is very similar to the code used for the modified IKEA air quality monitors.
The project boxes had some standoffs on the bottom, which I snipped off and then sanded with a rotary tool. I pulled out my box of proto boards and found a size almost exactly double what I needed, so I cut out a sliver and ended up with a piece for each box. I also cut vent holes for the SEN50 sensors.
In order to get everything to fit I decided to put the microcontroller on the bottom of the board. After mocking things up I did all of the soldering. I was hoping to be able to mount everything with connectors so it could easily be taken apart, but there wasn’t enough room and I didn’t want bigger boxes.
I did some continuity testing along the way and everything worked when I connected power. With the boards ready I cut more access and ventilation holes in the boxes.
I soldered the Si7021 on to its wires outside of the enclosure so it wouldn’t be exposed to unnecessary heat and used hot gun to secure everything.
I’m really happy with how these turned out. Here’s a view of the office data on my Home Assistant dashboard.
This was definitely a project where I wished I had a 3D printer to design custom boxes. Some day, when I’m caught up on my project list and can give it proper attention. I know if I get one now I’ll spend a ton of time with it and neglect other projects in my pipeline.
IKEA recently discontinued Vindriktning, their older air quality monitor.
Inside the device, they put a cubic PM1006K particle sensor. I bought three for $16.95 each last year, because I’d seen people hack them by adding sensors and a Wi-Fi microcontroller to send all of the data to Home Assistant. For my modding I bought:
The YouTube video linked above is a great guide to follow. I didn’t connect wires to the fan or the light sensor since I had no use for them. I also didn’t stack my sensors because I wanted the BME280 to be outside of the enclosure, where it would be less affected by the heat produced by the ENS160 and D1.
Even with the sensor outside of the case, the BME280 still reads high, because it heats itself up. I actually tested different lengths of wires and placements of the sensor before realizing I was still going to have to adjust the data. An ESPHome filter made the adjustment easy, which I did individually for each unit after comparing to a mobile Ecobee thermostat sensor. This is the code from the unit for my shop.
Here is how I’m displaying the data on one of my Home Assistant dashboards.
As I was working on this project I knew I wanted a couple more air quality monitors around the house, which will be finished soon.
Update: I’ve had to make a small update by adding a 47uF capacitor to each ENS160 board, because they have power issues, causing the reading to stop for periods of time. My boards matched up with the right ones in the picture at that link. Here’s a picture of another ENS160 I modified, since it was a tight squeeze to made the modification on the devices I posted about here with everything already wired up. I also realized I was powering these through the 3V3 pin instead of VIN, so I fixed that.
I’ve also improved the display of the data on my dashboard by using mini-graph-card.
Several years ago I bought this sign from T.J.Maxx.
When I plugged it in, I was disappointed. By default it was off with a button on the side to toggle between bright, dim, and off.
I put the sign in a display cabinet with all of the LEGO and I had wanted it to automatically turn on with the rest of the LEDs in the cabinet. I never got to it, so it sat on the shelf for years. Fast forward to setting up home automations at the new house and it was time to fix the problem. The only screw on the back was for opening a battery compartment, so I figured the front had to be snapped in. With a little careful persuasion I gained entry.
I figured the electronics were pretty basic and I was right. The quick fix was to connect the sides of the button/switch.
That worked, but I noticed how flimsy all the wiring was. I replaced the wires going from the USB connector to the board, which had been causing some flickering when bumped.
I was sad at the lack of LEDs though. I could do better, with minimal effort. I took out the circuit boards and found an old five volt LED strip.
With the help of some double-sided tape, I wrapped the strip throughout the case and then also used hot glue.
In order to automate the processes of getting the golf sim ready to play and shutting it all down when finished I needed to create a remote control device. I’m using Home Assistant (HA) to run my home smart system (more posts to come), but two things involved with the golf sim aren’t connected to the network:
The projector has an infrared (IR) remote and the light has a radio frequency (RF) remote. I’ve done somethings with IR and still had a stash of IR LEDs (for transmitting) and receivers. I’ve never attempted any RF stuff, so I ordered a 5 pack of 433mhz wireless RF transmitter and receiver pairs.
Since I’m using HA, I let ESPHome handle all of the main programming. All I had to do was wire everything properly and get the configuration correct. I made use of an old ESP8266 NodeMCU microcontroller and worked on the IR aspect of the project first.
When I took the picture I was using a 470Ω resistor, which I eventually switched to 100Ω, to increase the strength of the IR signal. The transistor is a PN2222A. Here’s the ESPHome configuration:
I used the receiver to intercept the codes sent by the projector’s actual remote when pressing the Power, Input, and OK buttons. Then I created some buttons.
It all went very smooth. Next I connected the circuits for the RF components, which was straightforward. Here are the pinouts from the Amazon product page.
I soldered on the antennas (smaller one to the transmitter) and connected everything on the breadboard.
By using examples from the documentation I was able to intercept RF codes.
When I tried to recreate those codes through the transmitter the results weren’t matching up and the spotlight wasn’t responding. It took some trial and error to configure the various parameters of the receiver. Here’s the end result, with the combined configuration for IR and RF.
After using the remote_receiver instances to get the button press codes I needed, I commented out that section of the code. If I ever need to add more functionality to my remote, I can enable the receivers at that point. Here are the button codes for the spotlight.
Then I was able to use both sets of buttons in scripts, which can feed to Alexa for voice commands.
Once everything was tested I wired and soldered a more permanent circuitboard. I included a folded dollar bill for scale.
I was planning to mount it in the ceiling, but the IR was having trouble, because the projector’s receiver faces the ground. Mounting it to the side of the PC cart worked great.
This was a lot of fun!
Update: Less than a week later I’ve already modified it, by adding a DHT22, which reports temperature and humidity. Might as well use that empty D7 pin on the microcontroller.
I have a couple of 5 Ah batteries and both of them stopped charging. They knockoffs from Amazon, with a brand name of Biswaye on them.
One was completely dead and wouldn’t even register on a usual charger. The other showed a defective status. When I put the multimeter on, it read about 15 volts.
This often means some of the individual cells are bad. Before opening it up, I threw it on a Ryobi P119 slow charger, which can sometimes revive cells that are too low for the more complex battery chargers.
After a couple of hours I tried the battery on a regular charger again, but it still showed as defective. So I tore into both batteries, hoping I might be able to get one working battery out of the two.
On the dead battery all 10 cells read zero volts on the multimeter. I wouldn’t be swapping any of those in to the other battery. It’s not safe to try pumping anything into cells depleted that much, so I recycled them at Batteries Plus.
Two of the cells on the defective battery read very low voltages. I don’t have any spare 18650 lithium ion cells and it’s not worth it to buy some since I have enough working Ryobi batteries in my rotation. As a last resort, I put the battery on the little charger to see if it would slowly charge the depleted cells. I had nothing to lose.
I let it go over 6 hours and unfortunately the voltage didn’t jump up on those bad cells, so I still can’t use the battery pack.
Attempts like this don’t always end in success, but it’s a fun opportunity to learn. This battery pack has plenty of good cells, so I’ll save it in case another battery needs replacement cells.
Last week while cutting some walnut with my Ryobi track saw, it kept stalling on me. Turns out the battery was nearly dead because the charger stopped working and the status LEDs weren’t lighting up at all when plugged in.
I opened up the charger and didn’t see burn marks or swollen capacitors anywhere.
Then I found a video on YouTube and sure enough, the resistor at R71 was wide open, reading 152 kΩ on the multimeter.
It’s a surface mount resistor labeled R500, which means 0.5 Ω. I don’t have any resistors that size, so I soldered in a couple of 1 Ω resistors in parallel.
It’s not pretty, but it properly read 0.5 Ω on the multimeter.
I put it back together, plugged it in, and the red LED lit up. Took it down to the shop, put a battery in, and the charger is back in the rotation!