Needles to say and re-say this is really a much needed plugin for us beginners!
Made a bunch of battery operating nodes with only DHT22 and all are working flawlessly.
Today I tried making a node using a DS18B20 and DHT22. DS18B20 connected to digital pin 3 and DHT22 to digital pin 4. Both sensors have 10K resistors between their vcc and data lines (tried without resistors but none of the sensors worked).
Sketch compiles and uploads fine to a Arduino Pro Mini 328 3.3v 8MHz. It also connects to the gateway, but I run into some problems;
The first one being that watching from the serial debug, the node strarts up, connects to the gateway, reports some data and then hangs. No more activity from the node watching on the serial debug.
The second one is that the node never sleeps - Activity led on Arduino Pro Mini remains lit.
The last one is that DS18B20 reports the Temp to the gateway but DHT22 reports only Temp and not the Humidity. Tried changing pins for the sensors, but the same.
Connection logs (from the serial interface) are as follows:
REG I=1 P=3 P=6 T=0
REG I=2 P=4 P=6 T=0
REG I=3 P=4 P=7 T=1
NodeManager v1.4
INT1 M=255
INT2 M=255
RADIO OK
PRES I=200, T=23
PRES I=201, T=30
BATT V=3.44 P=100
SEND D=0 I=201 C=0 T=38 S= I=0 F=3.44
PRES I=1 T=6
PRES I=2 T=6
PRES I=3 T=7
READY
MY I=199 M=1
DS18B20 I=1 T=47.75
SEND D=0 I=1 C=0 T=0 S= N=0 F=47.75
DHT I=2 T=25.00
SEND D=0 I=2 C=0 T=0 S= N=0 F=25.00
And the sketch I use is as follows:
/*
NodeManager is intended to take care on your behalf of all those common tasks a MySensors node has to accomplish, speeding up the development cycle of your projects.
NodeManager includes the following main components:
- Sleep manager: allows managing automatically the complexity behind battery-powered sensors spending most of their time sleeping
- Power manager: allows powering on your sensors only while the node is awake
- Battery manager: provides common functionalities to read and report the battery level
- Remote configuration: allows configuring remotely the node without the need to have physical access to it
- Built-in personalities: for the most common sensors, provide embedded code so to allow their configuration with a single line
Documentation available on: https://github.com/mysensors/NodeManager
*/
// load user settings
#include "config.h"
// load MySensors library
#include <MySensors.h>
// load NodeManager library
#include "NodeManager.h"
// create a NodeManager instance
NodeManager nodeManager;
// before
void before() {
// setup the serial port baud rate
Serial.begin(MY_BAUD_RATE);
/*
* Register below your sensors
*/
nodeManager.setBatteryMin(2.0);
nodeManager.setBatteryMax(3.3);
nodeManager.setSleep(SLEEP,60,SECONDS);
nodeManager.registerSensor(SENSOR_DS18B20,3);
nodeManager.registerSensor(SENSOR_DHT22,4);
/*
* Register above your sensors
*/
nodeManager.before();
}
// presentation
void presentation() {
// Send the sketch version information to the gateway and Controller
sendSketchInfo(SKETCH_NAME,SKETCH_VERSION);
// call NodeManager presentation routine
nodeManager.presentation();
}
// setup
void setup() {
// call NodeManager setup routine
nodeManager.setup();
}
// loop
void loop() {
// call NodeManager loop routine
nodeManager.loop();
}
// receive
void receive(const MyMessage &message) {
// call NodeManager receive routine
nodeManager.receive(message);
}
Also on config.h I have enabled DS18B20 and DHT22 modules.
Really, any help would be welcome!
Thanks all in advance!