Battery Powered ESP8266 Temperature/Humidity Monitor with DHT11

The Esp stuff is certainly fun-
I haven’t played with the Esp12f yet, but I’ve been enjoying the ESP12-e.

It’s pretty cut and dried stuff.
Upload a script/sketch using Arduino IDE,
then add functions in the App, just like a Pi.

Thanks for the quick reply.

I have used the Arduino IDE with a UNO to learn and try out stuff including canva and Pro Minis for a card reader application that is in daily use.

I was looking for the specifics.
What board type do you use in the IDE?
Your picture shows a USB interface (which I have) - what pins are used to connect to the ESP12?

I was thinking of making several of your battery powered monitors, to monitor several rooms at the same time - can multiple devices appear on the same dashboard?

Thanks

In the IDE you can use the ESP-12e board. The 12f has less memory so to may run in to problems with very large sketches without the IDE warning you, but so far I have not had a problem. The 12f supposedly has a better antenna and I saw them when I was making an order so I got 5 of them from banggood.com.
I am using a FTD1232 I got an amazon to program it. It’s nice because it has a 3.3v/5v jumper to give you the voltage you need. For programming and testing it should run an ESP but I wouldn’t try to run relays or anything else unless you get a separate power supply to avoid overloading your USB controller. The GND goes to GND, VCC to VCC (set to 3.3v or use a regulator if using 5v), RX on the FTD goes to TX on the ESP, and TX on the FTD goes to RX on the ESP. ESP pins are listed below.

Also, GPIO 15 has to be grounded at boot to boot normally. GPIO 15 and GPIO 0 have to be grounded to boot in to programming mode. Because of this I tend to just jumper GND and GPIO 15 on my circuits so I don’t have to worry about it and then I just lose that pin.

Great!
Can you post the scheme of ESP8266 shield.
It’s real interesting. You use a capacitor and switch? What’s the procedure for flashing the ESP8266.

Here’s you go…

you only need 3 pins-

TX (transmit) goes to REC (receive)
REC goes to TX
…and GROUND.

Don’t bother with the onboard +3.3 regulator,
the ESP draws too much current.
Be SURE to set your interface voltage to 3.3!

Here’s the one I got-

Thanks again - Did a bit more searching and I think I should be good to go when they arrive.

After tou install Arduino IDE FROM Arduino,
and after you physically attach the FTDI232 pins
Tx, Rx, Gnd (be sure 3.3V is selected)

and import the ESP8266 library
http://esp8266.github.io/Arduino/versions/2.0.0/doc/installing.html
(after downloading it- don’t forget to INSTALL it! :wink:
and then import the Cayenne .zip library
into the Arduino Library

After you start the Arduino IDE,

Choose tools/port -select wherever your FTDI USB/Serial converter is-
choose Tools/Board “ESP8266 Generic”

compile/upload the “Hook” file onto the ESP12e
by shorting GPIO 0 to GND for 5 seconds on power-up.
It’s now in programming mode.
upload this file AFTER starting Device/ADD
on your remote HTML or App.
Substitute YOUR Token, SSID and Password :slight_smile:

#include "CayenneDefines.h"
#include "BlynkSimpleEsp8266.h"
#include "CayenneWiFiClient.h"
#define CAYENNE_DEBUG
#define CAYENNE_PRINT Serial

char token[] = "MyToken";
char ssid[] = "MySSID";
char password[] = "MyPass";

void setup()
{
  Serial.begin(115200);
  Cayenne.begin(token, ssid, password);
}
void loop()
{

  Cayenne.run();
}

The FTDI model I put in my post above will run an ESP12-e for programming/testing just fine, just make sure you have a good capacitor like 1000uf or more. Like I said, just don’t power the ESP + any other device and you’ll be fine. Average mA draw is about 75-80mA which USB can handle just fine. It’s the surges that are not good for the USB port, and the big cap smooths that out. Here is the link https://www.amazon.com/gp/product/B00IJXZQ7C/ref=ox_sc_act_title_2?ie=UTF8&psc=1&smid=A30QSGOJR8LMXA

Some more info about USB port power consumption:

The USB 1.x and 2.0 specifications provide a 5 V supply on a single wire to power connected USB devices.

A unit load is defined as 100 mA in USB 2.0, and 150 mA in USB 3.0.
A device may draw a maximum of 5 unit loads (500 mA) from a port in USB2.0; 6 (900 mA) in USB 3.0.

Works very well, I am pleased with the ease of putting this project together. The only think id like to change is the temp format to Celsius, I will try to figure it out but maybe someone has a quick answer how to change that
Great work on this project !

The power issue has nothing to do with the amount of power delivered to the USB port.

The problem is the FTDI232 on-board TINY SMT-mounted 3.3 volt LINEAR voltage regulator.
It’s WEAK, -as all SMT linear regulators are
(I THINK this SMT 3.3v regulator is rated to 100mA).

…and adding a 1000mF electrolytic is just- WRONG.
That giant electrolytic cap isn’t gonna charge itself…
crowbar current limiting is the only thing saving your USB ports.
Lucky you.
I use 45mF/35V electrolytics on my regulator inputs and outputs
and I use .2mF/50v ceramics as my de-glitching filters.

I’d stick with my advice of not using the FTDI regulator, and strongly suggest using a switching regulator (like the 78SR3.3 ,1.5Amps), with a voltage input range anywhere from +7.5 to +36Vdc.

The Esp12-e and 3 LED diodes may well push that weak FTDI voltage regulator over the edge. Another unexplained reboot…

Pushing power components this close to the edge is…unadvisable.

-but, to each his own…

Here is one I use that is rated for 1A, though you are correct that the one on the FTDI is nowhere near 1A. I saw 50mA in a comment on the amazon page but there are no datasheets for this, so it could be anything.

I’m using a 1000uF (1mF) capacitor, not a 1000mF. 45mF is way overkill. 2200uF is the sweet spot but I do not currently have any right now. Searching google for “crowbar current limiting USB” brought back nothing, what exactly is that?

If you are using the first ever USB 2.0 controller, yes, you will not want to consider this. If all you want to do is upload a sketch with out peripherals attached, USB 3.0 will handle this just fine. I regularly create sketches that simulate sensor input to test that everything will work before I put it on an ESP that is ready to go. I’ve never once had an ESP reboot unless there is a coding error. You do bring up a good point about the regulator on the FTDI, but worst case there is you end up burning out the regulator.

So, long story short, if you’re worried about your FTDI or your USB port don’t use it to power the ESP.

Hello adam,
awesome Project! Unfortunately I am a rookie here an not keen
in programming at all, so I just copied your Project with a DHT22.
Connection to mydevices works fine, but any Idea why I stuck in a Humidity loop?
Setup[20383] Connecting to xxxxx
[21886] Connected to WiFi
[21886] My IP: 192.168.xxx.xx
[21886] Connecting to arduino.mydevices.com:xxxx
[22319] Ready (ping: 152ms).
Entered Humidity
Humidity: 43.90
Entered Humidity
Humidity: 44.70
Entered Humidity
Regards Erik

I’m not exactly sure to be honest, but I would suspect that the differences between the DTH11 and DTH22 are enough that my code doesn’t work copied and pasted. I have a DHT22 that I can try later (haven’t even taken it out of the package yet). I’ll get it working and upload the code for you.

I also forgot to update how long it lasted. With 2 AA batteries this project updated the dashboard from 9/22/16 to 10/11/16 - 25 days! I have 2 AAA batteries hooked up now to see how long they will last.

Adam,
I got it fixed!
(You must define all three Graphs in the
dashboard, for data handshake, otherwise
the routine does`t run trough…)
[7597] Ready (ping: 2172ms).
Entered Temperature
Temperature: 73.94
Entered Humidity
Humidity: 53.90
Entered Heat Index
Heat Index: 73.34

Got all values - sleeping

Cheers

2 Likes

Made a mistake on Ebay and had 3 boards arrive on which to mount an esp-12 not the esp-12s.

Re-ordered hopefully the right items.

The battery holders and DHT11s arrived ok and I bought some boxes from a charity shop.

Should be good to go soon.

The AAA batteries didn’t fare very well. They only lasted 3 days, but there could have been a Cayenne outage in there that drained the batteries. I have some LiPO laptop batteries that I’m going to try as soon as my HT7333 voltage regulators are delivered from China (hopefully soon - ordered them 2 weeks ago). These voltage regulators have a very low voltage drop (90mV as opposed to the 1.1v on the AMS1117) and will allow the ESP to run for longer when the battery voltage hits less than 4.4v.

ESP12s now arrived. Aim to make up 2 or 3 modules.

IDE setup and sketch verified - just need to get the soldering iron out.

I think I will wire in a programming socket to make it easy to connect the FTDI module as I may use these to record temperatures in other places, so it this would make it easier to change the WiFi settings.