From my previous experiments with NODEMCU boards running off a battery I was only getting about a week from a device updating every 2 seconds running of a 12V 7AH battery. Now I figgured a 2 second update is a bit excessive and between samples the NODEMCU is just sucking power so I have added
ESP.deepSleep(15 * 60 * 1000000);
after all the data has been sent to the broker.
What this does is put the ESP to into deep sleep for 15 minutes after which it wakes up connectes to the AP sends the data to the broker and goes back to sleep.
In order to have the NODE MCU wake its self up it was necesary to connect D0 to RST
I also noticed on the board I omitted the 4K7 pull up resistor for the one wire data bus.
I Was happy with the way this all worked so I popped the module in a box - I have a pile of cheap plastic food starage conatiners and theyare great as reasonably water proof enclosures for these pseudo temperay projects.
The sensors are now mounted on the HW heater -
- One in the tank - As my tank is open vented I just dropped the sensor in through the vent hole and sits roughly in the middle of the tank.
- The return from the booster sensor is slipped under the pipe insulation and I attempted to push it down to just below the bottom of the tank to reduces the impact of the tank temperature.
- Inlet sensor underr the insulation on the inlet pipe
- Ambient temp is just a to92 package ds1820 mounted on the PCB this sits on top of the tank so is effected by the tank heat leakage.
I did implement a 5th sensor for the water temp to the booster which comes from the bottom of the tank but i decided in the end that this was of limited vaue and required etending the leads to the sensor some what whaich at this stage I dont feel is of benfit - I may implement it at some later stage.
So now the NODEMCU sends data to the MQTT broker on the raspberry PI and the latest values can be viewd by subscribing to the appropriate Topic.
Currently
- Battery Voltage 12.53V
- Ambient Temp 23deg C
- Tank Temp 91.94 deg C
- Booster temp 20.25 deg C
- inlet temp 32.56 deg C
Unfortunatley due to lead length constraints the inlet temp sensor is too close to the tank so reads substantialy high - a modified location is needed and the ambient temp senor needs to be moved away from the tank also as the actual temp is curently 17.5deg C
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.