An ESP8266 Environmental Monitor In Your USB Port

At this point, we’ve all seen enough ESP8266 “weather stations” to know the drill: you just put the ESP and a temperature sensor inside a 3D printed case, and let all those glorious Internet Points™ flow right on in. It’s a simple, and perhaps more importantly practical, project that seems to never get old. But that doesn’t mean there isn’t room for innovation.

Annoyed by the unnecessary bulk of existing solutions, [cperiod] has come up with an ESP8266 temperature and humidity sensor that can plug directly into a standard USB port. Slotted into a USB wall charger or power bank, this diminutive board can provide inconspicuous remote environmental monitoring wherever you need it. For extra hacker points, the board was even produced at home on a PCB mill.

In addition to the ESP-7 or 12 module (which plugs in via a header, should you need to swap it out), the board features a CH330N USB to UART chip and HT7233 voltage regulator. For the sensor itself, [cperiod] has bucked convention a bit and went with the I2C-connected AHT10 over something more common like a member of the BME family.

Unfortunately, this design suffers from the same issue we’ve seen in other compact environmental monitoring solutions; namely, that the heat generated by the chip itself skews the temperature readings. To combat this, aggressive power saving functions are baked into the firmware to make sure the ESP is in a deep sleep as much as possible. While not a perfect solution, it does prevent the ESP from warming the PCB up so much that it invalidades the reported data.

By now, the particularly astute reader may have realized that all the additional components used for the USB side of this board aren’t strictly necessary. After all, if you can pull the ESP module out of the header and program it separately, then you don’t actually need to include that capability in each sensor node. While true, we’re hardly the ones to complain when a hacker showboats a bit on their designs.

28 thoughts on “An ESP8266 Environmental Monitor In Your USB Port

    1. If I only wanted to know how hot it was around my computer, I’d wire a DS18B20 into a digispark. Currently, all of my working devices are plugged into type A sockets on power bars, wall receptacles, and old phone chargers (with the proprietary plug swapped for a USB type A socket).

    1. How did you see that?
      I milled out an AR lower from a billet with a manual mill.
      That doesn’t make what I did a hack. This thing is impractical.
      Being showcased in article here is practically a participation trophy

      1. So what is a hack by *your* definition then?

        I ask because this project, regardless of how anyone feels about it, checks all the boxes to be a hack in my opinion. I am curious why you feel so strongly about your own opinion, beyond whether or not you think it is practical or not. Practicality has never been a requirement for something to be considered a hack on this site, though I’ve only been reading HAD daily for the last 10 years or so. I could be mistaken.

      2. “Being showcased in article here is practically a participation trophy” if you hadn’t noticed that’s actually how this site works, if it makes you so mad peace out nerd.

      3. Anybody can criticize. Not all can create something original. Most of here realize we can probably learn something by taking the time to appreciate someone else’s work rather than shitting on it.

    1. Easily 10C above ambient running normally. They’ll warm maybe 1-2C within a couple seconds of waking up from sleep. There’s a short window in which you can get a meaningful reading.

  1. Interesting little project. Moving the temp sensor off the board might make it a bit better at reading the temp. I would also suggest adding light sensor and pressure sensor to add a bit more data. Solar charger + USB power bank + device could make of a nice little remote sensing device.
    It does offer some interesting options like only reporting on a delta of x plus a heart beat of y to save power. You would know that if you did not get the heartbeat after y that the device might be down. The ESP line really offers some interesting options.
    And to the grumps on here.
    If you can not say something nice do not say anything at all.
    Maybe HAD should replace WordPress with Slash so we can have karma ratings.

    1. > Maybe HAD should replace WordPress with Slash so we can have karma ratings.
      Egads, no. Please, Hackaday, leave that crap along with the “glorious Internet Points” out. Most of the time readers do a decent job ignoring the trolls, and we certainly don’t need the [mutual gratification parties] that ensue from keeping scores.

      1. That is what is nice about slash. It does not have points that are visible. You just get a rating of something like good, ok, or terrible. It also has a meta moderating system. I have never gamed it and it has a flaw where people can post as an AC and then be a jerk with impunity. HAD is not going to do that anytime soon but I do get tired of the people complaining and being nasty about others projects that get posted on here.

    2. Moving the temperature sensor off the board would kill the comfortable footprint, which was the my design goal.

      An ambient light sensor is next on the list. Pressure isn’t for this device (I have pressure on my outdoor weather station, and that’s plenty), but someone could easily replace the AHT10 with a smaller footprint like the BME280.

      You could definitely run this device off other power sources (soldering wires directly to the exposed USB pins if you like), but it’s really intended for mains-powered USB sockets so it’s not power-optimized. I’d never put a USB controller or that diode on my battery-powered devices.

  2. So you can pull power from any USB charger, USB power bank or USB power outlet. Which I think are the most common power supply options in my home environment. I fail to see your point…

  3. Is there a link somewhere to the firmware? Wireless environment sensors are the “Hello World” app of ESP’s, but I’m always interested in seeing what refinements people have brought to this.

    1. There’s no published firmware. It really is just the “Hello World” style of get-reading-connect-to-mqtt-send-reading-deepsleep business. I do plan to publish the AHT10 parts, because the libraries I’ve found are bad enough that I had to do my own.

  4. Tom Nardi’s last article is an excellent, unambiguous example of a hack.

    I’m actually encouraged to attempt a project I put aside now.

    My interpretation of “hack” appears to be far too narrow.

    1. Who cares if it is a hack or not. The name of this site is hackaday, so as long as there is an article about a hack by someone’s definition every 24hrs, they have met their contractual obligations implied by their name.

      I got an idea, if you don’t like the article, don’t read it.

  5. Cool design, sadly the USB ports themselves can often get very warm, and if you’re putting your thermometer next to a PC or other heat source it’s not very accurate. I have to keep my ESP8266 environment sensor on a bookshelf to get a reasonably accurate temperature reading.

  6. nicely done, must have been fun to build this from idea to prototype.

    I was thinking about replicating the functionality with a DigiSpark, since it has the USB connector already, connecting an BME280 via I2C should provide the temp/humidity/pressure info. Also a DigiSpark is low on power consumption.

    1. Thanks. My first go ( was really more fun to build; going from “silly idea” to “working hardware” in a lazy afternoon is an ego boost. Then scope creep set in.

      A DigiSpark would be great if you want a PC-based sensor, but the reason I went with the USB plug (which might be more obvious from my first approach) is primarily to take advantage of the ubiquitous USB type A power supply; the communications controller is there to speed up programming and debugging during development. In practice, I don’t actually run these things anywhere near an actual computer.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.