Navigation

    • Register
    • Login
    • Search
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. user2684
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    user2684

    @user2684

    Contest Winner

    179
    Reputation
    416
    Posts
    2901
    Profile views
    3
    Followers
    0
    Following
    Joined Last Online

    user2684 Follow
    Contest Winner

    Best posts made by user2684

    • NodeManager: plugin for a rapid development of battery-powered sensors

      Hi, being a newbie in this wonderful MySensors world, I found myself excited about the flexibility of the overall platform but also somehow implementing the same common functionalities across my sensors over and over again. I decided then to spend some reasonable amount of time to expand the idea behind MyExtention (https://forum.mysensors.org/topic/6062/myextension) into something I have called NodeManager (I know, I'm bad with names!).

      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. It should help who is new to MySensors to get up to speed quicker and for those already into the matter to delegate to NodeManager common and boring tasks so to focus on more interesting scenarios.

      NodeManager main features are:

      • Manage all the aspects of a sleeping cycle by leveraging smart sleep
      • Allow configuring the sleep mode and the sleep duration remotely
      • Allow waking up a sleeping node remotely at the end of a sleeping cycle
      • Allow powering on each connected sensor only while the node is awake to save battery
      • Report battery level periodically and automatically
      • Calculate battery level without requiring an additional pin and the resistors
      • Report battery voltage through a built-in sensor
      • Can report battery level on demand
      • Allow rebooting the board remotely
      • Provide out-of-the-box sensors personalities and automatically execute their main task at each cycle

      Specifically on this last point, the idea behind providing built-in the functionalities of most common sensors is to simplify the development especially for somebody new to it.
      E.g. if I connect a thermistor to one of the pin, I just need a single line to have it working, as it was leveraging some sort of embedded firmware:

      nodeManager.registerSensor(SENSOR_THERMISTOR,A2);
      

      The following built-in sensors are available:

      • SENSOR_ANALOG_INPUT Generic analog sensor, return a pin's analog value or its percentage
      • SENSOR_LDR LDR sensor, return the light level of an attached light resistor in percentage
      • SENSOR_THERMISTOR Thermistor sensor, return the temperature based on the attached thermistor
      • SENSOR_DIGITAL_INPUT Generic digital sensor, return a pin's digital value
      • SENSOR_DIGITAL_OUTPUT Generic digital output sensor, allows setting the digital output of a pin to the requested value
      • SENSOR_RELAY Relay sensor, allows activating the relay
      • SENSOR_LATCHING_RELAY Latching Relay sensor, allows activating the relay with a pulse
      • SENSOR_DHT11 DHT11 sensor, return temperature/humidity based on the attached DHT sensor
      • SENSOR_DHT22 DHT22 sensor, return temperature/humidity based on the attached DHT sensor
      • SENSOR_SHT21 SHT21 sensor, return temperature/humidity based on the attached SHT21 sensor
      • SENSOR_SWITCH Generic switch, wake up the board when a pin changes status
      • SENSOR_DOOR Door sensor, wake up the board and report when an attached magnetic sensor has been opened/closed
      • SENSOR_MOTION Motion sensor, wake up the board and report when an attached PIR has triggered
      • SENSOR_DS18B20 DS18B20 sensor, return the temperature based on the attached sensor

      I put the package on Sourceforce so to avoid leaving here piece of code which may become obsolete in a short time.

      The project is here: https://sourceforge.net/projects/mynodemanager
      I've also tried to document everything the best as I could on https://sourceforge.net/p/mynodemanager/wiki

      Thanks

      posted in NodeManager
      user2684
      user2684
    • NodeManager v1.8 now available!

      NodeManager v1.8 is finally here!

      With 8 months of development from 12 different contributors, the new NodeManager v1.8 ships now as an Arduino library to allow an easier integration, a more consistent upgrade process across the versions and a simpler way of using it.

      This version includes also a number of enhancements and bug fixes, a better integration with the MySensors library (including the capability to use the web-based Log Parser) and support for an additional 11 new sensors, with a grand total of 62 built-in sensors that can be added to your project by just a single line of code.

      NodeManager v1.8 can be downloaded directly from Github https://github.com/mysensors/NodeManager where detailed installation instructions are also provided.
      Please read the README file carefully before starting so to get a sense on how to use it or what has changed from the previous releases.

      The full release notes for this version are listed below:

      • Split NodeManager's core classes in individual files and each sensor code in its own dedicated header file
      • New Arduino-compatible library structure to allow easier integration and more consistent updates across version
      • Included a complete set of examples which can be loaded directly from the Arduino IDE
      • Simplified the template sketch with a global nodeManager object and sensors that can be imported directly from there
      • Debug output is now fully compatible with the one used by the MySensors library and integrated into MySensors LogParser
      • Better control on how often, if and when to sync the time with the controller for time-aware nodes
      • Added a Measure Timer so to allow splitting between taking measures and reporting
      • Added support for every sensor to keep track of the last value assigned to a child in EEPROM and restoring it upon a reboot
      • Introduced new capabilities for reporting every minute/hour/day or only at a given minute/hour/day
      • Added ability to read from the serial port at the end of each loop cycle, useful for debugging interactive sensors
      • Added support for pH sensor
      • Added support for PCA9685 as RGB/RGBW/W dimmer
      • Added support for DSM501A dust sensor
      • Added support for PN532 NFC RFID module
      • Added support for CCS811 CO2/VOC sensor
      • Added support for MPR121 Capacitive Touch Sensor
      • Added support for serial GSM/SMS device
      • Added support for FPM10A fingerprint sensor
      • Added support for SDS011 Air quality sensor
      • Added support for ESP32 devices
      • Added support for nRF52 radio
      • Improved SensorDigitalInput and NeoPixelSensor
      • Si7021 sensor is now using the library from the MySensors example
      • Reviewed the MQ Sensor implementation
      • Optimized memory utilization
      • Added Travis Continuous Integration tests
      • Fixed wrong battery report when using battery pin and SensorRain/SensorSoilMoisture
      • Fixed DigitalOutput safeguard not working as expected
      • Fixed radio signal level reporting wrong values
      • Fixed SensorLatchingRelay2Pins wrong pin selection
      • Other minor bug fixes
      posted in NodeManager
      user2684
      user2684
    • Clock with temperature, humidity and CO2 level sensors

      My bedside alarm clock recently got broken so I decided to build up one by myself.
      The prototype looks like that:
      0_1529326386412_1.png

      • 1: arduino pro mini 3.3v
      • 2: RFM69 radio
      • 3: MQ135 sensor to measure CO2 level
      • 4: 20k/10k voltage divider to connect the MQ AO pin to an analog pin of the arduino (the MQ sensor runs at 5v, the arduino at 3.3v so we need to "scale" the output)
      • 5: DS3231 RTC so when the power goes down the node will be able to restore its clock even without requesting time to the controller
      • 6: SHT21 sensor for temperature and humidity
      • 7: SSD1306 OLED display 128x64

      The "production" version looks like this:
      0_1529326672488_2.png
      I'm again using the versatile EasyPCB from @sundberg84, here in the middle. The voltage divider has been soldered on the board, where battery measurement level is used to be placed. Of course Vin is not connected but instead it is used for MQ's AO pin connection.
      The SH21 and MQ sensors are just outside the box so to have accurate readings. The project is powered by 0.5€ USB ttl Chinese key which allows to power both the board (3.3v) and the MQ sensor (5v).
      I've also added a push button, hidden within the case which will request the time to the controller for the first initialization of the RTC.

      As for the code this is what I'm using based on NodeManager (with the latest SensorMQ code change not yet merged into the development branch):

      /**********************************
       * MySensors node configuration
       */
      
      // General settings
      #define SKETCH_NAME "Clock"
      #define SKETCH_VERSION "1.0"
      //#define MY_DEBUG
      #define MY_NODE_ID 1
      
      // RFM69 radio settings
      #define MY_RADIO_RFM69
      //#define MY_RFM69_FREQUENCY RFM69_433MHZ
      #define MY_IS_RFM69HW
      #define MY_RFM69_NEW_DRIVER
      
      /***********************************
       * NodeManager modules for supported sensors
       */
      
      #define USE_SIGNAL
      #define USE_SHT21
      #define USE_INTERRUPT
      #define USE_MQ
      #define USE_SSD1306
      
      /***********************************
       * NodeManager built-in features
       */
      
      // Enable/disable NodeManager's features
      #define FEATURE_DEBUG OFF
      #define FEATURE_POWER_MANAGER OFF
      #define FEATURE_INTERRUPTS ON
      #define FEATURE_CONDITIONAL_REPORT OFF
      #define FEATURE_EEPROM OFF
      #define FEATURE_SLEEP OFF
      #define FEATURE_RECEIVE ON
      #define FEATURE_TIME ON
      #define FEATURE_RTC ON
      #define FEATURE_SD OFF
      #define FEATURE_HOOKING ON
      
      /***********************************
       * Load NodeManager Library
       */
      
      #include "NodeManagerLibrary.h"
      NodeManager node;
      
      /***********************************
       * Add your sensors below
       */
      
      // built-in sensors
      SensorSignal signal(node);
      
      // Attached sensors
      SensorSHT21 sht21(node);
      SensorMQ mq(node,A0);
      DisplaySSD1306 ssd1306(node);
      SensorInterrupt button(node,3);
      
      /***********************************
       * Main Sketch
       */
      
      void syncTime(Sensor* sensor) {
        // update the time with the controller
        node.syncTime();
        // update the display
        ssd1306.onLoop(ssd1306.children.get(1));
      }
      
      // before
      void before() {
        // setup the serial port baud rate
        Serial.begin(MY_BAUD_RATE);
        /*
        * Configure your sensors below
        */
      
        // temperature/humidity sensor
        sht21.setReportIntervalMinutes(5);
      
        // gas sensor
        mq.setReportIntervalMinutes(5);
        mq.setRoValue(56842);
        mq.setCurveScalingFactor(38.35);
        mq.setCurveExponent(-2.74);
        
        // display
        ssd1306.setReportIntervalSeconds(30);
      
        // button
        button.setInitialValue(HIGH);
        button.setInterruptMode(FALLING);
        button.setInterruptHook(&syncTime);
        
        /*
        * 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 &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
      

      To show on the display only the information relevant for this project, I had to override DisplaySSD1306 onLoop() function in this way:

      void DisplaySSD1306::onLoop(Child* child) {
        long timestamp = now()+60*60*2;
        _oled->setCursor(0,0);
        // print the current date
        _oled->setFont(X11fixed7x14);
        _oled->print(F("    "));
        if (day(timestamp) < 10) _oled->print(F("0"));
        _oled->print(day(timestamp));
        _oled->print(F("-"));
        if (month(timestamp) < 10) _oled->print(F("0"));
        _oled->print(month(timestamp));
        _oled->print(F("-"));
        _oled->println(year(timestamp));
        // print the current time
        _oled->setFont(lcdnums12x16);
        _oled->set2X();
        if (hour(timestamp) < 10) _oled->print(F("0"));
        _oled->print(hour(timestamp));
        _oled->print(F(":"));
        if (minute(timestamp) < 10) _oled->print(F("0"));
        _oled->println(minute(timestamp));
        // print the sensors' data
        _oled->setFont(Adafruit5x7);
        _oled->set1X();
        _oled->println("");
        _oled->print(((ChildFloat*)_node->getChild(1))->getValueFloat());
        _oled->print(F("C "));
        _oled->print((int)((ChildFloat*)_node->getChild(2))->getValueFloat());
        _oled->print(F("% "));
        _oled->print(((ChildInt*)_node->getChild(3))->getValueInt());
        _oled->print(F("ppm"));
        _oled->clearToEOL();
      }
      

      Finally some pictures of the project once finalized:
      0_1529327416355_3.png

      0_1529327427911_4.png

      posted in My Project
      user2684
      user2684
    • RE: 💬 NodeManager

      Done! I've updated the documentation with four comprehensive examples including the full sketches

      posted in OpenHardware.io
      user2684
      user2684
    • RE: NodeManager: plugin for a rapid development of battery-powered sensors

      Hi, I've made an update of NodeManager in case can be of interest. Latest version v1.2 is available on https://sourceforge.net/projects/mynodemanager/.
      Short changelog:

      • Added out-of-the-box support for BH1750 light sensor
      • Added out-of-the-box support for HTU21D temperature and humidity sensor
      • Added out-of-the-box support for MLX90614 contactless temperature sensor
      • Added a few examples to the documentation (https://sourceforge.net/p/mynodemanager/wiki/NodeManager/#examples)
      • Fixed a few bugs
      posted in NodeManager
      user2684
      user2684
    • Inexpensive, analog, temperature and light sensor

      Hi,

      I couldn't find a similar project already posted here so in case somebody is interested in a very inexpensive temperature and light sensor, this can be easily implemented with a thermistor and a LDR (light dependent resistor). Probably the measurement is not as accurate as with other more complex sensors but in all my tests I've never had significant bias.

      The BOM is really cheap since a Thermistor can cost around 0.08$ (https://www.aliexpress.com/store/product/10pcs-Free-Shipping-10k-OHM-NTC-Thermistor-Resistor-NTC-MF52AT-10K-1-3950/110055_32412200713.html?spm=2114.12010615.0.0.iB5eTq) and a LDR around 0.04$ (https://www.aliexpress.com/store/product/Free-shiping-1000pcs-x-5528-Light-Dependent-Resistor-LDR-5MM-Photoresistor-wholesale-and-retail-Photoconductive-resistance/110055_2041703245.html?spm=2114.12010615.0.0.I9uWY1) so a pro mini + RF24 + the two sensors can be all even below the 3$.

      Wiring is simple as well, both the thermistor and the LDR have a pin connected to ground and the other connected to a (different) 10k resistor and an analog input. The resistors' other pin goes to vcc. In the (bad) picture below, the black connector goes to GND, the orange to VCC, the white to A1, the green to A2.

      0_1487525894727_IMG_2879.JPG

      Code is pretty simple as well. You basically need to read the analog input and in case of the thermistor apply its formula (https://en.wikipedia.org/wiki/Thermistor) while for the LDR if you like normalize the value to a percentage and invert it (when dark the analog read would be 1024 so I prefer having 0% in this case).

      I'm using my NodeManager (https://sourceforge.net/projects/mynodemanager/) to make things simple, having the node sleeping and reporting both the measures every 10 minutes and power on the sensors with two arduino pins just before reading the measures (otherwise even if sleeping, there will be some current going from VCC to GND):

      // 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(9600);  
        // instruct the board to sleep for 10 minutes for each cycle
        nodeManager.setSleep(SLEEP,10,MINUTES);
        // all the sensors' vcc and ground are connected to pin 6 (ground) and 7 (vcc. NodeManager will enable the vcc pin every time just before loop() and wait for 100ms for the sensors to settle
        nodeManager.setPowerPins(6,7,100);
        // register the sensors
        nodeManager.registerSensor(SENSOR_THERMISTOR,A1);
        nodeManager.registerSensor(SENSOR_LDR,A2);
        
        nodeManager.before();
      }
      
      // presentation
      void presentation() {
        // Send the sketch version information to the gateway and Controller
      	sendSketchInfo("AnalogTemperatureLight", "1.0");
        // call NodeManager presentation routine
        nodeManager.presentation();
      
      }
      
      // setup
      void setup() {
      }
      
      // loop
      void loop() {
        // call NodeManager loop routine
        nodeManager.loop();
      
      }
      
      // receive
      void receive(const MyMessage &message) {
        // call NodeManager receive routine
        nodeManager.receive(message);
      }
      
      
      

      If you want to read the values in the traditional way, the code would look like the following for the thermistor:

          int _nominal_resistor = 10000;
          int _nominal_temperature = 25;
          int _b_coefficient = 3950;
          int _series_resistor = 10000;
        // read the voltage across the thermistor
        float adc = analogRead(_pin);
        // calculate the temperature
        float reading = (1023 / adc)  - 1;
        reading = _series_resistor / reading;
        float temperature;
        temperature = reading / _nominal_resistor;     // (R/Ro)
        temperature = log(temperature);                  // ln(R/Ro)
        temperature /= _b_coefficient;                   // 1/B * ln(R/Ro)
        temperature += 1.0 / (_nominal_temperature + 273.15); // + (1/To)
        temperature = 1.0 / temperature;                 // Invert
        temperature -= 273.15;                         // convert to C
        if (! getControllerConfig().isMetric) temperature = temperature * 1.8 + 32;
      

      And this for the LDR:

        // read the value
        int adc= analogRead(_pin);
        value = 1024 - adc;
        // calculate the percentage
        int percentage = 0;
        float value = (float)adc;
        // scale the percentage based on the range provided
        float percentage = ((value - 0) / (1024 - 0)) * 100;
        if (percentage > 100) percentage = 100;
        if (percentage < 0) percentage = 0;
        
      

      Thanks

      posted in My Project
      user2684
      user2684
    • RE: 💬 NodeManager

      Every new version of NodeManager, I try to review and hopefully improve its architecture. This time looked like a simple and quick task but eventually ended up in a complete and deep review of the code. Many many many things have changed with the main objective to better integrate with the MySensors library and simplify the life of users willing to contribute or to add support for new sensors.

      The new file structure (with a dedicated file for each supported sensor) and the way the package is delivered (as an arduino library now) go into this direction. There are also included a good amount of new features but still in most of the cases, resulting a smaller code.

      All the details are available at https://github.com/mysensors/NodeManager/pull/391 which will be merged into the development branch shortly.

      Due to the many changes, if anybody would be willing to give it a try and report any bug, would be really great. Thanks!

      user2684 created this issue in mysensors/NodeManager

      closed Architecture Review #391

      posted in OpenHardware.io
      user2684
      user2684
    • RE: NodeManager: plugin for a rapid development of battery-powered sensors

      Hello All,

      NodeManager v1.6 is finally available! Download and upgrade instructions can be found as always on https://github.com/mysensors/NodeManager

      First of all I want to thank everybody contributing to the project, especially those who have submitted pull requests to the repository.

      In v1.6 we have 36 out-of-the-box sensors as well as a good number fixes and enhancements. The most notable are for sure the capability to customize any sensor remotely through a brand new remote API and a more flexible and effective way to configure reporting intervals and sleep cycles:

      • Introduced new remote API to allow calling almost ALL NodeManager's and its sensors' functions remotely
      • Reporting interval configuration is now indipendent from the sleep cycle
      • Reporting interval can be customized per-sensor
      • All intervals (measure/battery reports) are now time-based
      • Added support for BMP280 temperature and pressure sensor
      • Added support for RS485 serial transport
      • Added support for TSL2561 light sensor
      • Added support for DHT21 temperature/humidity sensor
      • Added support for AM2320 temperature/humidity sensor
      • Added support for PT100 high temperature sensor
      • Added support for MH-Z19 CO2 sensor
      • Added support for analog rain and soil moisture sensors
      • Added support for generic dimmer sensor (PWM output)
      • Added support for power and water meter pulse sensors
      • Radio signal level (RSSI) is now reported automatically like the battery level
      • SensorRainGauge now supports sleep mode
      • SensorSwitch now supports awake mode
      • SensorLatchingRealy now handles automatically both on and off commands
      • SensorMQ now depends on its own module
      • Added safeguard (automatic off) to SensorDigitalOutput
      • Any sensor can now access all NodeManager's functions
      • DHT sensor now using MySensors' DHT library

      For those who have previously forked the repository, please ensure to merge the updated development branch first before submitting any new PR.

      Thanks!

      posted in NodeManager
      user2684
      user2684
    • Battery powered fingerprint reader

      This project is about a battery powered fingerprint sensor I placed just outside the door of my house. The last person leaving the house or the first entering it would use the sensor so the controller could arm/disarm the alarm but of course can be used to control anything (e.g. opening the door). Since the controller gets the id of the fingerprint when there is a match, would also know who is entering the house so greeting the person by name out loud (kind of funny :P).

      The fingerprint sensor I'm using is a FPM10A that can be found on Aliexpress for 5$ (https://www.aliexpress.com/item/Fingerprint-Reader-Sensor-Module-FPM10A-Optical-Fingerprint-Fingerprint-Module-Locks-Serial-Communication-Interface-For-Arduino/32835820214.html).
      Wiring is pretty simple (http://www.duino.lk/image/cache/catalog/Components/fingerprint scaner/fingerprint_sensor_6pwhs7n-500x500.jpg) , it uses a serial connection for the communication and sample code and a library is available from Adafruit (together with a Windows utility that can be used for troubleshooting and for enrolling your fingerprints).

      If battery powered, the sensor cannot of course stay always on since consuming around 150mAh. This is why I've attached a button to the project so the person using it can press the button, the node wakes up, the sensor turns on and the person can put the finger on it. After that, the board goes back to sleep. I've also added a buzzer to shortly beep in case of a positive match.

      This is how the project looks like:
      alt text

      • 1: EasyPCB from @sundberg84 RFM69 version
      • 2: FPM10A sensor. RX and TX connected to pin 5 and 6 (using SoftwareSerial).
      • 3: MCP1302 voltage regulator to provide 3.3v out of the 3 AA batteries (4.5v). I preferred using this configuration since the FPM10A works so so when the voltage is below 3v. The regulator is placed in the booster position so to measure the battery level
      • 4: battery measurement, resistors 1M and 300k ohm
      • 5: since the FPM10A has to be powered on only on demand and an arduino pin cannot provide enough current, I'm using a pn2222a transistor connected to an arduino pin on one side through a 220ohm resistor (with a 10k resistor going to ground) and the FPM10A gound on the other side
      • 6: button for waking up the board and starting the fingerprint sensor
      • 7: 3 AA battery pack
      • 8: buzzer

      This is the code I'm using (from the NodeManager's development branch):

      /**********************************
       * MySensors node configuration
       */
      
      // General settings
      #define SKETCH_NAME "Fingerprint"
      #define SKETCH_VERSION "1.0"
      #define MY_NODE_ID 9
      
      // RFM69 radio settings
      #define MY_RADIO_RFM69
      #define MY_IS_RFM69HW
      #define MY_RFM69_NEW_DRIVER
      
      // Advanced settings
      #define MY_BAUD_RATE 9600
      #define MY_SPLASH_SCREEN_DISABLED
      
      /***********************************
       * NodeManager modules for supported sensors
       */
      
      #define USE_BATTERY
      #define USE_SIGNAL
      #define USE_DIGITAL_OUTPUT
      #define USE_INTERRUPT
      #define USE_FPM10A
      
      /***********************************
       * 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 ON
      
      /***********************************
       * Load NodeManager Library
       */
      
      #include "NodeManagerLibrary.h"
      NodeManager node;
      
      /***********************************
       * Add your sensors below
       */
      
      // built-in sensors
      SensorBattery battery(node);
      SensorSignal signal(node);
      PowerManager power(-1,A1,1000);
      
      // Attached sensors
      SensorFPM10A fingerprint(node,5,6);
      SensorDigitalOutput buzzer(node,A5);
      
      /***********************************
       * Main Sketch
       */
      
      void bip(Sensor* sensor) {
        if (fingerprint.success) buzzer.setStatus(ON);
      }
      
      // before
      void before() {
        // setup the serial port baud rate
        Serial.begin(MY_BAUD_RATE);
      
        // battery sensor
        battery.setMinVoltage(3.2);
        battery.setMaxVoltage(4.6);
        battery.setBatteryInternalVcc(false);
        battery.setBatteryPin(A0);
        battery.setBatteryVoltsPerBit(0.00459433);
      
        // buzzer sensor
        buzzer.setPulseWidth(20);
        
        // fingerprint sensor
        fingerprint.setPowerManager(power);
        fingerprint.setWaitFingerForSeconds(15);
        fingerprint.setInterrupt(3,FALLING,HIGH);
        fingerprint.setPostLoopHook(&bip);
      
        // node configuration
        node.setSleepMinutes(60);
      
        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 &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
      

      Basically the node sleeps and wakes up every hour to report battery and signal level. When the button (attached to pin 3) is pressed, the node wakes up and the FPM10A is powered on by PowerManager (which turns HIGH pin A1 so saturating the transistor and activating the sensor). If there is a fingerprint match, then the fingerprint id is sent back to the gateway and the node goes back to sleep. Before doing so a short "bip" is sent to the buzzer.
      If nothing happens for 15 seconds, the node goes back to sleep regardless.

      Just a little trick, since I'm running all my arduino nodes at 1Mhz, the FPM10A has to be configured to work at 9600 baud (57600 is the default). The only library that I found with a working example to change this into the device is the following https://github.com/brianrho/FPM/blob/master/examples/setParam/setParam.ino

      Fingerprint Reader Sensor Module FPM10A Optical Fingerprint Fingerprint Module Locks Serial Communication Interface For Arduino

      $5.79
      posted in My Project
      user2684
      user2684
    • NodeManager v1.7 now available!

      It took a few months but finally NodeManager v1.7 is here!
      With this release the entire NodeManager's architecture has been reviewed, mainly to improved the overall user experience and optimize the code so to use the memory in a more efficient manner. If coming from the previous release, you will find NodeManager way easier to use and more powerful now.
      Last but nost least the number of built-in sensors has no reached 52 (yes, fifty-two, including support for LCD displays), which can be enabled by just uncommeting a single line. For these sensors NodeManager will take care of importing the required library, presenting them to the gateway/controller, executing periodically the main function of the sensor, all without an additional line of code.

      Collaboration for this release has been also great with 15 PRs from other users of the community who I want to really thank.

      NodeManager v1.7 can be downloaded directly from Github https://github.com/mysensors/NodeManager.
      Please read the README file carefully before starting so to get a sense on how to use it or what has changed from the previous releases.

      The full release notes for this version are listed below:

      • Reviewed the entire NodeManager's architecture with children now automatically created from within each sensor
      • Optimized the code so to use the memory in a more efficient manner
      • Improved the overall user experience, also with sensors' patterns in the main sketch
      • Sensors can now be enabled by uncommenting the corresponding USE_* define and requiring a single line to be created and initialized
      • NodeManager's advanced features can be enabled/disabled by setting the corresponding FEATURE_* define
      • Simplified the configuration of each sensor, now without the need of getting the sensor back through a nasty casting
      • Merged config.h into the main sketch so to centralize the configuration in a single place
      • Added time-aware capability, with or without an attached RTC
      • Intra-sensor communication now possible with the possibility for the user to nicely hook into the sensor's code
      • Battery and signal reports are now available through the regular sensors SensorBattery and SensorSignal
      • Remote API interaction for all the sensors has been moved into the regular sensor SensorConfiguration
      • Fixed bug preventing negative temperatures to be reported for all the sensors
      • Added ability for each sensor to report only when value is above or below a configured threshold
      • Addded support for SD card reader
      • Added support for RFM95 radio
      • Added supoport for MySensors Sensebender Gateway and Sensebender Micro boards
      • Added support for generic LCD devices through an abstract Display class
      • SensorDimmer now supports both V_STATUS and V_PERCENTAGE
      • SensorPulseMeter now supports running on batteries
      • SensorDs18B20 optimized and now supporting V_ID
      • SensorSwitch (now renamed into SensorInterrupt) now catches interrupt in a more reliable way
      • SensorLatchingRelay now specialized and renamed into SensorLatchingRelay1Pin and SensorLatchingRelay2Pins
      • Added support for HD44780 i2c LCD
      • Added support for MG996R Servo sensor
      • Added support for VL53L0X laser time-of-flight distance sensor
      • Added support for SensorPlantowerPMS particulate matter sensors
      • Added support for SHT31 temperature and humidity sensor
      • Added support for SI7021 temperature and humidity sensor
      • Added support for for Neopixel LED
      • Added support for Chirp Sensor soil moisture sensor
      • Added support for SparkFun RGB and Gesture Sensor
      • Added support for TTP226/TTP229 Touch control sensor
      posted in NodeManager
      user2684
      user2684

    Latest posts made by user2684

    • RE: 💬 eGeoffrey

      @3more Looks like you email address was not marked as verified, I unblock it manually so you should be good to go now. Keep on eye on the spam folder in case something came or will go in there. Thanks!

      posted in OpenHardware.io
      user2684
      user2684
    • RE: 💬 eGeoffrey

      @3more thanks for letting me know, let me double check it and I'll let you know

      posted in OpenHardware.io
      user2684
      user2684
    • RE: Nrf5x on NodeManager

      @Francisco_Elias if understood correctly you are experiencing troubles in making a door sensor working attached to a pin different than 3 right? If this is the case, it is an expected behaviour, since interrupt pins on arduino pro mini are 2 and 3, those are the only two in which NodeManager configure the interrupts, even if there are boards supporting more interrupt pins. Let me know if this is a too strict limitation or feel free to open an issue directly on Github (https://github.com/mysensors/NodeManager/issues).
      Thanks!

      posted in NodeManager
      user2684
      user2684
    • RE: Nrf5x on NodeManager

      @Francisco_Elias said in Nrf5x on NodeManager:

      The only thing I'm still trying to make it working is the Door sensor. Using Nodemanger is not working for me.

      In case you want to give a try to the development version of NodeManager (https://github.com/mysensors/NodeManager/tree/development) there have been a few enhancements to support this board. Thanks

      posted in NodeManager
      user2684
      user2684
    • RE: Compilation error

      Hi, yes a few things have changed in the latest versions of the MySensors library and the current version of NodeManager is not compiling correctly. Give a try to the development version (https://github.com/mysensors/NodeManager/tree/development) in which the fix has been applied and let me know. Thanks!

      posted in NodeManager
      user2684
      user2684
    • RE: Nodemanage + EasyPCB Sleep

      @MatiasV Probably you would also need to wait a bit before reading after powering on the sensor. You can try adding a delay (in millis) as third argument to setPowerPins() of PowerManager so before the reading would take place, the Power Manager will wait a bit after power on and before giving control back to the sensor.

      posted in NodeManager
      user2684
      user2684
    • RE: Nodemanage + EasyPCB Sleep

      @ElCheekytico my bad sorry I was referring to a PNP2222a or similar and for some reason I wrote down MCP1702. Yes, this is the approach I'm using as well, just pass the vcc pin which is activating the transistor hence powering on the sensor. You should use also some resistors, for sure to drive the base, potentially on the collector/emitter depending on the transistor you are using

      posted in NodeManager
      user2684
      user2684
    • RE: Nodemanage + EasyPCB Sleep

      @ElCheekytico from the NodeManager's side, yes preferred option is to use PowerManager and connect vcc and gnd pins of the sensors to the configured two pins so that NodeManager can turn them on and off all sensors in between sleeping cycles. For these situations I usually solder a MCP1702 or similar on the prototyping area of the EasyPCB and connect sensors from there so to keep it small and self-contained.

      posted in NodeManager
      user2684
      user2684
    • RE: Modular sketch to be configured with JSON (idea)

      @monte, I've implemented in PR https://github.com/mysensors/NodeManager/pull/517 something going in the direction you pointed out. Before explaining just a simple assumption first: NodeManager is intended to run on a number of different boards, most of them with limited memory so this capability has to take this constraint into consideration (hence no json parsing, reuse of existing communication mechanism, capability disabled by default, etc.)

      Apart from this, I found a sort of compromise to enable/disable sensors, even remotely and optionally persisting the status across a reboot. All the implementation details are within the PR (down below, the PR also include other enhancements) feel free to provide comments here or on Github. Hope it could be useful to avoid reimplementing the entire logic from scratch

      user2684 created this issue in mysensors/NodeManager

      closed Core Multiple Fixes #517

      posted in Development
      user2684
      user2684
    • Compatibility issue between MySensors 2.3.2 and NodeManager 1.8

      For those using NodeManager just keep in mind there is a compatibility issue between MySensors 2.3.2 and NodeManager 1.8 which causes the compiler to thrown an error. This has been fixed in the development branch of NodeManager (https://github.com/mysensors/NodeManager/tree/development).

      If you will face this problem, either use MySensors v2.3.1 or switch to the development version of NodeManager.

      By the way, development of the new release is going fast and I hope should be finalized in the next couple of months.
      Thanks

      posted in NodeManager
      user2684
      user2684