<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Compact battery-powered motion + temperature + humidity project]]></title><description><![CDATA[<p dir="auto">Very compact battery powered project based on <a class="plugin-mentions-user plugin-mentions-a" href="/user/neverdie" aria-label="Profile: NeverDie">@<bdi>NeverDie</bdi></a> Arduino Pro Mini Shield for RFM69(H)W board (<a href="https://www.openhardware.io/view/268/Arduino-Pro-Mini-Shield-for-RFM69HW" rel="nofollow ugc">https://www.openhardware.io/view/268/Arduino-Pro-Mini-Shield-for-RFM69HW</a>) with attached a:</p>
<ul>
<li>Mini Pir motion sensor (<a href="https://www.aliexpress.com/item/New-Arrival-Mini-IR-Pyroelectric-Infrared-PIR-Motion-Human-Sensor-Automatic-Detector-Module-high-reliability-12mm/32749804501.html" rel="nofollow ugc">https://www.aliexpress.com/item/New-Arrival-Mini-IR-Pyroelectric-Infrared-PIR-Motion-Human-Sensor-Automatic-Detector-Module-high-reliability-12mm/32749804501.html</a>)</li>
<li>SHT21 temperature + humidity sensor (<a href="https://www.aliexpress.com/item/HTU21D-SHT21-IIC-I2C-Digital-Temperature-Humidity-Sensor-Breakout-Board-Module-For-Weather-Stations-Humidor-Control/32846196764.html" rel="nofollow ugc">https://www.aliexpress.com/item/HTU21D-SHT21-IIC-I2C-Digital-Temperature-Humidity-Sensor-Breakout-Board-Module-For-Weather-Stations-Humidor-Control/32846196764.html</a>)</li>
</ul>
<p dir="auto">I'd warmly recommend that PIR sensor, it's tiny, it works down to 2.7v (so not requiring any voltage regulator for this 3.3v project especially if the arduino runs at 1Mhz like all my boards), consumes nothing and produces very little false positives.</p>
<p dir="auto">Code and pictures down below.</p>
<pre><code>/**********************************
 * MySensors node configuration
 */

// General settings
#define SKETCH_NAME "Pir"
#define SKETCH_VERSION "1.0"
//#define MY_DEBUG
#define MY_NODE_ID 6

// RFM69 radio settings
#define MY_RADIO_RFM69
//#define MY_RFM69_FREQUENCY RFM69_433MHZ
#define MY_IS_RFM69HW
#define MY_RFM69_NEW_DRIVER
//#define MY_RFM69_ENABLE_ENCRYPTION
#define MY_RFM69_NETWORKID 110
//#define MY_DEBUG_VERBOSE_RFM69
//#define MY_RF69_IRQ_PIN D1
//#define MY_RF69_IRQ_NUM MY_RF69_IRQ_PIN
//#define MY_RF69_SPI_CS D2
//#define MY_RFM69_ATC_MODE_DISABLED

// Advanced settings
#define MY_BAUD_RATE 9600
//#define MY_SMART_SLEEP_WAIT_DURATION_MS 500
#define MY_SPLASH_SCREEN_DISABLED
//#define MY_DISABLE_RAM_ROUTING_TABLE_FEATURE
//#define MY_SIGNAL_REPORT_ENABLED

/***********************************
 * NodeManager modules for supported sensors
 */

#define USE_BATTERY
#define USE_SIGNAL
#define USE_CONFIGURATION
#define USE_SHT21
#define USE_INTERRUPT

/***********************************
 * NodeManager built-in features
 */

// Enable/disable NodeManager's features
#define FEATURE_DEBUG ON
#define FEATURE_POWER_MANAGER ON
#define FEATURE_INTERRUPTS ON
#define FEATURE_CONDITIONAL_REPORT OFF
#define FEATURE_EEPROM OFF
#define FEATURE_SLEEP ON
#define FEATURE_RECEIVE ON
#define FEATURE_TIME OFF
#define FEATURE_RTC OFF
#define FEATURE_SD OFF
#define FEATURE_HOOKING OFF

/***********************************
 * Load NodeManager Library
 */

#include "NodeManagerLibrary.h"
NodeManager node;

/***********************************
 * Add your sensors below
 */

// built-in sensors
SensorBattery battery(node);
SensorConfiguration configuration(node);
SensorSignal signal(node);

// Attached sensors
SensorSHT21 sht21(node);
SensorMotion motion(node,3);

/***********************************
 * Main Sketch
 */

// before
void before() {
  // setup the serial port baud rate
  Serial.begin(MY_BAUD_RATE);
  /*
  * Configure your sensors below
  */

  // battery sensor
  battery.setMinVoltage(1.8);
  battery.setMaxVoltage(3.2);
  
  // pir sensor
  motion.setInterruptMode(RISING);
  motion.setInitialValue(LOW);

  // sht21 sensor
  sht21.setReportIntervalMinutes(5);

  // node configuration
  node.setSleepMinutes(5);
  
  /*
  * Configure your sensors above
  */
  node.before();
}

// presentation
void presentation() {
  // call NodeManager presentation routine
  node.presentation();
}

// setup
void setup() {
  // call NodeManager setup routine
  node.setup();
}

// loop
void loop() {
  // call NodeManager loop routine
  node.loop();
}

#if FEATURE_RECEIVE == ON
// receive
void receive(const MyMessage &amp;message) {
  // call NodeManager receive routine
  node.receive(message);
}
#endif

#if FEATURE_TIME == ON
// receiveTime
void receiveTime(unsigned long ts) {
  // call NodeManager receiveTime routine
  node.receiveTime(ts);
}
#endif
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1532192273327-1.png" alt="0_1532192269076_1.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1532192286822-2.png" alt="0_1532192281955_2.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.mysensors.org/topic/9523/compact-battery-powered-motion-temperature-humidity-project</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Jul 2026 19:42:44 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/9523.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 21 Jul 2018 17:08:59 GMT</pubDate><ttl>60</ttl></channel></rss>