Keep sensor power low, but response fast

BLE sensor need to send information on water level. Normally it will only advertise every 5 seconds with a flag that is set when water level is Ok.

A central device receives advertising from many sensors, and operates a relay to start a pump (each sensor has a pump), according to the flag.

Once the relay starts,  it need to response as fast as possible when water reached the needed level.

I can think of tow strategies to do it:

1. As soon as water level is reached, the sensor will start advertising very fast, then the central unit will connect, notify that relay has been turned off, and sensor retunes to slow advertising.

2. As soon as water level is low, the central unit connects to the sensor, lining to the change in state, when pump needs to turn off, it disconnects.

what is the probability that working option1 will miss the data in advertising? how can I calculate?

in option 2, what are the implication on power consumption (the pump can work for a long time, even 2 hours)? Does this approach guaranty a faster response then approach 1?

can anyone offer a better strategy?

Thanks

Johanan

  • A bit off topic, I wonder if I should migrate the project to Zephyr OS, instead of using Softdevice. What are the pros and cons?

  • Hi,

    1) Is the central mains powered?

    2) Is the sensor battery powered?

    A central device receives advertising from many sensors, and operates a relay to start a pump (each sensor has a pump)

    3) Who controls the pump? The central or the sensor?

    what is the probability that working option1 will miss the data in advertising?

    If you set scan windows == scan interval, i.e. it's scanning ~100% of the time, it will likely pick up the advertisement very fast.

    Example figure:

    Johan.h said:
    A bit off topic, I wonder if I should migrate the project to Zephyr OS, instead of using Softdevice. What are the pros and cons?

    See this statement:

     nRF Connect SDK and nRF5 SDK statement 

    From the FAQ; If it's a new design, we recommend nRF Connect SDK.

  • 1. Yes, central unit has no power limitations.

    2.Yes sensor is battery powered, trying to reduce average current  to < 50uA, battery used is CR123A ~1500 mA/hr, need at least 2 years without replacement.

    3. Pump is activated by a relay at central unit. There is a pump related to each sensor. The central unit has 8 relays, and need to get data from up to 8 sensors.

    Thanks

  • since each sensor has a a serial number (1-8) does it make sense to set the adv. interval a little different for each (i.e sensor 1 20ms, sensor 2 21 ms and so on)? so they can never interference more then once every now and then?

  • Hi,

    can anyone offer a better strategy?

    I think your strategy is good. It might not be better, but since the amount of sensors is not too high, an alterative could be to just have an active BLE connection with the sensors at all time(With long connection interval, and/or slave latency enabled).

    We have an online power profiler here you can test different scenarios with:

     Online Power Profiler for Bluetooth LE 

    Johan.h said:
    since each sensor has a a serial number (1-8) does it make sense to set the adv. interval a little different for each (i.e sensor 1 20ms, sensor 2 21 ms and so on)?

    No. This is actually already taken care of by the Bluetooth stack.

    Advertising packets have a random delay in the range of 0 - 10 ms

    From BLUETOOTH CORE SPECIFICATION Version 5.2 | Vol 6, Part B page 2939:

    So the real advertising interval is adv_interval + advDelay, where advDelay is a pseudo-random value with a range of 0 ms to 10 ms generated by the Link Layer for each advertising event.

Related