0

I want to make a wifi-enabled temperature sensor and place it inside my HVAC system to measure and push the temperature to a central server, every minute or so.

I have a LoLin NodeMcu v3 unit laying around, and I am wondering if it is possible to use this one - and have it last for many years inside the HVAC system?

I realize the LoLin unit has a onboard wifi chip, I also realize LoLin takes 3v input. Aside from that, I am pretty blank.

Yesterday I tested the LoLin board by programming it with the following code, which lists networks in the vicinity. It worked great:

#include "ESP8266WiFi.h"

void setup() {
  Serial.begin(9600);
  // Set WiFi to station mode and disconnect from an AP if it was previously connected
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(2000);
  Serial.println("Setup done");
}

void loop() {
  Serial.println("scan start");


  int n = WiFi.scanNetworks();// WiFi.scanNetworks will return the number of networks found
  Serial.println("scan done");
  if (n == 0)
    Serial.println("no networks found");
  else
  {
    Serial.print(n);
    Serial.println(" networks found");
    for (int i = 0; i < n; ++i)
    {
      // Print SSID and RSSI for each network found
      Serial.print(i + 1);
      Serial.print(": ");
      Serial.print(WiFi.SSID(i));
      Serial.print(" (");
      Serial.print(WiFi.RSSI(i));
      Serial.print(")");
      Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*");
      delay(10);
    }
  }
  Serial.println("");

  // Wait a bit before scanning again
  delay(5000);
}

The actual question

Is the LoLin board a feasible board for making a low power wifi enabled temperature sensor? Or should I rather make board that communicates with a wall-connected parent unit via radio?

closed as off-topic by Mattia, jfpoilpret, Dat Ha, Roberto Lo Giacco, Code Gorilla Nov 18 '16 at 13:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Arduino, within the scope defined in the help center." – jfpoilpret, Dat Ha, Roberto Lo Giacco, Code Gorilla
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    What part of that is your actual question? – Majenko Oct 28 '16 at 10:55
  • Execllent question @majenko. Thanks for pointing that out ;-) – nitech Oct 28 '16 at 10:59
  • How are you thinking of powering it? – Majenko Oct 28 '16 at 10:59
  • I was thinking a battery. Any battery. – nitech Oct 28 '16 at 11:01
2

Yes, the NodeMCU can connect to a temperature sensor and forward that on to your WiFi access point to send to the internet.

Yes, the NideMCU can run from batteries.

Can it do it off one battery for many years? Only if that battery contains a small nuclear reactor.

Running something from battery for many years requires incredibly close attention to detail and incredibly tight component specifications, even down to the precise battery chemistry used. It's a very very difficult task for which people are very highly paid.

When you start looking at periods like that you begin to run up against the problem of battery self-discharge. Getting your power consumption down to an absolute minimum is a must, but even then if you have near zero power consumption the battery is still going to go flat by itself. So you have to invest time and effort into selecting a battery technology with a very low self-discharge.

All that is pretty moot though with the NodeMCU since:

  • WiFi is a power hungry technology. You can expect hundreds of mA while transmitting, and doing that once a minute for, say, 10 seconds (reconnecting to the WiFi takes time) will give you quite a high average power consumption just from the WiFi
  • The NodeMCU is far from optimised WRT power consumption. Linear voltage regulators, poor choice of components for low power consumption, etc, abound.

So yes you can run it from batteries, but be prepared to replace the batteries very often. By "very often" I mean every couple of days.

That means you basically have two options:

  1. Don't use the NodeMCU but instead use something designed to be incredibly low power and run for long periods on battery (typically it won't use WiFi but something more efficient like nRF24L01+)
  2. Don't use batteries. Hard-wire your NodeMCU into a mains-connected power supply.
  • 1
    Great answer @majenko. Thanks for taking the time to educate newbies like me :-) – nitech Oct 28 '16 at 11:13
  • 1
    You're welcome. Incidentally, my current wireless keyboard uses the nRF24L01+ (actually a Nordic MCU with built-in nRF24L01+) and runs from two AAA batteries. I have had it a number of years now, and it is still on the same batteries it came with. So it is possible if done the right way, but it takes expertise to do it. – Majenko Oct 28 '16 at 11:15
  • Interesting. I had a chat with representatives from Nordic Semiconductors at NDC Oslo a few years ago, and I had the impression they could sell me IoT-devices with years of battery capacity (off a coin battery). They were probably Bluetooth 4 (?) devices. – nitech Oct 28 '16 at 11:19
  • 1
    Most likely nRF24L01+ based devices using a gateway to the internet. There's a new technology these days specially for IoT - LoRa - which is low power and long range designed to work with municipal-grade carrier gateways. There's a big one in Munich. – Majenko Oct 28 '16 at 11:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.