Does privacy really exist?

The other day my wife and I were talking about the Live scan requirement for AB 506 that I’ll have to do as I’m a Scout leader even though I have been live scanned before to renew my EMT certification once. Live scan is done on a per organization/company basis and is a snapshot in time making it somewhat pointless in my opinion.

My wife suggested that the live scan results aren’t shared because of privacy concerns which got me thinking about how much privacy most people can have in today’s society.

Whether you like it or not, you’re being tracked by the government and various companies. For instance, every time you use a credit card, the date/time, location, and name of the vendor is tracked by the credit card company. While it may be to help prevent fraud, they can build a pretty detailed picture of you just based on your buying habits. Likewise if you have a club card at a super market or shop at Costco, you can bet the data is being used to target you for ads.

Many people don’t realize that they’ve accepted this "invasion" of privacy as they have to sacrifice it for convenience. In addition to your shopping habits, if you own your house it does not take much to figure out where you live.

Let’s get into the more subtle ways you’re being tracked. I just read an article the other day how many law enforcement agencies in San Diego county are using License Plate Readers (LPR) which can give law enforcement a decent idea of your driving habits if you happen to pass by the readers (some are on police cars and others may be stationary). LPR is not just used by law enforcement. The University Town Center mall uses LPR in its parking garages so you can exit without having to insert your ticket in the machine. If you frequent the mall, your habits are being tracked.

If you think that your ad blocker and turning off location services on your cell phone prevent you from being tracked, you’re mistaken. Cell phone companies can know which cell towers your phone hits as it is required in order to route calls to you. Do they keep that data and do something with it? I have no idea, but it is quite possible and not just some made up stuff seen in TV shows.

Do you have a car with "connected services" in it? You’re being tracked. While you can ask the company to turn off all services, you lose the ability to have collision notification, vehicle theft recovery and some other features. In order to have the convenience and safety of these features, your location is being tracked. I have no idea what the car manufacturers are doing with this data, but they’re collecting it. Even if you don’t subscribe to the services and don’t explicitly opt-out, they still may collect the data as the cost to keep a live cellular connection in your car is minor compared to what they can do with your data.

Don’t forget about your Netflix or Amazon Prime history. When and where you watch a show along with what the show is can be valuable data that forms a picture of who you are and what you do.

Is there anything you can do about staying private? I suppose you could always pay cash, stop using a cell phone, drive a car without connected services (or rip out the cellular connection), avoid all places with LPR, etc. Is this practical, not really? Does this mean you should just give up on privacy? I don’t think so, but you have to be realistic on what you can control and how much will it inconvenience you.

Personally I’m not going to change my habits, but I am very cognizant of what I post, when I post it (posting stuff on vacation could give a clue that I’m away from home), and how much I share. That’s really all I can do without wearing a tin foil hat and living off the grid.

The Promise of Wireless CarPlay

I’ve been a huge fan of CarPlay for 5 years and can’t imagine a car without it. Lately I’ve been reading about adapters to make wired CarPlay into wireless CarPlay. This sounded perfect as I wouldn’t have to take my phone out of my pocket and still be able to use CarPlay.

There are a number of devices out there that are basically hacks that make a car think that a wired device is plugged in and then have the iPhone talk wirelessly to it. None of how to do this is public knowledge and I doubt the manufacturers got Apple to reveal the secret sauce, so I knew things might not be perfect.

I decided on this device as it was small and supposedly had the latest hardware version. Installation was a breeze and I was amazed that it worked just like wired CarPlay except that there was maybe an additional 15 second startup time. Given the convenience of not having to plug in the phone, I could accept the delay.

I happily used the device for a few weeks on short trips around town and was pretty pleased with it. When we went on a longer trip, the device restarted after about 90 minutes. The dongle was warm to the touch and I suspect a big heat sink would mitigate the problem. In addition to restarting after awhile, the music was sounding garbled. At first I thought it was the streaming connection, but plugged in the phone and the issue went away.

One of the interesting, lesser known features of CarPlay is that if you have a garage door opener connected to HomeKit (I now use OpenGarage connected via Home Assistant, a button will appear on CarPlay when you are close to your house that lets you open and close the door. Why not just use the opener in your car, you ask? My wife has had a lot of problems with the HomeLink connected mirror triggering the door and kept sending me messages to open or close the garage. This feature, however, wasn’t working reliably with wireless CarPlay and I couldn’t pinpoint the problem.

After a bit of thinking about HomeKit and wireless CarPlay, I have a theory. HomeKit, when away from home uses a hub such as an Apple TV or HomePod Mini to communicate. When you’re on your local network, your phone talks directly to whatever device. Wireless CarPlay uses Bluetooth to setup a connection from the phone to the car (or device) and then switches to WiFi for the extra bandwidth. The car (or device) creates a private WiFi network for communication. Normally when apps talk to the network, they’ll try to use the primary interface (WiFi usually) and then failover to cellular if needed. When using wireless CarPlay, the WiFi connection always will fail and have to failover to cellular. This causes some delay and may be a bit unreliable depending on how long it takes to failover. Apple has an option called Wi-Fi Assist that is supposed to handle this automatically.

So while wireless CarPlay is a great feature, the dongle I purchased had some issues, but what really caused me to return it was opening the garage door; I was just tired of pushing the door button and not having it work.

Fixing Display Issues on iPad with HDMI out

Several years ago when Apple released Macs with USB-C connectors, there seemed to be a lot of talk about needing a bunch of dongles to connect things. When I got my first USB-C based Mac, I only had 2 dongles and was content. Over time, I saw various USB-C hubs that had multiple USB-A ports, power delivery, Ethernet and HDMI out. I bought one and used it for everything except the HDMI out as I use an old Thunderbolt Display.

When I bought my 2018 iPad Pro with USB-C, I tried the hub on it, but was told by the support folks that the iPad Pro wasn’t fully supported; I guess the power delivery didn’t work properly. It would have been nice for it to work, but it didn’t really matter to me at the time.

Earlier this year I saw a sale on the Plugable 7-in-1 USB-C hub that had all the ports I’d ever need into SD card slots (I had been working a bit with SD cards at the time, so that seemed convenient). I used the hub with my 2017 MacBook Pro without issues, but never tested the HDMI output as I rarely took my machine anywhere.

Last month we were getting ready to go on a trip and I decided to check the hub to see if I could connect my iPad Pro to our TV in case we wanted to watch a show. The Plugable hub was advertised as iPad Pro compatible, so I had no reason to think it wouldn’t work. When I plugged it in, all the colors were messed up. I plugged in my MacBook Air and it didn’t have any problems.

Messed up display colors

I contacted Plugable’s support and they assured me it was compatible and started going through troubleshooting steps. For our trip, I brought the Plugable adapter as well as my older adapter that didn’t have the same problem. When we wanted to watch a show, I decided to try the Plugable hub and much to my surprise, it worked fine. I sent my findings along with the model number of the TV in our room and thought maybe it was a 4K vs 1080p issue.

When we got home, I tried a few more troubleshooting steps that were recommended to me and didn’t see any change. After much Internet searching, I discovered that when you plug an HDMI display into the iPad Pro, an extra option appears in Displays & Brightness for the display. Under connected displays, there is my TV, the 55R617.

Tapping on the option brought up 3 choices for Preferred Display Setting with the checked one being Dolby Vision. I selected the second option (High Dynamic Range) and boom, the picture problem cleared up!

Preferred Display Setting

I relayed this information to Plugable support and the person I was working with commended me on my sleuthing and said that was exactly the issue as the chipset used in the hub didn’t support Dolby Vision (extra licensing for it) and offered me a refund if I wanted it. I told him it wasn’t necessary (support was great and would definitely recommend their products) as I just wanted to make sure I knew how to work around the issue when I traveled.

Now I can just bring 1 hub for both my iPad Pro and my MacBook Air when I travel and hook up either device to a TV if needed. As long as I remember to bring an HDMI cable (it’s on my packing list), we should be good to watch our own content when we travel.

My Take on the M1 MacBook Air

Years ago Mac laptops were getting so much better every year that I was on a 2-3 year cycle for upgrading my machine. The performance increases helped with my productivity as it reduced compile times for my work. This increase slowed dramatically in the last decade and I stopped buying new machines so often.

When the Retina MacBook Pro was released (2012), I got a fairly loaded one (quad core i7, 16 GB RAM, 512 GB SSD). This machine was a workhorse for me for 5 years. In 2017, I bought a new 15" MacBook Pro that was kind of a mid range machine that was still a quad core i7, but had a higher clock speed. It definitely was faster, but for being 5 years newer, I really had expected more. In any case, I gave my 2012 machine to my wife (she says she doesn’t mind getting older hardware as long as it works; does she really mean it? I hope so!).

For a few years, the 2012 machine has had an indicator saying that the battery needs service, but it can still be used. We’ve ignored that for awhile as it mostly stays connected to power. Two weeks ago, the machine restarted a few times while my wife was using it to teach. My theory was that the battery was on its last legs and when the MagSafe adapter got knocked out, it lost power and restarted. That might not quite be the issue, but started me thinking about what to do with it. We had basically 2 options; option 1 was to replace the battery myself using a battery from iFixit or buy a new computer.

I’ve opened up machines before and replacing a battery should be doable. However, this machine has the battery glued in and was rated as a hard to replace. If anything went wrong, the machine was basically toast. A friend of mine saw a technician replace the battery and advised me against it. Apple put the machine on its obsolete list last year so Apple wouldn’t touch it and authorized repair centers couldn’t get Apple parts for it; so if I wasn’t going to replace the battery, who would? If the battery wasn’t the problem, getting it serviced would be near impossible. It would also be throwing money at a very old computer (9 years is a pretty long life for a laptop).

The second option of buying a new computer was the easier option, but far more expensive. My wife didn’t care if I got a new machine and she got my 2017 machine or if we got her a new machine. I asked a few friends what they would do and the answers ranged from don’t buy an M1 machine now because it is a first generation to loving his M1 MacBook Air. I had shied away from the MacBook Air for me in the past because they had been underpowered and I thought the screens were too small. These days I use an 11" iPad Pro often and don’t use my laptop all that often without it being connected to an external display, so I would be OK with the 13" display and the differences between the Air and the 13" MacBook Pro were relatively minor that I’d save a few dollars by going with the Air.

I decided to get a new M1 based MacBook Air and my wife would get the 2017 machine. While she didn’t care, I justified me getting the new machine thinking that if there were any problems with the M1, it would be better that I had them than she did as the computer is just a tool for her and she doesn’t like futzing with technology.

The machine I picked up was a 16 GB/1TB/8 GPU M1 MacBook Air. Of course I bought AppleCare+ with it as I now buy AppleCare+ on just about every Apple product that is portable. This was the least I’ve spent on a laptop (in raw, non-adjusted dollars) in a long time; did I make the right decision? Would the machine be able to handle my daily work?

After setting up the machine, I worked on getting my projects to build. While they built fine for an iOS device, they wouldn’t build for the iOS simulator due to a different simulator architecture. Unfortunately there are a few 3rd party libraries I use that I don’t have source for and needed a workaround until the libraries are updated. I did a bunch of searching and found the answer:

EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64

That magic line in my project (as well as sub projects) got me going again. A full build of one project on the M1 machine was 42 seconds; on my 2017 machine it was 1 minute 24 seconds. Wow! That’s some pretty impressive performance.

The next part of getting setup was getting a Ruby on Rails project setup. Luckily Homebrew has many packages compiled for the M1, so I installed that, Ruby and some other pieces. Unfortunately it took me about a week to figure out that I had to change the version of a library to the latest as someone committed changes to build on the M1.

I took the machine on a trip last week and I absolutely love the size and weight! Even though it is a lot smaller than my 15" machine, the screen is easy to read. The keyboard is excellent and the machine performs well in everything I’ve thrown at it. While it only has 2 Thunderbolt/USB-C ports, that’s not a problem. I have 1 connected to a Thunderbolt 3 to Thunderbolt adapter for my Thunderbolt Display and the second is connected to a USB-C hub that has a few USB-A ports, SD Card reader and power delivery.

Up until yesterday I hadn’t restarted the machine since I got it, but have had 3 kernel panics since then which is concerning to me. I’m not sure if it is related to the external hard drive I connected to perform a backup or running Cura in Rosetta 2.

As long as the kernel panics stop and performance remains as good or better than my old machine, then I’ll be a happy camper and this will have been a good purchase. When Apple releases new machines with either the M1 or a newer processor, I think they’ll be a hit. However, I’m so taken with the size and weight of the MacBook Air, I might not want to move to a larger machine even if it has better performance.

Another stab at fixing the Vizio SB36512-F6 Soundbar

About a year and a half ago, I wrote about fixing the SB36512-F6 soundbar as sometimes we just couldn’t hear anything from it. My "fix" seemed to work for awhile, but over the last few months, the problems have been worse. We would start a show using Channels or Netflix (primarily) and got no sound. Lately the volume buttons wouldn’t work (through HDMI-CEC) which is also frustrating. Through a combination of powering down the TV, changing the input on the soundbar, and powering off the outlet for the devices, we were able to get sound again.

I’ve been so frustrated with this that I’ve been on the verge of purchasing another soundbar, but waiting for a Costco sale so that I can take advantage of their return policy when it performs poorly. Today I decided to do another web search to see if others encountered the same problem. Unfortunately my original post was one of the hits! On the positive side, other posts indicated that Dolby Atmos was pretty poor on these types of soundbars which gave me an idea.

In order to get Dolby Atmos on the soundbar, I plugged the Apple TV into the soundbar’s HDMI port and then the TV into the soundbar’s HDMI ARC port. If I was willing to forego Atmos, I had more options for connecting the soundbar. Since I like HDMI-CEC for controlling all my devices, I decided to plug the Apple TV directly into my TV and then plugged the soundbar into the TV using HDMI-ARC.

Initial tests show that the setup works as expected with HDMI-CEC working for controlling volume and the power to the devices (I use power loosely as the devices are always in some type of standby mode). Will this fix my problems? I sure hope so or it is back to the drawing board on how to deal with this frustration.

It still baffles me that getting devices that adhere to standards working together is such a crapshoot. I have no idea how the average person gets any type of technology or electronic device to work.

Apple Watch 6 – My Take

When the first Apple Watch came out, I was immediately hooked. I wrote that it did everything I needed it to do. The next few generations of watches didn’t add a huge amount of value to me, so I skipped them. When the Apple Watch 4 came out, I decided to upgrade because it was waterproof, was significantly faster and could run the latest watchOS. I skipped the following year even though the always on display looked like a great feature.

This year with the pandemic, I was unable to goto the pool (last year I swam a lot and used my watch all the time being thankful it was waterproof) so I went back to running. When I run, I take my iPhone and put it in an armband carrier. This has worked well for years, but really started getting on me as I was running on an almost daily basis. When the Apple Watch 6 came out, I was torn. I didn’t need a new watch, but the blood oxygen sensor was interesting, the always on display was something that I didn’t know I really wanted (I’ve been shaking my arm for the last 5 years to get the screen to light up!) and the faster processor would make the watch more usable.

After looking at my usage pattern and selling a bunch of old stuff on eBay to cover the cost, I decided to get the GPS+Cellular version of the Apple Watch 6. Yes, I was going to have to pay an additional $10+fees per month for it, but I’d be freed a little bit from my phone tether.

I can’t say enough good things about this watch; the always on display is absolutely amazing and I can stop shaking my wrist all the time! Running (and walking) without carrying my phone is very pleasant allowing me to still be connected if need be, but not having a phone in my pocket (walks) or attached to my arm (runs). Apple is making huge strides with the processing speed of these watches with each generation. This watch is instantly responsive and Siri on it works very well.

With watchOS 7 comes sleep tracking and I’ve been wearing my watch almost 24/7 because of it. While I didn’t know exactly what my sleep pattern was, I could kind of tell when I didn’t sleep well. My watch now tells me (for the most part) if I had trouble sleeping. This, of course, isn’t exact as it is based on arm movement, but it is much better than not knowing.

Wearing my watch 24/7 causes an interesting problem with battery life. The cellular connection on my watch drains the watch faster than without it, so on days that I run or walk, I have to be aware that I have to charge my watch. In order to make it through the day, I am typically charging my watch in the morning and depending on the day, in the late evening. Some people would say that this is inconvenient, but just dropping it on the charging stand isn’t a big deal.

If I’m as happy with my Apple Watch 6 as I was with my last 2 Apple Watches, it will be another good purchase.

Toyota RAV4 Prime – The vehicle I wanted 4 years ago

When I was shopping for a car over 4 years ago, I had a few requirements including CarPlay and being a plugin hybrid. The plugin hybrid would have been perfect for my needs, but had to have around 40-50 miles of electric range.

Unfortunately I was unable to get a plugin hybrid, but I wouldn’t budge on having CarPlay. At the time, I had a Toyota Highlander and would have jumped at another Toyota, but Toyota dragged their heals on putting CarPlay in their vehicles, so I settled on the Subaru Impreza and was reasonably happy with it. However, as time went on, there were a few things that started getting on my nerves about it. The first was that it was too low to the ground. This, of course, was entirely my fault for making the decision to get a sportier car. The second was some low speed shifting issues that the dealer said were normal, Third was the local dealer; one of the service people was rude and lied to me. There are limited choices for Subaru dealers in close proximity to where I live. The fourth and most annoying problem was the infotainment system and CarPlay. I found that CarPlay wouldn’t always start and required me to reboot the system. I wasn’t the only person that had problems with the system as Subaru settled a class action lawsuit for the issues with it; I walked away with $350 which seems pretty significant for an issue that didn’t physically affect me. On various forums, people have argued that the infotainment system problems aren’t a big deal and that people don’t buy cars just for the infotainment system. Well, I’m not most people! CarPlay and the infotainment system were probably the biggest reasons I went with a Subaru instead of another Toyota.

In August, I wrote about looking for a new car. As much as I wanted to keep my Subaru for as long as I kept my Highlander (14 years), the annoyances I listed above especially the infotainment system, pushed me to long for a new car. My driving habits back when I was looking for the Impreza were pretty similar to before the pandemic whereby a plugin hybrid with 40-50 mile range would be ideal for me. I wouldn’t have range anxiety and could go on longer trips without having to plan charging stops. The RAV4 Prime fit the bill and I searched and searched for months to get one at a reasonable price. Most dealers wanted significantly above MSRP and those that didn’t had no idea when they would be getting what I wanted. However, I didn’t let that deter me.

On Black Friday, I got an alert from cars.com that I had setup and quickly sent an email to the dealer that was 90 miles away. Based on my communications with other dealers, I wasn’t holding my breath, but when I flat out refused his first price, he came down to a reasonable number. I made all the arrangements, packed the family in the car and made the drive up to the dealer. As one last middle finger to me, when I started the Impreza I could not get any volume out of the infotainment system. Luckily my wife was able to futz with it and get sound out of it again!

I’ve now had the vehicle for 5 weeks and driven it in a mix of electric and hybrid modes and like most new car owners, I’m generally pleased with it. Driving electric is amazing as it is quiet and the acceleration is unbelievable, so much so that the Toyota app has told me that I have aggressive acceleration as I’m not even aware that I’m pressing the pedal that hard!

Four years ago, I wanted a compact SUV (similar to my Highlander), plugin hybrid, and CarPlay. I finally have all that in my RAV4 Prime; I would not have thought twice about buying this vehicle if it was out back then.

Time, of course, will tell if I made the right decision and if there are any major problems with it.

A look at UL/ETL Certification and Home Automation

Ever since I can remember, my dad has told me that any piece of electrical equipment that has a cord or is hardwired should be Underwriters Laboratories listed. UL listing means that a sample of the product has undergone testing and meets certain criteria for the type of device it is. Does this mean that items that lack the UL listing aren’t safe? No, it could just mean that the company didn’t spend the money to get the product tested.

Most things you buy with a cord are UL listed, so it really isn’t a concern. However, with more and more products coming direct from overseas and being developed faster and cheaper, it is becoming more common to see mass market products lacking UL listing.

Taking a slight detour here, UL has been the predominant testing lab/certification and the one that most people recognize. However, recently more products bear the ETL mark. Edison Testing Laboratory was started by none other than Thomas Edison and performs similar functions to UL. I’ve done a bit of research and the only real difference is which service a company choses to use. ETL tests to the same standard as UL. I suspect there could be a cost or time to test difference between the two.

I’ve been very cautious about things I buy direct from overseas and even some things I buy here that aren’t from mainstream manufacturers. While a UL or ETL mark doesn’t guarantee that something is going to be safe, it gives me some reassurance that an independent lab has looked at the product.

When I went to purchase a 3D printer, the Creality Ender 3 Pro was advertised as having a UL listed power supply (older ones didn’t). This got me curious about what that meant. Components of products can be UL listed without the entire product being listed; for whatever reason the whole device didn’t go through certification. These components bear a different mark called a "listed component".

So while the power supply on the printer is UL listed, the printer itself is not. I’m not overly concerned about this as the power supply is the piece that connects to 120 V and outputs low voltage. This, of course, doesn’t mean that the printer couldn’t catch fire (I’ve seen reports of this).

For my son’s Eagle Scout project, he’s building something (I’ll post about it when it is complete) that plugs into the wall and is controlled by a low voltage circuit. We found an example of what he wants to do on GitHub where the author posted a list of components. One of the components is a solid state relay that takes line voltage (120V) on one side and is controlled by low voltage on the other. While relays are quite common, mixing low and line voltage can be dangerous. According to the National Electric Code any time low voltage and line voltage are placed in the same electrical box, there must be a plastic separator between the two. When we remodeled our house, I had to find electrical boxes that had separators as I put low voltage audio controls in every room next to the bank of light switches.

Looking at this relay, I didn’t see a UL component mark on it and even if I did, I’d be concerned about putting it in a box that had line voltage and low voltage. So in my effort to help my son (adults can help on projects and he’s asked me to handle the electrical part and some of the electronics due to my knowledge of the field), I started researching parts that are UL or ETL certified so that we didn’t have to worry about mixing line voltage and low voltage. The pieces we’re looking at are widely used in IoT devices and consist of an outlet that can be controlled by a low voltage circuit.

I’ve looked and looked and have found some standalone outlets that are listed. I came across a blog post talking about the Sonoff smart plugs that are UL listed. Excellent, I may have found what I needed. I purchased 2 of the plugs and received them last week. They didn’t have an ETL logo on them, but did have a UL logo on them. Unfortunately looking up the product in the UL database didn’t come up with anything, but it did appear in the ETL database. When I asked Sonoff about this, they said that the S31 was ETL certified and not UL listed. That’s kind of odd and the discrepancy is enough for me to send them back. I did, however, find another outlet TGWF115PQM by Top Greener that is UL listed (and is in the UL database). In addition, this plug was easily flashed with the Tasmota firmware that works with Home Assistant and I believe it will work for my son’s project.

Many of the major brands of IoT devices, including the Belkin plugs don’t list UL or ETL certification on their web pages. If they are listed, I think that would be an important fact to mention on their site. If you browse Amazon for smart plugs, you’ll see some say CE or FCC certification; this is NOT the same as UL or ETL certification. Even if they say ETL or UL listed, I’d strongly encourage people to lookup the products and verify the certifications at UL or ETL.

If you’re in the market for IoT devices, look carefully at the certification on the devices and would not order anything direct from overseas that is line voltage (I ordered a small computer last year direct and the external power supply was not UL listed so I just swapped it with another one that I had just to be on the safe side).

Stay tuned for more on the project and the journey.

Building an Air Quality Sensor

With the recent fires in California, I’ve been concerned about the air quality as it tells me if I should run, if we should go on our daily walk and if we should leave our doors open like we usually do. The EPA uses air quality sensors around the country to collect data and displays them on the AirNow website. These sensors are very expensive and therefore not placed everywhere. The air quality, of course, can differ depending on where you live and the closest EPA sensor to where I live is about 10 miles away. The EPA has started including data from low cost sensors made by a company called PurpleAir in their fire and smoke map.

With someone’s PurpleAir sensor about 0.5 miles from me, I can get a reasonable view of local air quality. Being the tinkerer that I am, I decided to look into the PurpleAir outdoor air sensor. At $279, it was a little out of my “curiosity price range”. After a little research, I was able to determine what parts are in the PurpleAir sensor. It consists of 2 Plantower PM5003 laser particulate sensors, a BME 280 temperature/pressure/humidity sensor running on an ESP8266 board.

I’ve been experimenting with the NodeMCU microcontroller which is based on the ESP8266, so I was already familiar with parts of the setup. I already have an indoor temperature sensor running on a NodeMCU, so adding a second device shouldn’t be that difficult. On my Home Assistant instance, I’m running the ESPHome add on which makes the ESP modules available to Home Assistant. ESPHome has support for lots of devices including the PM5003 and the BME280 which simplifies the software part of the setup.

In addition to purchasing the PM5003, BME 280 and a Wemos Mini d1 compatible board (ESP8266), I purchased a PVC cap to mount it. Total parts cost was about $45. I followed parts of an online tutorial for wiring things up which meant soldering the PMS5003 power to the 5V on the board, the ground on the sensor to the board and the TX line to D4 on the board. For the BME 280, power went to 3V, SDA to D2 and SCL to D1.

Wired Board

After wiring up the board, I used my trusty Ryobi Hot Glue Gun to glue the pieces into the PVC housing.

Mounted components

I then configured ESPHome. The ESPHome configuration is below:

uart:
  rx_pin: D4
  baud_rate: 9600

sensor:
  - platform: pmsx003
    type: PMSX003
    pm_1_0:
      name: "Particulate Matter <1.0µm Concentration"
      filters:
        - throttle: 30s
    pm_2_5:
      name: "Particulate Matter <2.5µm Concentration"
      filters:
        - throttle: 30s
    pm_10_0:
      name: "Particulate Matter <10.0µm Concentration"
      filters:
        - throttle: 30s

  - platform: bme280
    address: 0x76
    i2c_id: bus_a
    temperature:
      name: "Outside Temperature"
      oversampling: 16x
      accuracy_decimals: 1
    pressure:
      name: "Outside Pressure"
      accuracy_decimals: 1
    humidity:
      name: "Outside Humidity"
      accuracy_decimals: 1
    update_interval: 30s

  - platform: dht
    pin: D5
    temperature:
      name: "Outside Temperature Alt"
    humidity:
      name: "Outside Humidity Alt"
    update_interval: 30s

i2c:
  sda: D2
  scl: D1
  scan: True
  id: bus_a

In addition to the BME 280 sensor, I added a second temperature/humidity sensor, the DHT22 so that I can compare results as the BME 280 apparently doesn’t have accurate results as the component heats up itself. (I added the DHT22 after the pictures were taken.)

With the sensor setup in ESPHome, the next part was getting the readings converted into an air quality index (AQI). There are various calculations and corrections used to calculate the index. I stuck to a simple calculation that I found in Jason Snell‘s Scriptable widget that works with PurpleAir data.

I’m a big fan of Node-RED and used that to periodically take the data from the sensors and generate an AQI. In Node-RED, I have it poll the sensor once a minute and then calculate the AQI and then update the Home Assistant sensor

[{"id":"90c83f52.90ab4","type":"poll-state","z":"3c8c01a5.14121e","name":"2.5um","server":"d83da4b3.5bea38","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"60","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":false,"entity_id":"sensor.particulate_matter_2_5um_concentration","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":110,"y":1380,"wires":[["46dfb46e.8c564c"]]},{"id":"46dfb46e.8c564c","type":"change","z":"3c8c01a5.14121e","name":"Set Payload","rules":[{"t":"set","p":"particulate","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":1380,"wires":[["54903d05.bb2a04"]]},{"id":"54903d05.bb2a04","type":"function","z":"3c8c01a5.14121e","name":"","func":"function calcAQI(Cp, Ih, Il, BPh, BPl) {\n    var a = (Ih - Il);\n    var b = (BPh - BPl);\n    var c = (Cp - BPl);\n    return Math.round((a/b) * c + Il);\n}\n      \nfunction getAQIDescription(aqi) {\n\tif (aqi >= 401) {\n\t  return 'Hazardous';\n\t} else if (aqi >= 301) {\n\t  return 'Hazardous';\n\t} else if (aqi >= 201) {\n\t  return 'Very Unhealthy';\n\t} else if (aqi >= 151) {\n\t  return 'Unhealthy';\n\t} else if (aqi >= 101) {\n\t  return 'Unhealthy for Sensitive Groups';\n\t} else if (aqi >= 51) {\n\t  return 'Moderate';\n\t} else if (aqi >= 0) {\n\t  return 'Good';\n\t} else {\n\t  return undefined;\n\t}\n }\n\nfunction getAQIMessage(aqi) {\n\tif (aqi >= 401) {\n\t  return '>401: Health alert: everyone may experience more serious health effects';\n\t} else if (aqi >= 301) {\n\t  return '301-400: Health alert: everyone may experience more serious health effects';\n\t} else if (aqi >= 201) {\n\t  return '201-300: Health warnings of emergency conditions. The entire population is more likely to be affected. ';\n\t} else if (aqi >= 151) {\n\t  return '151-200: Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects.';\n\t} else if (aqi >= 101) {\n\t  return '101-150: Members of sensitive groups may experience health effects. The general public is not likely to be affected.';\n\t} else if (aqi >= 51) {\n\t  return '51-100: Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution.';\n\t} else if (aqi >= 0) {\n\t  return '0-50: Air quality is considered satisfactory, and air pollution poses little or no risk';\n\t} else {\n\t  return undefined;\n\t}\n }\n\n\n\nvar pm = msg.particulate;\nvar aqi;\n\nif (isNaN(pm)) aqi = \"-\"; \nif (pm === undefined) aqi = \"-\";\nif (pm < 0) aqi = pm; \nif (pm > 1000) aqi = \"-\"; \n        /*      \n              Good                              0 - 50         0.0 - 15.0         0.0 – 12.0\n        Moderate                        51 - 100           >15.0 - 40        12.1 – 35.4\n        Unhealthy for Sensitive Groups   101 – 150     >40 – 65          35.5 – 55.4\n        Unhealthy                                 151 – 200         > 65 – 150       55.5 – 150.4\n        Very Unhealthy                    201 – 300 > 150 – 250     150.5 – 250.4\n        Hazardous                                 301 – 400         > 250 – 350     250.5 – 350.4\n        Hazardous                                 401 – 500         > 350 – 500     350.5 – 500\n        */\n\nvar particulateSize;\nvar sensorName;\nvar sensorFriendlyName;\nif (msg.topic.includes('2_5')) { \n    particulateSize = \"2.5\";\n    sensorName = \"aqi_pm_25\";\n    sensorFriendlyName = \"EPA PM 2.5 AQI\";\n\n    if (aqi === undefined) {\n\t\tif (pm > 350.5) {\n\t\t\taqi = calcAQI(pm, 500, 401, 500, 350.5);\n\t\t} else if (pm > 250.5) {\n\t\t\taqi = calcAQI(pm, 400, 301, 350.4, 250.5);\n\t\t} else if (pm > 150.5) {\n\t\t\taqi = calcAQI(pm, 300, 201, 250.4, 150.5);\n\t\t} else if (pm > 55.5) {\n\t\t\taqi = calcAQI(pm, 200, 151, 150.4, 55.5);\n\t\t} else if (pm > 35.5) {\n\t\t\taqi = calcAQI(pm, 150, 101, 55.4, 35.5);\n\t\t} else if (pm > 12.1) {\n\t\t\taqi = calcAQI(pm, 100, 51, 35.4, 12.1);\n\t\t} else if (pm >= 0) {\n\t\t\taqi = calcAQI(pm, 50, 0, 12, 0);\n\t\t} else {\n\t\t\taqi = undefined;\n\t\t}\n\t}\n} else {\n    particulateSize = \"10.0\";\n    sensorName = \"aqi_pm_10\";\n    sensorFriendlyName = \"EPA PM 10 AQI\";\n    if (aqi === undefined) {\n\t\tif (pm > 425) {\n\t\t\taqi = calcAQI(pm, 500, 301, 604, 425);\n\t\t} else if (pm > 355) {\n\t\t\taqi = calcAQI(pm, 300, 201, 424, 355);\n\t\t} else if (pm > 255) {\n\t\t\taqi = calcAQI(pm, 200, 151, 354, 255);\n\t\t} else if (pm > 155) {\n\t\t\taqi = calcAQI(pm, 150, 101, 254, 155);\n\t\t} else if (pm > 55) {\n\t\t\taqi = calcAQI(pm, 100, 51, 154, 55);\n\t\t} else if (pm >= 0) {\n\t\t\taqi = calcAQI(pm, 50, 0, 54, 0);\n\t\t} else {\n\t\t\taqi = undefined;\n\t\t}\n    }\n}\nmsg.payload = {\"aqi\": aqi, \"description\": getAQIDescription(aqi), \"message\": getAQIMessage(aqi), \"particulate\" : particulateSize, \"sensor_name\": sensorName, \"friendly_name\": sensorFriendlyName};\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":560,"y":1380,"wires":[["ba491750.52e4f8"]]},{"id":"ba491750.52e4f8","type":"ha-api","z":"3c8c01a5.14121e","name":"Update Sensor State","server":"d83da4b3.5bea38","debugenabled":false,"protocol":"http","method":"post","path":"/states/sensor.{{payload.sensor_name}}","data":"{\"state\":\"{{payload.aqi}}\",\"attributes\":{\"icon\":\"mdi:chemical-weapon\",\"friendly_name\":\"{{payload.friendly_name}}\",\"description\":\"{{payload.description}}\",\"particulate_size\":\"{{payload.particulate}}\",\"unit_of_measurement\":\"AQI\",\"message\":\"{{payload.message}}\"}}","dataType":"json","location":"none","locationType":"none","responseType":"json","x":800,"y":1380,"wires":[[]]},{"id":"d83da4b3.5bea38","type":"server","z":"","name":"Home Assistant"}]

Having the AQI sensor in Home Assistant allows me to quickly glance and see how bad the air is outside (at this point, I can actually see the poor air!).

AQI Graph

Good air quality is less than 50 and from the graph above, we haven’t seen that in awhile!

I mounted my finished product under a second floor deck which should keep the major rain out of it. PurpleAir recommends not covering the bottom with anything, so I’m going to go with that and see what happens. Having it completely exposed outside isn’t great. It is powered by a PoE to USB adapter as I had Ethernet going outside there anyway.

Final mounting

The AQI data is interesting and is actually useful in telling me how much physical activity I should do. Other pieces of data I collect are neat, but not all that useful.

Searching for a new car

Several years ago I was in the market for a new car. I really wanted a PHEV (plugin hybrid electric vehicle) as most of my driving is around town, but I’d have the flexibility to go on longer trips. At the time there weren’t many choices that interested me. I test drove an Audi A3 e-tron and while it was a nice little car, it didn’t have CarPlay. After Apple introduced CarPlay, I knew that I had to have it on my next vehicle as I never wanted to update the maps in the navigation again and with annual iOS updates, I knew that I’d get tweaks to the system every year which I’ve come to expect.

I continued my car search and was looking for either a compact SUV or a hatchback/wagon/5 door that had OK gas mileage, some technology and of course, CarPlay. My options were quite limited and I found the 2017 Subaru Impreza. At the time, Toyota wasn’t onboard with CarPlay, so I’d have to leave Toyota. On paper, it had everything I wanted (except PHEV). The price was right and I purchased one right when a local dealer got it. While the car isn’t a sports car, I enjoy using the paddle shifters sometimes and the car has performed OK. It was the first model year on a new platform and has had some problems (6 recalls at the last count). The car has enough room to go camping (I’ve downsized our camping equipment and am strategic about what we bring) and we’ve used it on a few road trips. I went from a Toyota Highlander to the Impreza, so I lost a bit of room.

As I mentioned earlier, CarPlay was a requirement for me and I’ve written about it before. Unfortunately, the infotainment system in the car has been the biggest disappointment for me. Early on, CarPlay wouldn’t always start and required me to figure out how to reboot the system which sometimes doesn’t work. There have been a number of software updates each requiring me to take it to the dealer. It has gotten better, but there are still times when the system won’t boot or I have to reset it. There has even been a class action lawsuit about the system. Some people on various forums ask if others bought the car just because of the infotainment system or they are overreacting; I actually did purchase the car because of the infotainment system and would have looked elsewhere.

Other than the infotainment system, the car has functioned adequately; my new car excitement has worn off and it is just a car. I’ve had an issue with low speed shifting, but the dealer says that it isn’t a problem. With only a few Subaru dealers in San Diego, taking it to another one for service isn’t a feasible option to get a second opinion.

The car still serves its purpose and has pretty low mileage on it, but right before the world got turned upside down this year, I saw that Toyota was coming out with a PHEV RAV4. After reading about it, I knew that this is the car I would have purchased if it had been out a few years earlier. The waiting game began once I had my heart set on replacing my car!

As I’ve written about before, dealers are charging huge markups and supply is limited on the RAV4 Prime, so I wait. I’d really like to get this vehicle before the federal tax credit runs out because it will be a lot less attractive at $7,500 (+ local incentives) more.