The Kube - ESP8266 NodeMCU DHT22 Local/Remote OLED Temperature/Humidity Sensor

by bkpsu Sep 18, 2017
Download All Files

Thing Apps Enabled

Please Login to Comment

Hi again, I've started putting together a WS2812 controller using your NodeMCU carrier board and I noticed something odd with the level shifter. With the level shifter board I have, the pins seem to be backwards. If I soldered the level shifter to the front of the board, the power and ground pins are reversed. Looking at the top row of shifter pins on the carrier (the low voltage side), they're labeled D5-D4-3v3-GND-D3-D2 (from left to right). On my level shfter board the same row of pins is labeled LV4-LV3-GND-LV-LV2-LV1. If I flip the carrier board over and solder the shifter to the backside, the pins line up. Is that the way it's supposed to work? Or is my shifter board just wired different then yours?

So, first - that level shifter is an I2C type - it's good for the multisensor if you need to shift between logic levels, but it's too slow for the LED Strips (WS2812 included). That said, I use the direct 3.3v output for the LED strip controller (check out my hardware build video here for detailed connections: https://youtu.be/WNp4G49tkrQ

I haven't found a WS2812 LED strip that doesn't work this way, yet. But, if you have issues with flickering, you may want to use a 74HC245 level shifter.

Anyway, for the I2C level shifter, did yours come with the headers already soldered on? Mine did not, so I mounted the headers into the board first, then put the level shifter on top in proper alignment. Unfortunately, like the I2C OLEDs, these things don't have a standard, and sometimes come with the VCC/GND pins reversed. Fortunately, since it's the middle pins, you can just flip the board around (your channel 1 on the level shifter will then become D5, but that doesn't matter)

If you already have headers on, you can either depin it and flip around - or, you can mount it from the bottom of the PCB (not ideal, but easier than depinning these things :)

Thanks for the tip on the I2C level shifter. I didn't realize it was a slow speed device. I ended up buyiing another level shifter, with unsoldered headers, and soldered the headers on upside down, so I can mount it upside down on the front of the carrier. Works fine.

I'll mention another problem I'm having with the carrier. When I plug the ESP8266 into the board, I'm not able to flash it by just plugging in the USB cable. I have to physically press the FLASH button while powering it up in order to get to flash properly. After some debugging I found that the connection of RST to D0 (GPIO16) is the problem. It seems that on some ESP8266's the D0 line FORCEFULLY pulls the RST pin high, to the point where the onboard UART can't pull RST low to enable flashing. The situation is mentioned here:
If you ever decide to make a v2.0 version of the carrier, it'd be nice to make provisions for a resistor or diode between D0 and RST. Vias for bypass caps on Vcc and 3V3 would be nice too. Not complaining, just food for thought. :)

Thank you for all the feedback and ideas, I appreciate them! I definitely will be spinning up a new rev of the board, and while at it, I already have some plans for the projects I'm thinking of:

-replace leverl shifter with 74HC245 (didn't know about it when I originally designed the board) - it'll still work with I2C as well as the LED strips. I'll probably only connect 4 channels of the 8, for header pinout compatibility.
-add resistors for a voltage divider for the A0 channel (since any analog input needs to be scaled to 0-1.0v).

And, I definitely remember having some issues with reflashing while connected. I did account it to the Deepsleep RST/D0 line, so I just removed the board from the carrier. That said, I use OTA for re-flashing, and I've never had issues with OTA working, interestingly. I will probably just replace the current 10K resistor on the board (which was placed as a pull-up for the DHT sensor, but isn't needed since the NodeMCU D2 line already has internal pull-ups) with a 1K, and route it between the RST/D0 line, as the link you posted suggests.

As for the bypass/decoupling caps, doesn't the NodeMCU board already have them? Or, do you mean like a beefier 470uF cap on the 5V/Gnd side, for when the NodeMCU is connected to a longer LED strip?

Anyway, I decided to share the board project on https://github.com/bkpsu/NodeMCU-Breakout-Board so others can comment, add issues, and possibly even submit their own pull requests for modifications. I would love to have your input and discuss further ideas for the board there!


I looked at your GitHub site. I'll post further suggestions there. I wish I knew more about Eagle.

Also, you mentioned adding a voltage divider for A0, but NodeMCU already has that. It has a 100kohm and 220kohm divider network, so 0-3.3V on the A0 pin gets translated to 0-1V at the ESP ADC pin.

As for capacitors, the NodeMCU has a beefy 100uF cap on 3v3, but not much on the 5V rail. I've just gotten into the habit of soldering a 470uF cap between 5V and GND.

Hi, I just wanted to say "thanks" for sharing your work. These little carrier boards are a great idea. I ordered some from PCBWAY and they arrived yesterday. They seem very high quality and I got 10 for $9, so can't beat the price. I was wondering though, I have NodeMCU v1.0 boards, which use the inner most set of thru-holes. The NodeMCU is a very tight fit. If I mash the board all the way into the carrier, the pins bend toward the middle a bit. It's not too bad and I can certainly use them, but I was curious if you had to fudge the hole spacing a little to fit the NodeMCU v1.0 thru-holes on the board. Or is the PCBWAY build not really as good as it looks? Or maybe my NodeMCU's are a little wider then spec?
Anyway thanks for sharing. I can't wait to put them to good use.

Thanks! :) The ones I got from PCBWay were even better quality than OSHParks (no substrate crap to file off around the board). The v1.0 NodeMCU I got (only have 1, I'm partial to the 0.9's because of their lower price) fits well, no issues. Are you sure you got a real v1.0, and not one of the newer "v3" LoLin boards? I'm not sure if they changed the footprint at all between them...Also, are you going straight into the board, or attaching headers first? I found it was easier to put the NodeMCU into the headers first and then solder the headers onto the PCB, sometimes.

To answer your question, I just used the standard Eagle libs for these, and didn't have to change the layout at all (I nudged it up to fit the same enclosure, since the 1.0 is offset vertically, a bit).

I'm glad you're able to find these useful! Post your make when you get around to it! :)

My NodeMCUs say Amica on the back so definitely not LoLin boards. The 0.9 doesn't fit on a breadboard nicely, so I prefer the 1.0. I was just test fitting the NodeMCU into the carrier board (no headers) when I noticed the pins didn't align perfectly. I was just going to solder the NodeMCU to the carrier, but maybe headers will provide a little slop and give a better fit.

Hmm, interesting - I just tried my 0.9 and a 1.0 direct into the carrier board, and it's definitely a bit harder to align/fit in, but it does. I do notice that the headers on the MCUs are a bit uneven, but after I lay the MCU down on a side and applied a little pressure to bend them in a bit, it fits much better. Guess I just never intended to mount them directly to the board so I didn't try this before :)

Curiosity got the better of me, so I found my micrometer, dusted it off and made a few measurements. The two rows of vias for a NodeMCU 1.0 should be 0.9 inches apart. The boards I got from PCBWay measure about 0.882 inches apart. So the spacing is a little less then it should be, although I can't say if it's out of spec. Like you say, it's not a lot, and everything fits if you bend the pins a bit. Just FYI.

Welp - your curiosity sparked my curiosity :) So, I double checked the library in Eagle, and it's 0.9 inches (as it should be). But, the spacing between headers on the board is only 0.89 inch...So, maybe I did nudge them closer together to gain a bit of spacing from the 0.9 pins? Honestly, it's been 6 months, so I can't remember, but obviously, PCBWay isn't at fault here, I am :) Like you said, it won't matter too much, though....

Have you tested your temperatures with/without the case? I'm finding my readings are 3-5°C higher once I install everything in the case, I'm guessing the ESP is warming it all up slightly. I might try the louvred version and see if it's any different.

Yes, I have and found out the same! (I mentioned it in one of my updates here and on Github) - basically, when I'm running the ESP always on vs deepsleep, the ESP temperature definitely seems to affect the DHT22 sensor measurement (or perhaps it's just the natural offset of an uncalibrated DHT sensor). I noticed the offset was linear (at least for the temperature range I need, ~60-80 *F), so I put in a manual calibration offset into my code. To find the offset, I left the sensors on in the same room as my HVAC thermostat and logged measurements over the course of a few days. Looking at the resulting graph, I could easily calculate the offset required to bring the sensor's temperature in line with the thermostat, which is what I need these to be calibrated to, anyway, since I'm trying to see how the HVAC system is heating/cooling the different rooms in my house better or worse.

Just wondering where you got your pcb's made?
Thanks :)


I ordered them directly from OSHPark ($18 shipped for 3 boards). I'm sure PCBWay or somebody could make them cheaper, but until I'm ready to order a larger quantity (I'm still making small modifications to the board for other projects), I'll keep getting them from OSHPark.

Thanks for letting me know and thanks for publishing the project :)

You're welcome! Publish your make of it if you end up using it! :)

Just to share, I ended up ordering 2 v3 esp8266 12e boards and they are a bit larger than the .9 or 1.0 boards and do not fit in the case. I ordered 2 smaller boards and I will use the v3s for something else. I really look forward to putting this together. Just waiting on the breakout boards from OSH Park.


Yup, I ordered one of the v3's myself, but it's no longer pin/size compatible with the original NodeMCU. In fact, the one I got doesn't even carry the NodeMCU name, it's made by LoLin. I haven't played with it since I got it, the 0.9/1.0 NodeMCUs are just too cheap and have everything you need for this design, anyway.

Let me know how you make out with putting things together, I'm interested to see if my directions are easy to follow or if I can improve on them!