Hey 👋!
DFRobot recently made a new product, and what else is there to do besides immediately get it and test it out?
The new product, called BLE Sensor Beacon Pack has an endless number of possibilities for projects! I will be making a whole home wireless motion sensor network for security purposes.
What is itThe DFRobot BLE Sensor Beacon Pack contains 5pcs of BLE Sensor Beacons. The beacon is a small device based on the IN100 chip, that is capable of being run on a single coin cell battery, has a built-in 11-bit ADC and multiple I/Os that can be multiplexed to SDA/SCL, Bluetooth capabilities for broadcasting, and a very low power consumption of 650nA while sleeping!
These features mean these devices are capable of being interfaced with digital, analog, and I2C components, and can broadcast the gathered data over Bluetooth, all while being powered by a coin cell battery.
Here are the features listed under the product information:
- Operation Current: <10mA
- Input signal: Digital,Analog, I2C
- Operation voltage: 1.1~3.6V DC
- Interface: 2*8P Pinhole CR2032 Button Cell Holder
- Maximum number of simultaneously connected sensors: Digital/ Analog*1+I2C*1
- Operating Frequency: 2.4GHz ISM
- Modulation: GFSK
- Modulation: +5.0dBm
- PCB Size: 35mm*42mm
- ADC Precision: 11bit
- The number of pins that could be used as SDA/SCL: 5
- Mounting Hole Size: Inner diameter of 2mm/outer diameter of 4mm
A note for all those Arduino enthusiasts out there:
This device does not use the Arduino IDE, and requires no coding! Any devices such as ESP32 that you interface with it via Bluetooth will require regular programming though. Read on for more info.
What You NeedYou only need a few things to get these beacons up and running!
You will need:
- DFRobot BLE Sensor Beacon Pack
- 6in1 USB to Serial Converter
- CR2032 Coin Cell Batteries
- HC-SR501 PIR Motion Sensors
- Computer with NanoBeacon tool installed
- Batteries (3.7V Li-ion, or 3x AA/AAA)
The first thing you need to do is download and install some software needed to configure the devices. This software essentially replaces the Arduino IDE for these modules.
Recommended Mobile App: NanoBeacon BLE Scanner for iOS/Android
Beacon Configuration Tool: NanoBeacon Configuration Tool
Download the app for mobile, and download and install the config tool for your PC, and you're ready to go!
To interface these devices with ESP32 over Bluetooth, make sure you have ESP32 installed in your Arduino IDE; if you don't, you can use this tutorial.
IMPORTANT INFORMATIONProgramming Note: The module can only be burned once, do not click "Burn/Program" directly to burn before confirming the configuration information. You can test the module by "Run in RAM", and "Run in RAM" can be used unlimited times before burning, and the system will be reset after power failure.
ADC Note: The input voltage of the module's ADC interface must not exceed 1.6V. If the voltage of the accessed sensors may exceed 1.6V, the sensors need to be connected to GPIO6, which adds 2.06 times the divider resistor to support an input voltage of up to 3.3V.
(The above information is taken from the wiki)
These devices can only be burned once! You can test configurations for an unlimited amount of times though by selecting "Run in Ram".
DO NOT PRESS "Burn/Program" WITHOUT COMPLETELY VERIFYING EVERYTHING FIRST!!
A good rule of thumb is to test everything possible beforehand on an Arduino or ESP32. This is especially important for projects involving I2C communication.
Configuration Tool Configuration FilesConfiguration files are files stored in the tool's directory that can be loaded in. They contain all the settings needed for a particular project. This is very useful for quickly programming a new device and is a way to "save" your settings for a particular setup.
My config files are located in this file path on my Mac:
/Users/kgray/Library/Logs/nanobeacon
Note: Any configuration files associated with this tutorial should be placed in this directory, as this is the default location for the files, although it is not necessary.
To program a device using a configuration file, watch the short screen recording below:
The PIR motion sensor! A wonderfully versatile component used in many things. We will be using the HC-SR501 sensor for Arduino. There is one problem with this sensor though; it requires 5V!
This is undesirable when the project we want to power is battery-powered. I found a way to fix this problem partially though. With some intense brainstorming and one simple modification, I was able to power the sensors off of 3.3V, rather than 5V. This means though that a 3V coin cell battery can't be used to power this project, but instead I will be using a single-cell li-ion battery which has a nominal voltage of 3.7V.
It requires at least 3.3V to work still because the main chip (the BISS0001) needs a minimum of 3.3V.
This is the circuit of the HC-SR501:
If you look carefully, pin 3 on JP1 (jumper 1) connects directly to the output of the voltage regulator (7133-1), and thus can supply the device with 3.3V!
By simply wiring the 3.3V (or battery) to the pin as in the photo above, it can be powered.
POWER INFOAfter way too much time and way too much effort in getting my devices to work, I have found that the best way to power the beacon is to use a very low dropout (LDO) voltage regulator. The beacon needs a voltage from 1.1 to 3.6V to operate correctly, but sadly I only have 3.3V regulators on hand. This would normally be fine, but a 3.7V Li-ion battery is fully discharged at ~3.2V. After trying many different ways of powering the beacon, I decided to use buck-boost modules from DFRobot (link). These consume ~150µA of quiescent current, which is quite low.
The SetupMy system design is quite simple. I will have multiple IN100 PIR devices posted around my house, and they all communicate to a center ESP32 device. The ESP32 receives the motion data from all the wireless motion devices, and uploads the status of each device to a self hosted webpage. You can also turn on/off a "security" feature on the webpage, that tells the ESP32 to notify you using IFTTT whenever there is motion on that specific device.
Parts needed:Above parts (refer to what you need)
HC-SR501 PIR sensor
FireBeetle ESP32 (I used the ESP32-C6)
Batteries (coin cell or lithium cells, although I recommend the latter)
Buck-boost modules
Scroll to the bottom of this tutorial to download the "PIR.cfg" file.
Wire the motion sensor to the beacon as pictured below:
The battery is directly connected to the motion sensor as described in the previous "PIR Motion Sensors" section. The output of the motion sensor goes to IO6, as that is the only beacon pin that has a voltage divider for 3.3V.
Comments
Please log in or sign up to comment.