sensors_and_actuators:mysensors:d-diot_battery_powered_multisensor

Multisensor

This battery powered multi-sensor is based on the MySensors platform and offers the following functionalities:

  • Motion detection (PIR AS312)
  • Temperature detection (Si7021)
  • Humidity detection (Si7021)
  • Light detections (photoresistor)

The node is built with the BT-Pcb-328P board which has multiple power options and supports both radio modules: RFM69 (868 Mhz) and NRF24 (THT and SMD), but on the basis of my tests the best combination in terms of:

  • battery life
  • range of the wireless transmission
  • PIR reliability (no false positive)

is the RFM69 radio module (868 Mhz) and 2 x AAA batteries (rechargeable or alkaline). In this configuration with only the motion LED enabled in blink mode, the expected batteries life should be more than 1 year. The tested batteries life with all the LEDs enabled at full brightness and the motion LED always on when the motion is detected is 2 months.

The node can also act as repeater for other nodes (see more in the firmware), but the battery life will be shortened, so for this special use case the best option is to power the node with a standard cellphone charger through the micro USB port.

Under the Fresnel lens of the PIR 5 LEDs are present:

  • Radio Error → RED
  • Radio Transmission → YELLOW
  • Radio Reception → GREEN
  • Motion detection → BLU
  • External power / low battery → YELLOW

By default this LEDs are enabled and set at full brightness and the motion LED stays on until the AS312 PIR is triggered, but if you don't wont too much annoying light in your home, you can easily change this behaviour in the firmware.

The d-diot battery powered multisensor is built with the d-diot BT-Pcb-328P board.

The schematic and the entire Kicad project are available for download in the dedicated d-diot github repository. In the repository, here you can find the gerber files of the PCB, so you can easily get 10 boards with about 5€ using an online PCB manufacturer like JLCPCB or PCB way.

Click the button below to download the complete set (zip) of gerber files necessary for the manufacturing of the latest version of the board available.

Download Gerber BT-Pcb-328P v.3.0

or order the PCB directly from PCBWay.

Order your board with PCBWay

The brain of the node is the well known microcontroller ATMega328P-AU, which is the same MCU used in the Aruino UNO, Arduino Nano and Arduino Pro mini, so the sketches and the libraries of the Arduino platform are fully compatible. The MCU is available in generic e-commerce platforms for 1 - 2 euros.

For the radio module you have a multiple choice. You can use an RFM69HW (868 Mhz) radio module or an NRF24L01+ radio module (SMD or THT). If you choose the RFM69HW radio module, you need also an external antenna that must be soldered in J4. This antenna can be a helical antenna like the one in the picture below, but also a piece of solid wire with the length of 8.6 cm should work fine.

This module is available as a breakout board on the market for around 2€ and it can be found in two version: I2C and SPI. The BT-Pcb-328P has a header (J5) to mount the I2C version (4 PIN - see the picture below).

The Si7021 provides the following envinromental data:

  • Temperature measurements with an accuracy of +/- 0.4°C in a range of -10°C to 85°C
  • Relative humidity measurements with an accuracy of +/- 3% in a range of 0% - 100%

This component is responsible for the motion detection. It can be found in generic electronic stores for less than 1€ (for example, see here).

For a proper functionality of the sensor, you need also a standard Fresnel lens (see picture below), like the one used for the very common HC-SR501 PIR module. The lens are available on the market for few cents (see here for example)

This simple component (GL5537) is available on the market in generic e-commerce platforms or in electronics parts stores for few cents.

With the appropriate circuit, like the one present in the BT-Pcb-328P board, this component can provide the light level of the ambient.

For the CR2032 battery, any holder with a footprint like the Keystone 1058 is suitable. For example, I have used this.

For the AAA batteries, contacts like the Keystone 5204 and Keystone 5226 are suitable. For example I have used this.

The list of the other electronic components required is reported below.

References Value Description Footprint Quantity
C1 22uF-Tantalum Tantalum capacitor 22 uF code TAJB226M016RNJ CAPPC3528X210N 1
C14 47uF Electrolytic capacitor 47 uF 5×5.4 mm CP_Elec_5x5.4 1
C13 100uF Electrolytic capacitor 100 uF 6.3 x 5.4 mm CP_Elec_6.3×5.4 1
C3 C4 C5 C6 C7 C10 C12 0.1uF Capacitor 0.1 uF – SMD package 0805 C_0805_2012Metric 7
C2 C9 10uF Capacitor 10 uF – SMD package 0805 C_0805_2012Metric 2
C8 100uF-Tantalum Tantalum capacitor 100 uF code TAJD107K016RNJ TAJD107K016RNJV 1
R1 R2 R4 10K Resistor 10 Kohm – SMD package 0805 R_0805_2012Metric 3
R8 R11 R12 R13 330 Resistor 330 Ohm – SMD package 0805 R_0805_2012Metric 4
R3 R5 20K Resistor 20 Kohm – SMD package 0805 R_0805_2012Metric 2
R7 56K Resistor 56 Kohm – SMD package 0805 R_0805_2012Metric 1
R10 120 Resistor 120 Ohm – SMD package 0805 R_0805_2012Metric 1
L1 22uH Inductor 22 uH 6.3 x 6.3 mm (SMNR6028-220MT) L_6.3×6.3_H3 1
D4 D5 Y-LED LED – Yellow – SMD package 0805 LED_0805_2012Metric 2
D2 R-LED LED – Red – SMD package 0805 LED_0805_2012Metric 1
D3 B-LED LED – Blue – SMD package 0805 LED_0805_2012Metric 1
D6 G-LED LED – Green – SMD package 0805 LED_0805_2012Metric 1
D1 SS14 Schottky diode – code SS14 – SMD package DO-214AC SS14 1
U1 AMS1117-3.3 Linear voltage regulator 3.3V code AMS1117-3.3 SOT-223-3_TabPin2 1
U5 ME2188C33 Boost converter code ME2188C33M5 – SMD package SOT-23-5 SOT-23-5 1
SW1 SW2 1437566-3 Tactile push button – SMD 3x6x2.5 mm SW_1437566-3 2
Q2 Q3 Q6 FDN337N N-Mosfet – Code FDN337N – SMD package SSOT-3 SSOT-3 3
Q1 FDN338P P.RATA()-Mosfet – Code FDN338P – SMD package SSOT-3 SSOT-3 1
J6 Vin 1 x 02 Male Pin header – Veritcal pitch 2.54 mm PinHeader_1x02_P2.54mm_Vertical 1
J3 ICSP 2 x 03 Male Pin header – Veritcal pitch 2.54 mm PinHeader_2x03_P2.54mm_Vertical 1
J2 FTDI 1 x 06 Female (or male) Pin header – Veritcal pitch 2.54 mm PinSocket_1x06_P2.54mm_Vertical 1
J1 USB_B_Micro Micro USB port SMD – LCSC code C10418 USB_Micro-B_Molex-105017-0001 1

The following components are optional.

References Value Description Footprint
U6 ATSHA204A SOT-23_Handsoldering
C11 0.1uF Capacitor 0.1 uF – SMD package 0805 C_0805_2012Metric
R9 10K Resistor 10 Kohm – SMD package 0805 R_0805_2012Metric
P1 MYSX_2.6 2 x 11 Male Pin header – Veritcal pitch 2.54 mm MYSX_2.6

The ATSHA204A IC, the capacitor C11 and the resistor R9 are necessary only if you need the hardware signing functionality of the MySensors library. Please note that the security and signing features can be enabled also without dedicated hardware using software signing.

The pin header on the MYSX 2.6 connector should be soldered only if you need to attach other hardware to the BT-Pcb-328P board.

The 3d model files and the print instructions of the case are available in thingiverse.

If you don't have access to a 3d printer, you can consider an online 3d printing service.

To complete the build you need the following parts:

  • 1 x M2.5 self tapping screw
M2.5 self tapping screw

A cost estimation of the entire node (battery excluded) is reported below:

Part Cost €
AtMega32p-au MCU ~1.50
Radio Module ~2.00
Si7021 Temp. Hum. sensor ~2.00
AS312 PIR sensor and Fresnel Lens ~1.50
Battery Holder ~0.10
Photoresistor ~0.05
All other required electronic components ~1.75
BT-Pcb-328P board ~0.50
3d printable case ~0.50
Total ~9.90

So for about 10€ you can build your own wireless multisensor.

Well, this is the most time consuming part of the building, but once you have started the print job, you don't have too much to do except watching your 3d printer at work, so you can proceed with the other steps.

The model files and print instruction are here.

The top and bottom parts of the case can be printed in about 2 hours each, with a layer height of 0.2 mm.

Some components are THT, while some other are SMD, but generally with a 0805 package that is not so difficult to handle. The tools required for soldering the components of this board are the same of the d-diot board. See this to know what tools you need.

Use the interactive BOM tool to see where to place each component

The soldering process is divided in two parts for precaution; in fact if your programmer and FTDI adapter used for flashing the bootloader and the firmware does not have a voltage selector or if you don't select the 3.3V by mistake, you could damage the radio module that in most cases will not survive to a Vcc voltage above 3.3V.

The MCU works fine at 5V, so the flash of the bootloader and the firmware upload steps have been anticipated prior to the soldering of sensitive components.

Soldering - part 1

Solder the following components on the board:

  • ATmega328P MCU (U3)
  • SS14 diode (D1)
  • FTDI header (J2)
  • ICSP header (J3)
  • Capacitors C3, C4, C5, C6 and C12
  • Resistor R2
  • Reset push button (SW1)

Burn the 1 Mhz MySensorsBootloader

With all the components of step above in place, you can proceed with the flashing of the “ATMega328p with MYSBootloader 1.3.0” which is necessary to the proper functionality of the node.

Connect your programmer (USBasp in the picture below) to the ICSP header (J3) of the board and proceed according to this guide.

Upload the firmware

Connect your FTDI programmer to the FTDI header (J2) of the board and proceed according to this guide.

Soldering - part 2

Solder all the remaining components. The assembled board should look like this.

You can leave the two jumper JP2 and JP3 open. See the schematic if you want to know more about this jumper

Place the board inside the front part of the case and secure it with the M2.5 screw.

Insert the batteries and close with the rear part of the case.

The source code of the firmware is available here. Follow this guide to know how to upload the firmware to your node.

The configuration parameters are in the following files:

The comments above each parameter should be self-explanatory, but if you need more assistance visit the dedicated topic in the forum.

  • sensors_and_actuators/mysensors/d-diot_battery_powered_multisensor.txt
  • Last modified: 2021/12/27 14:17
  • by franzunix