Anyone got any ESP projects?

Eric

local maker
Staff member
So I wasn't able to dive down the Home Assistant rabbit hole without learning about ESPhome as well. After reading about ESPs I was blown away, I haven't really messed with development boards since arduinos were the hot thing so this quite a leap in tech for these small project needs. I have been using raspberry pi 4, 3, and pi zeros w and w2 but the ESP form factor is really tiny and workable for smart home projects. More importantly they are still available at an affordable price, it maybe another few years before raspberry pis are back to normal prices but I can get a ESP8266 board for about $5-7 depending on the quantity and source.

I am going to start pretty basic, my goal is a wifi connected IOT device that will send temperature and humidity data to home assistant. There are commercial devices that do this of a wide variety but I suspect this way will be more fun and offer many opportunities for difficulties and problems to solve and I love a puzzle.

Here is the listing I used for my ESP boards, they are already here:

I am then planning to use them with these breakout boards for temp and humidity which should arrive today:

$6 per temp and humidity board is a little expensive for what it is, I think costs and size could be cut down by replacing it with a little Texas instruments temperature probe where I don't need humidity data. It's been a while since I went component shopping but something like a DS18B20 is usually pretty cheap and easy to weatherproof on your own. They also sell really nicely waterproofed ones in stainless steel and plastic housing which would be great for aquarium and wet location monitoring though there are no cost savings there as they are usually about $8 each.

I would love to hear any discussion or thoughts about these little boards or any projects anyone else has/is working on.
 
I haven't looked into ESPhome, but that kind of looks like DIY Home Assistant sensors, huh? That's pretty cool. I've been thinking of taking my UPB switches connected to a trial HA setup, but the fact that it really only inputs my existing config file and can't make programing changes to the system is kind of a bummer, but shouldn't really limit it's capabilities in the long run.

I'm sure that if anyone has any cool home automation scenes or actions, this would be a cool place to share them.

BTW, how to plan on powering these temp sensors? Are you placing them in-wall or ceiling, or is this just a test?
 
I'm not familiar with UPB, are those all connected to a central hardwired controller? I'm curious what that would look in home assistant. It sounds like the home assistant compatibility with UPB was fairly recent though so maybe there will be some updates to that project could help with control if it's not a hardware limitation?

I think we definitely need some Smart Home, IOTT, home automation threads in here, there is a lot of the hackerspace spirit in those projects!

For power I am going to try to go with just USB connections where the locations permit but my reading suggests that a 9v battery would also be sufficient. I might go with LiFePO4 cells if a longer run time is required. I'm mainly thinking of temperature monitoring right now but I definitely will want to check out other sensors after I get the hang of these. It looks like there a lot of fun options on the ESPhome website and I could definitely see using some other motion detection sensors to control lighting or other automations.
 
Oh man, ESPhome is one of those things I need to stay away from, lest I go down a rabbit hole and ignore my other projects :). I currently have:
  • One hanging from the bottom of my desk. Currently it only runs an individually-addressable light strip, which does flashy lights in one pattern and collect temp/humidity data (which is then summarily ignored), but "some day" I'll add:
    • height sensors (it's an adjustable desk). I don't know what I'll do with this yet, but I had the ultrasonic sensor 🤷‍♂️
    • an occupancy sensor. This also uses an ultrasonic sensor, with the goal of automatically controlling the under-desk lights when they're likely to be seen.
    • a light sensor. This will eventually control the lighting under my desk, behind my monitors, and my ceiling light (which uses a Kasa smart dimmer)
  • One hanging from the back of my monitors. It only controls the bias lighting behind the monitors with two individually-addressable light strips. "Some day", it'll tie in with the one in the next bullet point and automatically adjust the lighting based on what I'm currently doing.
  • One on the wall outside of my office. It has 3 color-coded LEDs and an epaper screen in a 3d-printed case. It changes colors and shows a message notifying the wife and the boy if I'm playing, working (i.e., "come in but I'll be distracted") or in a meeting (i.e., "if you come in, you'll be on camera"). "Some day", the script that controls that will also adjust various office lights so I can set up for gaming or a call with one button press
  • One hanging from a shelving unit in my lounge. It uses an IR sensor to detect when someone walks by, and lights up the different cabinet spaces (like this, but each cabinet spot is a random color). There's a switch that toggles between "do nothing", "slowly fade to different random colors", and "quickly fade to different random colors"
  • One in my server cabinet. It has a temperature sensor and a switch, and when the cabinet gets too hot, if the switch is on, it spins up 4 fans I installed on the cabinet. "Some day", it'll work with the temperature from the desk sensor, and will turn on if the rack is n degrees hotter than the rest of the office.
My next projects are:
  • E-paper screens that sit on the cat/dog food containers with ultrasonic sensors poking in, and they a) tell you the last time the bin was opened (no more double-feeding the dog!) and b) tell you when the food is low. Related, let me know how battery power works; I'm looking at using LiPo cells for these, but haven't spent any time researching it.
  • A scale-based meter for my kegerator that uses an epaper screen to show what beer is on tap and how much is left (this is.... not a near-term project lol)
All of these are running on ESP32s; I haven't messed with ESP8266s because the cost difference is negligible for what I'm doing, and I gain a few extra pins and a bit of horsepower.
 
Last edited:
@Eric to your point of the components being expensive, you can find them cheaper if you shop around a bit, but I would recommend finding a part you like and sticking with it. Most everything is pretty well supported, but sometimes it's a real pain in the butt getting a new part to work. It might be worth the $3 difference to just copy code you already know works. Also, related, that lets you do fancy things like create library files and just include them when you need temperature support on a project.

Let me know if you get to the point of includes/variables/etc and I can share some of my repos.
 
I'm not familiar with UPB, are those all connected to a central hardwired controller?
Yep, they are Universal Powerline Bus switches and switched power boxes. The cool part is that there is no wireless, so no interference or hijacking, and you program each switch to do what it needs to do, so you don't need a computer after uploading the programming to the switch. You just tap up 5 times really quickly to put in programming mode, or address it using the UPStart software they have for it.

Another cool aspect of these is that they are... Universal! You swap out your normal overhead light switch with a UPB switch, and you automatically get dimmer action, and you can set it to remember the last level it was set at for the 'on' level. You can have it fade out when you turn off the switch. You can add lights to 'scenes' and control multiple lights from a single switch

But the real killer app is changing the face plate and adding another rocker to the same switch box, or four, or two switches and 4 or 8 buttons for scenes. It's amazing! I _never_ used the overhead light in my 'media room' until I could dim it a bunch, and also use the same switch to turn on several lights, or just a few, or a few lights and the AV receiver, which now turns on the TV by itself. Simply Automated makes a decent line for a decent price per switch.
For power I am going to try to go with just USB connections where the locations permit but my reading suggests that a 9v battery would also be sufficient. I might go with LiFePO4 cells if a longer run time is required. I'm mainly thinking of temperature monitoring right now but I definitely will want to check out other sensors after I get the hang of these. It looks like there a lot of fun options on the ESPhome website and I could definitely see using some other motion detection sensors to control lighting or other automations.
Where are these going? In a house? I highly recommend using your house power to power things that are going to add value to your house. Why deal with batteries that can drain or explode (or just heat up right next to your temp sensor)?
 
Oh man, ESPhome is one of those things I need to stay away from, lest I go down a rabbit hole and ignore my other projects :). I currently have:
  • One hanging from the bottom of my desk. Currently it only runs an individually-addressable light strip, which does flashy lights in one pattern and collect temp/humidity data (which is then summarily ignored), but "some day" I'll add:
    • height sensors (it's an adjustable desk). I don't know what I'll do with this yet, but I had the ultrasonic sensor 🤷‍♂️
    • an occupancy sensor. This also uses an ultrasonic sensor, with the goal of automatically controlling the under-desk lights when they're likely to be seen.
    • a light sensor. This will eventually control the lighting under my desk, behind my monitors, and my ceiling light (which uses a Kasa smart dimmer)
  • One hanging from the back of my monitors. It only controls the bias lighting behind the monitors with two individually-addressable light strips. "Some day", it'll tie in with the one in the next bullet point and automatically adjust the lighting based on what I'm currently doing.
  • One on the wall outside of my office. It has 3 color-coded LEDs and an epaper screen in a 3d-printed case. It changes colors and shows a message notifying the wife and the boy if I'm playing, working (i.e., "come in but I'll be distracted") or in a meeting (i.e., "if you come in, you'll be on camera"). "Some day", the script that controls that will also adjust various office lights so I can set up for gaming or a call with one button press
  • One hanging from a shelving unit in my lounge. It uses an IR sensor to detect when someone walks by, and lights up the different cabinet spaces (like this, but each cabinet spot is a random color). There's a switch that toggles between "do nothing", "slowly fade to different random colors", and "quickly fade to different random colors"
  • One in my server cabinet. It has a temperature sensor and a switch, and when the cabinet gets too hot, if the switch is on, it spins up 4 fans I installed on the cabinet. "Some day", it'll work with the temperature from the desk sensor, and will turn on if the rack is n degrees hotter than the rest of the office.
My next projects are:
  • E-paper screens that sit on the cat/dog food containers with ultrasonic sensors poking in, and they a) tell you the last time the bin was opened (no more double-feeding the dog!) and b) tell you when the food is low. Related, let me know how battery power works; I'm looking at using LiPo cells for these, but haven't spent any time researching it.
  • A scale-based meter for my kegerator that uses an epaper screen to show what beer is on tap and how much is left (this is.... not a near-term project lol)
All of these are running on ESP32s; I haven't messed with ESP8266s because the cost difference is negligible for what I'm doing, and I gain a few extra pins and a bit of horsepower.

Thanks for the tips!!! I definitely have not done much research beyond the "will this work at all?" stage but I definitely see what you're saying about trying to stick to one chip if possible to not waste time with the fiddlyness and quirkiness that can come from mixing processors when they are all going to be to set to similar tasks I think.

The e-paper screen is definitely on my wish list too. I really liked the e-paper calendar projects but I think I am going to wait and pray for large size epaper screens to come down in price. I really want a digital calendar that is actually bigger than wall calendars. Ideally I would like touch sensitivity too though either with an overlay of some kind or built in. I am thinking like a 20"+ for the e-paper calendar but I have only seen that size as desktop monitors for $2k and that seems a little unreasonable for my plans. I might end up just doing a 24" IPS display or something with motion detection to turn it off when no one is in the room.



Yep, they are Universal Powerline Bus switches and switched power boxes. The cool part is that there is no wireless, so no interference or hijacking, and you program each switch to do what it needs to do, so you don't need a computer after uploading the programming to the switch. You just tap up 5 times really quickly to put in programming mode, or address it using the UPStart software they have for it.

Another cool aspect of these is that they are... Universal! You swap out your normal overhead light switch with a UPB switch, and you automatically get dimmer action, and you can set it to remember the last level it was set at for the 'on' level. You can have it fade out when you turn off the switch. You can add lights to 'scenes' and control multiple lights from a single switch

But the real killer app is changing the face plate and adding another rocker to the same switch box, or four, or two switches and 4 or 8 buttons for scenes. It's amazing! I _never_ used the overhead light in my 'media room' until I could dim it a bunch, and also use the same switch to turn on several lights, or just a few, or a few lights and the AV receiver, which now turns on the TV by itself. Simply Automated makes a decent line for a decent price per switch.

Where are these going? In a house? I highly recommend using your house power to power things that are going to add value to your house. Why deal with batteries that can drain or explode (or just heat up right next to your temp sensor)?

Do I understand correctly that the UPB switches then are communicating over the mains power line similar to those ethernet switches that you can use your home wiring? Do you end up having a little box plugged in to an outlet somewhere to communicate with those switches? It seems really cool and I love that it doesn't depend on my wifi. My wifi situation is improving with more plans to improve it in the future but not being accessible wirelessly definitely helps satiate a security concern!

In terms of location for the ESP temperature and humidity sensors I am thinking there will be USB powered ones for the individual rooms in the house but 9v battery powered ones for ones I place in the fridge and freezer to monitor door ajar situations or compressor failures. That is a really good point about the battery heat affecting the reading though, I think the 9v would be better about that than the rechargeable lithium cell but hopefully the power draw is low enough to keep both unnoticeably warm. I mainly fear the lithium based batteries failing catastrophically with a fire risk though. I want a large scale battery backup on my house too someday but I'm not real eager for a bank of lithium based ones given the track record. I know the iron phosphate batteries are supposed to be better with a higher ignition point but they still seem to catch fire with punctures pretty easily.

I also want to set one up in the hot tub but I think that one can use a low voltage lead off the hot tub controller somewhere and also doesn't need to be battery powered. There are lot of places to pull the temperature from the plumbing using some sort of coupler with the probe inside it. Similarly I would like to get the outdoor pond temperature to determine when it's safe to switch the fish back to protein from their winter/spring diet of wheatgerm.
 
Do I understand correctly that the UPB switches then are communicating over the mains power line similar to those ethernet switches that you can use your home wiring? Do you end up having a little box plugged in to an outlet somewhere to communicate with those switches? It seems really cool and I love that it doesn't depend on my wifi. My wifi situation is improving with more plans to improve it in the future but not being accessible wirelessly definitely helps satiate a security concern!
Each switch can do everything the switch can do by itself without any other box plugged in, but if you want to monitor the state of the lights or connect it to HA or some other piece of software (I have looked, I kid you not, at a commercial package called "HomeSeer" but I haven't pulled the plug on it quite yet. Just using HA and other things duct taped together.
In terms of location for the ESP temperature and humidity sensors I am thinking there will be USB powered ones for the individual rooms in the house but 9v battery powered ones for ones I place in the fridge and freezer to monitor door ajar situations or compressor failures. That is a really good point about the battery heat affecting the reading though, I think the 9v would be better about that than the rechargeable lithium cell but hopefully the power draw is low enough to keep both unnoticeably warm.
Absolutely. but how will you convert your 9V to the 5 volts USB power these devices are looking for? A breakout board? Which one? At what sort of conversion rate?

I've been wondering if I go this route if I shouldn't start looking into 12V systems that can be run off DC without having to convert back from my storage. There aren't many hobby boards that run at 12V outside of the ham radio world, or at least I haven't bumped into many yet. I should really check out those 'off grid' people from the 90's, I think they had a bunch of solar panel 12V home systems. I dunno, though.
I mainly fear the lithium based batteries failing catastrophically with a fire risk though. I want a large scale battery backup on my house too someday but I'm not real eager for a bank of lithium based ones given the track record. I know the iron phosphate batteries are supposed to be better with a higher ignition point but they still seem to catch fire with punctures pretty easily..
Wait a bit for Vanadium Redox Batteries to hit the market in production numbers. It fits the bill perfectly: an outdoor, fridge sized box you can plop next to your heat exchange unit, power up all day in the sun, run all night, and hold 10kwh for when the need it. Could be literally the 'smart grid' of the future, with many houses and commercial areas having enough 'onsite power' to handle a day or three, and the grid can 'juice you up' when they have extra available renewable.

Seems pretty close. Except we messed it all up, apparently.
 
Each switch can do everything the switch can do by itself without any other box plugged in, but if you want to monitor the state of the lights or connect it to HA or some other piece of software (I have looked, I kid you not, at a commercial package called "HomeSeer" but I haven't pulled the plug on it quite yet. Just using HA and other things duct taped together.

Absolutely. but how will you convert your 9V to the 5 volts USB power these devices are looking for? A breakout board? Which one? At what sort of conversion rate?

I've been wondering if I go this route if I shouldn't start looking into 12V systems that can be run off DC without having to convert back from my storage. There aren't many hobby boards that run at 12V outside of the ham radio world, or at least I haven't bumped into many yet. I should really check out those 'off grid' people from the 90's, I think they had a bunch of solar panel 12V home systems. I dunno, though.

Wait a bit for Vanadium Redox Batteries to hit the market in production numbers. It fits the bill perfectly: an outdoor, fridge sized box you can plop next to your heat exchange unit, power up all day in the sun, run all night, and hold 10kwh for when the need it. Could be literally the 'smart grid' of the future, with many houses and commercial areas having enough 'onsite power' to handle a day or three, and the grid can 'juice you up' when they have extra available renewable.

Seems pretty close. Except we messed it all up, apparently.

I can't defend the logic my brain is following but I feel like you should get the homeSeer software for free since it's your name.

The NodeMCU version of the ESP8266 and ESP32 are the dev kit versions so they are directly mounted to their breakout board with USB port and a voltage regulator, they allow for +5v up to +10v. I'm not sure about their efficiency but it's honestly probably beyond my skills to do anything about it if I didn't like it at this point in time. I did read that they can take 12v but that regulator will get hot which sounds like efficiency loss to me. Probably would want the 12v ones to be only run intermittently or maybe some additional components could bring the voltage down a bit more efficiently?

That Vanadium Redox battery article is incredibly frustrating but I guess I'll just have to wait for the Chinese exports of them to get there. That is exactly the kind of device I would like though. I would be willing to give up considerable yard space for power storage with that kind of quality in a battery.
 
Last edited:
I have not done much with electronics yet but Ive made a few of these:

It runs on an ESP8266. It takes a bit of finagling to get the pins sorted but is a pretty quick project.
I made ~10 of them as a gift for coworkers some years back.
 
I have not done much with electronics yet but Ive made a few of these:

It runs on an ESP8266. It takes a bit of finagling to get the pins sorted but is a pretty quick project.
I made ~10 of them as a gift for coworkers some years back.
I don’t think I realized you used the esp8266, I think my unfamiliarity with these boards just filtered that into “casey magic” when you first told me about that project, lol.

I’m currently waiting on some aliexpress orders for more sensors but I’m hoping to get one ESP board setup with the humidity and temp logging this weekend. In a few weeks when the aliexpress order arrives I will hopefully have some plantower air quality particle sensors. These sensors use a small laser diode and photo sensor of some kind to measure the amount of particles blocking the laser beam. It is able to measure concentration of three different sized particle ranges (i think) which will be really interesting for air quality monitoring during wild fire season and in the garage with wood working dust air quality monitoring and warnings.
 
Ooh those air quality sensors would be super nifty. Does ESPhome support those natively, or do you have to do some trickery to get them to work? I think that's the same type of mechanism those AQI databases use; you might be able to contribute to those if you set one up outdoors.

Can you share a link to them?
 
Last edited:
No guarantees, but the older versions of the PM2.5 sensors from plantower are supported by esphome, I am hoping the newer version I ordered is also!
https://esphome.io/components/sensor/pmsx003.html

Plantower PM2.5 on aliexpress: https://www.aliexpress.us/item/2255...cT7VAqY&gatewayAdapt=glo2usa&_randl_shipto=US

I ordered 4 of them so I will have an extra if you want to make one too! We will all be waiting until mid-October for the epacket shipping from china but they are at least shipped!

A friend who is also interested in setting up an AQI meter mentioned looking at buying one of these "PurpleAir" sensors which was an exciting page to see. They have basically commercialized the same idea and made a sweet community access map for it. My friend points out the down side being that you have a publicly facing GPS position on your purple sensor which makes sense for the map but also is not really ideal for privacy minded folks. Also it's $300 which is about 10x the project cost on my end so that's a big no thank you from me. At that price point I would be more interested in buying a personal weather station.

I will probably use a similar design for my outdoor model, they seem to be using a 2.5" PVC cap and a small 3d printed chassis for the parts to mount to inside. PVC would be a great way to help durability in the sunlight and rain over a purely 3d printed part but I REALLY like 3d printing so we'll see if I can resist designing the entire enclosure/housing.
 
Air quality sensors are coming, I promise!

The wheel of ADHD led me to the more pressing issue of needing a bluetooth proxy relay for home assistant. HA has a bit of a storied history when it comes to bluetooth from what I have gathered but the esphome setup for the bluetooth proxy worked great!

I printed this enclosure for the esp and added mounting tabs so I could screw it to some furniture or a wall.

AFF4AFA2-866A-4E62-AEB0-FE36A90655B3.jpeg

The modified file is available on Printables and the original is linked on that lage where you can get the lid and buttons.

 
I like it! I haven't messed with bluetooth relay, but it seems pretty exciting. I also haven't messed with the PM sensor yet, but I did just get the power supply for my photo wall lighting, so I'll finally at least get one project off of my workbench
 
Oooh that will be really cool. I am curious what your final power draw ends up at with them!

The bluetooth proxy immediately picked up my switchbot curtain bots. The curtain bots suck and I don’t recommend them but automated curtains are awesome and the switch bots are better than nothing, but certainly overpriced and loud.

The bluetooth proxy will help pickup Govee branded lights as well which Target sells as a cheaper alternate to phillips Hue addressables. The hue hubs use zigbee or similar so they should have better range than Govee unless you have blue tooth esp proxies!
 
Back
Top