Make layout and wording tweaks

This commit is contained in:
Joshua Boniface 2024-04-23 17:19:40 -04:00
parent bdef531589
commit 35a30ad21c
1 changed files with 19 additions and 19 deletions

View File

@ -14,7 +14,7 @@ weight = 1
I've been interested in voice-based home automation for many years now; in fact, it was [one of the first posts on this blog](/self-hosted-voice-control/). For many years I now I've used it to control the lights in my bedroom, for two major reasons: first, the lights I was using were not hardwired, and I had many of them, and thus many little switches on cords; second, I wanted to be able to switch things on and off from wherever I was - be it my bed, my couch, or just outside the room as I was leaving - without having to fiddle with all those switches.
So I went with [Home Assistant](https://www.home-assistant.io/), then and now the *de facto* FLOSS standard for home automation. I bought a few smart plugs, from various manufacturers throughout the years (currently settled very nicely on [Athom ESPHome-based ones](https://www.athom.tech/). And I set up [Kalliope](https://github.com/kalliope-project/kalliope) on a Raspberry Pi to do it. And it did work wonderfully.
So I went with [Home Assistant](https://www.home-assistant.io/), then and now the *de facto* FLOSS standard for home automation. I bought a few smart plugs, from various manufacturers throughout the years (currently settled very nicely on [Athom ESPHome-based ones](https://www.athom.tech/)). And I set up [Kalliope](https://github.com/kalliope-project/kalliope) on a Raspberry Pi to do it. And it did work wonderfully for a very long time, with some fits and starts at times.
In the middle of 2023 though, I wanted to expand things a bit. Over the years I had added more smart switches in two other main zones: my garage, where they control an infrared heater, several fans, and several lights; and in my basement, where they control again several fans and lights. So I went looking to buy a few more ReSpeakers and Raspberry Pi's to build out a few more voice control nodes.
@ -24,23 +24,23 @@ But then I checked the Home Assistant blog and boy was I in for a treat!
## The Year of the Voice
The Home Assistant project dubbed 2023 "The Year of the Voice". Their goal was to make voice control the primary focus of their development efforts for the year, and by June 2023 they had made excellent progress, landing one of the most critical features: wake word support. I was immediately intrigued and set about trying to set up an ESP32-based satellite device for Home Assistant. Later in 2023, the support got even better. There's still some flaws - at least, I think they're flaws, though others in the project and community disagree - but I'll discuss those my implementation. The point is, it works, pretty damn well.
The Home Assistant project dubbed 2023 "The Year of the Voice". Their goal was to make voice control the primary focus of their development efforts for the year, and by June 2023 they had made excellent progress, landing one of the most critical features: wake word support. I was immediately intrigued and set about trying to set up an ESP32-based satellite device for Home Assistant. Later in 2023, the support got even better. There's still some flaws - at least, I think they're flaws, though others in the project and community disagree - but it works pretty damn well with a bit of tweaking and hackery.
After some experimenting, I had a working prototype streaming voice to my Home Assistant instance. And then I got an idea.
I had recently seen a Reddit post about the [Everything Presence One](https://github.com/EverythingSmartHome/everything-presence-one), and I thought, why not try making my own, but combining it with this voice control aspect? Thus, the SuperSensor was born.
I had recently seen a Reddit post about the [Everything Presence One](https://github.com/EverythingSmartHome/everything-presence-one), and I thought, why not try making my own, but combining it with this voice control aspect? Thus, the idea for the SuperSensor was born.
## Part One: Finding The Parts
Based on the EP1, I wanted the combined sensor to have the following parts:
Based on the EP1, I wanted the SuperSensor to have the following parts:
1. A microphone. This is pretty much a given for the voice control portion, but I had to find a good option. Luckily support for the INMP441 MEMS microphone is pretty good in ESPHome, and these are what I had used in my tests, so it seemed like the most obvious solution. [Amazon search link](https://www.amazon.ca/s?k=INMP441), since the vendors change fast and both of my orders were different from each other and from the currently available stock. About $3.00 CAD each.
2. LEDs for visual feedback. I'm not a big fan of voice systems that "talk back", and I really liked the ReSpeaker's LED-based feedback mechanism. So I wanted to use LEDs for that purpose here. After a few prototypes, I settled on a design with two RGB common-cathode LEDs which could be driven directly from the GPIOs of the ESP32. I tried using a transistor power delivery system but due to some missing knowledge on my part, they didn't work, and I found that the ESP's GPIO pins could easily drive both LEDs without issue so I went with that. [Amazon search link](https://www.amazon.ca/s?k=5mm+RGB+LED+common+cathode), same situation as the INMP441's. About $0.14 CAD each. I also added a ~300Ω resistor to limit current, though I had these lying around so add ~$0.10 CAD to buy these.
2. LEDs for visual feedback. I'm not a big fan of voice systems that "talk back", and I really liked the ReSpeaker's LED-based feedback mechanism. So I wanted to use LEDs for that purpose here. After a few prototypes, I settled on a design with two RGB common-cathode LEDs which could be driven directly from the GPIOs of the ESP32. Initially I tried using a transistor power delivery system, but due to some missing knowledge on my part and having the wrong kind of transistor, they didn't work, and I found that the ESP's GPIO pins could easily drive both LEDs without issue, so I just went with that. [Amazon search link](https://www.amazon.ca/s?k=5mm+RGB+LED+common+cathode), same situation as the INMP441's. About $0.14 CAD each. I also added a ~300Ω resistor to limit current, though I had these lying around so add ~$0.10 CAD to buy these.
3. A radar sensor. Millimetre-wave radar is absolutely critical for a presence sensor like this, because it allows continuous tracking without motion. I tried 5 different models, but settled on the HLK LD2510C, since it had the best combination of features, configurability, and ESPHome support. [AliExpress link](https://www.aliexpress.com/item/1005006000579211.html) though ensure you select the "LD2410C-P" out of the options. About $5.27 CAD each (including shipping).
4. A PIR sensor. PIR comes in very handy for detecting quick motion, and as a backup both for and against the Radar for initial presence detection. I tried a few options but the SR602 ended up being both the cheapest, nicest form factor, and also best performing of the various options I tried. [AliExpress link](https://www.aliexpress.com/item/1005001572550300.html) but I did replace the Fresnel cover with a cover from [a different sensor](https://www.aliexpress.com/item/1005004518651850.html) that looked nicer and seemed to perform a little better because I had them. About $2.37 CAD each, plus $0.90 CAD each for 10 of the alternates for their covers (including shipping).
4. A PIR sensor. PIR comes in very handy for detecting quick motion, and as a backup (in both directions) for the Radar for initial presence detection. I tried a few options but the SR602 ended up being both the cheapest, nicest form factor, and best performing of the various options I tried. [AliExpress link](https://www.aliexpress.com/item/1005001572550300.html) but I did replace the Fresnel cover with a cover from [a different sensor](https://www.aliexpress.com/item/1005004518651850.html) that looked nicer and seemed to perform a little better, because I had them from my testing. About $2.37 CAD each, plus $0.90 CAD each for 10 of the alternates for their covers (including shipping).
5. A light sensor. While the LD2410C does have "light detection" capabilities, it doesn't actually expose this in a useful way. I wanted a separate light sensor for two main reasons: first, it allows more granular control (e.g. trigger only with presence + lights) for things that are not themselves lights, or for lights in a room with natural light; and second, it can be useful to know how bright the room is for other automations. I originally went with the VEML7700 sensor, but at the time its ESPHome support was subpar, requiring an external custom module that was deprecated. While it is a bit more pricey, I wanted a reliable unit with good ESPHome support, so I went instead with the TSL2591 for the final version. One upside here is that it is able to track infrared light separately from visible light, and though I haven't found an actual use for this yet myself, it might come in handy for someone. [AliExpress link](https://www.aliexpress.com/item/1005005514391429.html). About $6.02 CAD each (including shipping).
@ -54,9 +54,9 @@ All together, to build one sensor the non-board parts cost about $36.39 CAD incl
## Part Two: Designing a Board
Of course, just stringing the parts together wouldn't look very nice or fit very well on a wall, so I designed a custom PCB to integrate all the components using the EasyEDA online builder. I went through two prototype designs before finally settling on a final design that I'm quite happy with. This design sits in a horizontal orientation with the power cord exiting the right side (when facing the unit), which suited all my planned installation points nicely. This could also be used as a guide to create a vertical or flipped horizontal orientation should one so choose. The design is open source (GPLv3 along with the following ESPHome code) and is available in [the Git repository](https://github.com/joshuaboniface/supersensor/tree/master/board) in both DXF and EasyEDA JSON formats. Note that all pictures are of my second prototype and the final design does fix a few flaws I had with it such as removing some unneeded transistor elements and improving a couple traces.
Of course, just stringing the parts together wouldn't look very nice or fit very well on a wall, so I designed a custom PCB to integrate all the components using the EasyEDA online builder. I went through two prototype designs before settling on a final design that I'm quite happy with. This design sits in a horizontal orientation with the power cord exiting the right side (when facing the unit), which suited all my planned installation points nicely. This could also be used as a guide to create a vertical or flipped horizontal orientation should one so choose. The design is open source (GPLv3 along with the following ESPHome code) and is available in [the Git repository](https://github.com/joshuaboniface/supersensor/tree/master/board) in both DXF and EasyEDA JSON formats. Note that all pictures are of my second prototype and the final design does fix a few flaws I had with it such as removing some unneeded transistor points, dropping the second LED resistor, and improving a couple trace paths.
The final result with black silk screening looks fantastic to me, and I love the way the different colours of the individual components are highlighted, as well as hiding the ESP32 behind the unit. In fact, I liked this appearance so much that I abandoned my original plan of designing a case, in favour of the bare board. While this might not suit everyone, I like it in my home, and building a case shouldn't be too hard based on the board dimensions.
The final result with black silkscreening looks fantastic to me, and I love the way the different colours of the individual components are highlighted, as well as hiding the ESP32 behind the unit. In fact, I liked this appearance so much that I abandoned my original plan of designing a 3D-printed case for them, in favour of the bare board. While this might not suit everyone, I like the "DIY PCB" look in my home, and building a case shouldn't be too hard based on the board dimensions.
I was able to order 10 boards for $23.05 CAD shipped, or $2.31 each, bringing the parts total for each SuperSensor to $38.70.
@ -90,48 +90,48 @@ This is the configuration I use for most of my other sensors, i.e. any that trig
What would a DIY post be without pictures? Here's a few!
Here's an overall shot showing both a completed unit and the breakout of all the parts.
![Parts](/images/supersensor/parts.jpg)
Here's an overall shot showing both a completed unit and the breakout of all the parts.
Here is the blank PCB, from both the front and back. As mentioned above this is a prototype board, so while there are some differences from the final PCB, the overall layout is correct.
![Blank PCB Front](/images/supersensor/pcb-front.jpg)
![Blank PCB Back](/images/supersensor/pcb-back.jpg)
Here is the blank PCB. As mentioned above this is a prototype board, so while there are some differences from the final PCB, the overall layout is correct.
As part of testing all the sensors, I made a socketed version. While this makes the unit extremely thick, it might be a good idea to build one of these to test all your sensors before proceeding with the meticulous soldering of all the components to the boards, because de-soldering them later is basically impossible (godspeed to the BME680 sensor that did not make it).
![Socketed PCB](/images/supersensor/socketed-pcb.jpg)
As part of testing all the sensors, I made a socketed version. While this makes the unit extremely thick, it might be a good idea to build one of these to test all your sensors before proceeding with the meticulous soldering of all the components to the boards, because de-soldering them later is basically impossible (godspeed to the BME680 sensor that did not make it).
Here is a completed board, from the front, back, back without the ESP32 installed, and short side. The ESP32 is socketed on the final boards, both to provide good airflow and to allow quick swapping of the "brains" of individual units if needed, but all the sensors are soldered directly to the board to keep the profile low.
![Completed Board Front](/images/supersensor/front.jpg)
![Completed Board Back](/images/supersensor/back.jpg)
![Completed Board Back w/o ESP](/images/supersensor/back-no-esp.jpg)
![Completed Board Side](/images/supersensor/side.jpg)
Here is a completed board, from the front, back, back without the ESP32 installed, and short site. The ESP32 is still socketed, both to provide good airflow and to allow quick swapping of the "brains" of individual units if needed, but all the sensors are soldered directly to the board to keep the profile low.
Here is one of the boards in its final mounted location, angled to provide perfect coverage of my garage. Due to where it sits, I had to bodge a makeshift antenna extension onto this one to get a decent WiFi connection, but it works well and this hasn't been needed for any of my other ones.
![Mounted Board](/images/supersensor/mounted.jpg)
Here is one of the boards in its final mounted location, angled to provide perfect coverage of my garage. Due to where it sits, I had to bodge a makeshift antenna extension onto this one to get a decent WiFi connection but it works well!
Here is all the information and configuration the SuperSensor provides in Home Assistant.
![Home Assistant Dashboard](/images/supersensor/dashboard.png)
Here is all the information and configuration the SuperSensor provides in Home Assistant. It's quite a lot of information, so in my actual dashboards I usually only show the most relevant parts for that particular use-case, for example:
That is quite a lot of information, so in my actual dashboards I usually only show the most relevant parts for that particular use-case, like this one for my garage sensor.
![Room Dashboard](/images/supersensor/room.png)
Finally, a video demonstration of the voice control in action.
Finally, here is a video demonstration of the voice control in action. This shows the LED feedback colours for listening (blue), processing (cyan), and both positive (green) and negative (red) responses in lieu of a voice response.
{{< youtube Uv4u0GrktBM >}}
This shows the LED feedback colours for listening (blue), processing (cyan), and both positive (green) and negative (red) responses in lieu of a voice response.
## Final Thoughts
All in all, I'm very happy with how the SuperSensor turned out. I'm currently using 5 of them in my house (one in my garage, one in my bedroom, and three in my basement), with another 5 either partially- or fully-built and ready to go when I find locations for them (my outside gazebo seating area being an obvious next choice when the weather improves).
As seen above, I've [open sourced both the PCB design and the ESPHome configuration](https://github.com/joshuaboniface/supersensor), as well as provided the parts list, so hopefully you can build one (or several, minimum PCB orders and all) yourself for under $50.00 CAD.
As mentioned above, I've [open sourced both the PCB design and the ESPHome configuration](https://github.com/joshuaboniface/supersensor) under the GNU GPLv3, as well as provided the full parts list with links, so if this design interests you, you can build one (or several, minimum PCB orders and all) yourself for under $50.00 CAD.
I've also ensured that the ESPHome configuration is properly packaged: you can flash a SuperSensor via USB (`esphome run supersensor.yaml` from the repository), then it behaves like most ESPHome-based products: you connect to the broadcasting device WiFi AP to do the initial WiFi configuration, and from there can adopt it into the ESPHome module of Home Assistant to manage it, update it, and reconfigure it as needed. This will also automatically pull ESPHome updates and new configuration changes I make, should I find bugs or add new features.
I've also ensured that the ESPHome configuration is properly packaged: you can flash a SuperSensor via USB (`esphome run supersensor.yaml` from the repository), then it behaves like most ESPHome-based products: you connect to the broadcasting device WiFi AP to do the initial WiFi configuration, and from there can adopt it into the ESPHome module of Home Assistant to manage, update, and reconfigure it as needed. This will automatically pull ESPHome updates and new configuration changes I make, should I find bugs or add new features.
Hopefully this helps you on your home automation journey!