The power-saving mode (PSM) allows minimizing power consumption up to 0.4 µA in the sleep mode. Of course, attached sensors and peripherals should support power saving too.

Note: I cannot guarantee that the firmware will work correctly in your case because it greatly depends on the schematic of your DIY device. I exhort you to wash your DIY device in an ultrasonic cleaner because a small current leak may consume a battery.

⚠️ THIS FEATURE REQUIRES THE PREMIUM VERSION

Limitations

The power-saving mode has the following limitations:

  • GPIO input, the switch mode – the firmware detects ON and OFF states’ changes by a signal rising or falling edge. The CC2530 has a hardware limitation of this implementation. You can add only one switch on pin ranges P00 – P07, P10 – P13, P14 – P17, P20 – P23. Therefore, you can have up to four switches in your configuration. If you define a switch on a pin, you cannot use other pins in the corresponding range for other sensors because it may cause problems with detecting signal edges.
  • You may use a board with an amplifier (for example, EBYTE E18, CC2530 + CC2592), but this combination of chips consumes about 180 mA in the active mode instead of 25 mA of CC2530.
  • Some sensors are incompatible with PSM (for example, Pulse Generator, SenseAir8, Sensirion SPS30).
  • CC253x: The maximum uninterruptible sleep time is about 512 seconds (rounded to 510 s). After this time, the chip wake-ups, updates the sleep times and continues sleep. The device does not poll sensors or activate the radio module at that moment.

Options

The following configuration options may help you to create your battery-powered device:

External wake-up – it is a special input type. It wakes up the chip from sleep mode and instructs it to send periodic reports immediately. After this, the chip stays active for 3 seconds and goes to PSM.

If the external wake-up option is selected on Input 1, the firmware also uses it as a system button and allows you to reset the device.

External sensor power control – it is a special output type. The firmware sets the configured output to the HIGH state before reading a sensor’s value, and sets it to LOW after that. The CC2530 and CC2531 chips allow you to use pins P10 and P11 to supply power up to 20 mA to external sensors.

If your sensors require more power, you may use any output connected to an external transistor worked in the switch mode. Please note, the firmware sets all output to the LOW state when it transits to the sleep mode. Therefore, the transistor should be switched off with the LOW control signal.

This output should be defined immediately before a controlled sensor or a group of sensors. Any sensor that does not support external control (GPIO, outputs, switches, internal temperature or voltage, etc.) or GPIO resets the “External sensor power control” setting.

“Wake-up delay” turns on external sensors X ms before reading and sending data so that they have time to warm up, initialize and collect initial data. This value depends on your sensors. It is a maximum value from all sensors controlled by this pin. If “Wake-up delay” is zero, the firmware starts reading sensor data immediately.

Typical configuration

Wait for commands after report (on the Expert tab) – The device will wait for 2 seconds after it successfully sent a report with all values to a coordinator. It allows sending some commands back from the coordinator (for example, to configure an interval of periodic reports, control a state of GPIO, etc.).

Poll for queued commands (on the Expert tab) – If you enable this option, the device will wake up every N seconds and send a small request to a parent device (coordinator or router) to check for commands addressed to this device. The device does not poll data sensors and does not send any values to a coordinator. The device consumes rather more power, but you can get a more responsive sleeping device.

LED

The LED indicator works differently in PSM if it is configured.

One short blink per four seconds – the device is connecting to a network.

Sporadic short blinks – the firmware indicates the following actions: clicks, switches, external wake-up signals, periodic reports.

Two short blinks – the firmware cannot send a report to a coordinator.

Pairing

The firmware starts the pairing process immediately after flashing. It tries to connect for about 60 seconds. In case of an unsuccessful attempt, the firmware goes to sleep mode. If you need more time, you should configure the external wake-up input (for example, a button). The signal on that input extends the time for the next 60 seconds.

Re-pairing

Power on, wait 2 seconds, power off, repeat this cycle three times. If the status LED is configured, it should light at a half-bright level for more than 2 seconds while the firmware initializes internal NVRAM memory.

If you selected GPIO or the external wake-up option on Input 1, it acts as a system button. You may click and hold it for 10 seconds. If the status LED is configured, it should light at a half-bright level after 10 seconds.

Recommendations

  1. Measure the power consumption of an assembled device with a constant power before using it with a battery. You should expect a range of 0.4 – 2 uA for most low-power devices (depending on the schematic and enabled features). If you observe higher current draw, clean your device using isopropanol, a similar alcohol-based liquid, or an ultrasonic cleaner (highly recommended).
  2. It is important to protect electronic components on your device from impact on the environment (high relative humidity, oxidation of contacts, etc.). I recommend using urethane aerosol spray for it.
  3. For better power consumption, you should use an external pull-up resistor for all GPIO inputs (3-5 MOhm).
  4. The firmware measures and sends a battery value with a periodic report. I recommend set to 21600 seconds (6 hours). The periodic report will also help you control the status of your device.
  5. Some routers work incorrectly with long time sleeping devices. Maybe, you’ll need to change this interval to 300 – 3600 seconds (try various values).

Comments
Harvey Specter
Posted at 20:52 October 6, 2024
Michael
Reply
Author

I use Uart with PSM. A microprocessor wakes it up and sends a couple bytes to the CC2530 Uart.
How much time does the firmware need to receive uart data after sleeping?
What settings are recommended to avoid multiple reports?
Thanks

Harvey Specter
Posted at 17:13 July 25, 2024
alain
Reply
Author

Hi !
In the PSM mode, how to change the powersource to indicate battery ?
ZB2MQTT use this for the delay “on line” or “off line” (different value if on battery or not)
Thx.

    Harvey Specter
    Posted at 04:44 July 26, 2024
    Owner
    Reply
    Author

    The firmware sends the battery state with every periodic report. You should enable it, and at least, add one sensor on “Outputs” (e.g., Uptime).

      Harvey Specter
      Posted at 12:38 July 26, 2024
      alain
      Reply
      Author

      Yes, the voltage state is good.
      But the powersource sent by the firmware is on “main” and not “battery” : “powerSource”: “Mains (single phase)”
      For example, on my smoke detector (powered by a battery), i have this : “powerSource”: “Battery”.

      ZB2MQTT use this value to consider the device up or down and there is 2 values.
      By default : 10 min for device on “main” and 1500 min when on battery.

      My device have a report every 15 min and as a “main”, is considered as “not seen” between 10 and 15 min.

      So, i think the firmware must always send “powerSource”: “Battery” or perhaps add a check box on advanced tab to select beetween “main” and ‘battery” ?

      Thanks.

        Harvey Specter
        Posted at 07:35 July 27, 2024
        Owner
        Reply
        Author

        Probably, you’ve tested the same device with other firmware before. Please try to delete the device in Z2M, stop Z2M, and re-join the device again.

Harvey Specter
Posted at 03:33 April 29, 2024
Sebastian
Reply
Author

i have problem with PSM mode – I lose readings after about 2-3 hours, disconnecting the power supply and reconnecting it causes it to work again for 2-3 hours. i have CC2530 + CC2591 with BME280 (set default reporting interval to 120s)

    Harvey Specter
    Posted at 06:19 April 29, 2024
    Owner
    Reply
    Author

    Can you add a wake-up button to your device? If yes, does it help to wake up the device?

      Harvey Specter
      Posted at 03:42 April 30, 2024
      Sebastian
      Reply
      Author

      sorry my mistake (i have problem with battery) i have another question You wrote “The PTVO can also measure the voltage on a port P03. For this I applied the following configuration:” can i measure voltage of 18650 ~ 3,7 – 4v ?

        Harvey Specter
        Posted at 10:03 May 1, 2024
        Owner
        Reply
        Author

        No, this chip cannot measure voltage higher than 3.3V.

        Harvey Specter
        Posted at 03:59 May 2, 2024
        Sebastian
        Reply
        Author

        ok after battery pack replaced it working for about 24h and stop responding. i Try to short the wake-up PIN to GND but without success (the device started reporting again after a power restart.) any ideas?

          Harvey Specter
          Posted at 09:58 May 2, 2024
          Owner
          Author

          This problem can also be related to a router. Can you place your device closely to a coordinator?

Harvey Specter
Posted at 14:11 November 21, 2023
Aramdillo
Reply
Author

Nice program. I can program the CC2530 fine and it joins ZHA in Home Assistant ok. The problem is that any sensor measurements (BME280) are only read ONCE at startup with correct data. Other settings (RSSI, binary switches, int. temp) are updating ok but the CC2530 is not updating the other sensors. Any ideas?

    Harvey Specter
    Posted at 03:43 November 22, 2023
    Owner
    Reply
    Author

    Please submit add issues on Github with screenshots of your configuration.

Harvey Specter
Posted at 11:08 November 5, 2023
Vladimir
Reply
Author

Hello. I have bought one license to create a PSM device but after flashing the new software it can not even finish the interview in z2m. How can I get some help with this? Maybe I am missing something.

    Harvey Specter
    Posted at 11:11 November 5, 2023
    Owner
    Reply
    Author

    Add the “External wake-up” button to your device configuration and click periodically while pairing a device.

      Harvey Specter
      Posted at 14:35 November 25, 2023
      Vladimir
      Reply
      Author

      Hello.
      Sorry for my late reply. Didn’t have much time to work on this project.

      I have followed your advice and added the “External wake-up” button and kept pressing it while Z2M was trying to interview the device but it still didn’t work.

      Is there something else I could try?

      Thank you for your help.

        Harvey Specter
        Posted at 10:32 November 27, 2023
        Owner
        Reply
        Author

        Sorry, but I do not have other ideas.

Harvey Specter
Posted at 18:56 October 27, 2023
Pawel
Reply
Author

Hi. I have premium version i works fine.
You write “The power-saving mode (PSM) allows minimizing power consumption up to 0.4 µA”. I have 0.4 mA (400µA). I programming the same way like you over comments, even if i cut off sensors

Harvey Specter
Posted at 18:30 March 11, 2023
alain
Reply
Author

hi !
i’m making some exp with PSM and US-100 on a board with E18-MS1PA1-PCB.
without the US-100, the board use 160uA when sleeping.
with US-100 connected, it’s 2.5mA sleeping, and 11mA in active mode.
i’ve tried to power the US-100 with the power control on P11, but measurement is very erratic.
using wake up delay, no improvment
do you know if other distance sensor work better with power control ?

    Harvey Specter
    Posted at 04:03 March 15, 2023
    Owner
    Reply
    Author

    Sorry, but the firmware does not support other distance sensors.

Harvey Specter
Posted at 18:13 March 4, 2023
alain
Reply
Author

Hello,

I suppose that if i need several external wake up pins, i have the same limitation with GPIO switch ?
The external wake up work on High to Low or Low to High signal ?

And could you provide a parameter on the GUI to adjust the awake time (i need approx 15 sec )

Thx.

    Harvey Specter
    Posted at 09:03 March 5, 2023
    Owner
    Reply
    Author

    Hello,
    Yes, the external wake-up pin is similar to GPIO. If you use a pull-up resistor, the active state is Low (transition from high to low), and vice versa. Sorry, but you cannot set the wake-up time to 15 seconds.

Harvey Specter
Posted at 12:53 December 26, 2022
Radovan
Reply
Author

Hello, I am struggling with PTVO configuration. I have checked several discussions here, it should be possible with PTVO FW without problems – but I am not able to set FW correctly.
1) Input pins P0.0 and P0.1 – in case I set them as input + pullup, the voltage is still 0V. Should be 3,3V (as chip VCC voltage). Tested on several modules, same on all of them.
2) PSM mode – I am not able to pair CC2530 module in HomeAssistant – not working in ZHA nor Z2m. During add new device wizard is end in “Starting Interview”. On the power supply I see the consumption goes to 0mA even pairing is not finished. I have tested to “connect” ~1/second pin defined as external wake-up to GND (configured as pullup) to keep chip awake, but it did not help. Tested several times with several modules, no success. Do you have some solution for this?
3) HomeAssistant can see inputs (switch, switch_2, etc.) only in case the inputs are in PTVO FW config linked to outputs. In other case the input is not visible in HASS. In case in PTVO config I link input to output, I got warning – it is not compatible with PSM mode (it is clear for me, receiver on CC2530 is disabled in deepsleep and I can’t manage outputs). Do you have any solution, how to configure PTVO as PSM mode, where will be used external wake-up for 3 independent sources and visible in HASS as 3 inputs? (as a switch or on/off or something like this)

Generally – I need CC2530 configured as following: 3 inputs, deep sleep. Each of those inputs can wake-up CC2530, send change(s) to ZigBee Coordinator and see those changes in HASS – as I see discussions/articles on this webpages, this should be done quite easily with PTVO FW. I will be glad for some recomended configuration. Thanks for advice.

    Harvey Specter
    Posted at 12:35 January 10, 2023
    Owner
    Reply
    Author

    Could you please submit an issue on Github where we can discuss these problems in more comfortable format?

Harvey Specter
Posted at 14:26 July 8, 2022
Tamás
Reply
Author

Hello,

About “External sensor power control”…

Modern sensors (SHT30, SHTC3) are able to complete its power up procedure in about 1 ms, however the firmware config tool allows only 100ms as the lowest value for ‘wake-up delay’ parameter.
– Would it be possible to allow such a low value (1, 5, 10, 20ms) as well?
I am planning to create a temperature sensor with PSM using the reporting interval of 60 seconds, probably lower wake-up delay could help to improve the battery life even more.

Thanks

    Harvey Specter
    Posted at 05:53 July 11, 2022
    Owner
    Reply
    Author

    You can use a zero delay because the firmware need some time to restore after wake up (about 100ms). So, a shorter interval is not necessary. Moreover, the firmware need 2-5 _seconds_ to go to the sleep mode again. So, the delay of 20ms does not improve the battery life.

Harvey Specter
Posted at 00:21 July 3, 2022
Goridat
Reply
Author

I am using the PSM mode to run a battery power device. Your firmware configurator works great! I very much appreciate the option to create a custom converter for Z2M. As the project runs on batteries, I need to occasionally measure the battery voltage to get a notification when it is time to replace them. To save on battery, I use a circuit similar as described in https://electronics.stackexchange.com/a/39431 to limit the losses across the voltage divider. Currently, I am manually enabling the control output using a pulse switch. However, the external sensor power control output type sounds like it is exactly what I am looking for. Does it also work with ADC inputs?

    Harvey Specter
    Posted at 06:51 July 3, 2022
    Owner
    Reply
    Author

    Yes, the external sensor power control output also works with ADC.

Harvey Specter
Posted at 12:02 March 28, 2022
Sergey
Reply
Author

As I understand it, the premium version is bought for a specific chip. Tied to an ieee address. If my device fails, will it be possible to move the current license to a new chip, deactivating the license from the failed one?

    Harvey Specter
    Posted at 03:44 March 29, 2022
    Owner
    Reply
    Author

    Sorry, but you cannot move the license between chips.

      Harvey Specter
      Posted at 06:25 March 29, 2022
      Сергей
      Reply
      Author

      I don’t want to just move. Following the example of Microsoft, when replacing a burned-out motherboard, the Windows license is transferred to new equipment. There are no problems with this.

        Harvey Specter
        Posted at 09:06 March 29, 2022
        Owner
        Reply
        Author

        There is a large difference in the prices :). Sorry, but you’ll need to purchase a new license. Or you can purchase a bunch of licenses with a discount.

Harvey Specter
Posted at 20:43 December 19, 2021
Lantastic
Reply
Author

I purchased the premium version of the firmware and I’m experimenting with PSM and CC2652P with a simple schematic to send a report when a switch is turned on AND off but the firmware only detects the rising edge and sends a report only when the logic state is ON and never when is off.
A similar schematic worked fine with CC2530 with PSM.
The same schematic works fine with CC2652P normal firmware no PMS.
Any idea ?

    Harvey Specter
    Posted at 21:13 January 10, 2022
    Lantastic
    Reply
    Author

    This has been fixed with the latest version.
    Both rising and falling edges are now detected correctly and wake up the module.

Harvey Specter
Posted at 11:41 September 17, 2021
MK
Reply
Author

Hi, I have now “End device without routing” as Device type and pin P00 set as External wake-up, but cc2530 does not go to the sleep mode. Is it necessary to have PSM as Device type, or can I have End device without routing and then wake it up with some pin?

    Harvey Specter
    Posted at 12:56 September 17, 2021
    Owner
    Reply
    Author

    PSM means ‘power saving mode.’ So, yes, you should select this device type.

Harvey Specter
Posted at 09:22 July 31, 2021
Lantastic
Reply
Author

I installed the PSM firmware on a CC2530+CC2591 module, no GPIO or sensors, just a input 1 on P00 External Wakeup with pull-up. The device never goes to sleep and keeps flooding the coordinator with continuous reports. I did not manage to make it going to sleep.
Any idea ?

    Harvey Specter
    Posted at 03:52 August 2, 2021
    Owner
    Reply
    Author

    Hi. What does the device report if it has only the wakeup button?

      Harvey Specter
      Posted at 06:36 August 2, 2021
      Lantastic
      Reply
      Author

      In this test it had only the wakeup input configured. I just need to monitor a contact on a garage door, so I reflashed the device with an input switch configured and now it seems to work as expected. The device wakes up at every signal edge falling or rising. Will keep the battery consumption monitored.

        Harvey Specter
        Posted at 06:41 August 2, 2021
        Owner
        Reply
        Author

        Ok. Great! What current do you get now when the device sleeps?

          Harvey Specter
          Posted at 12:38 August 2, 2021
          Lantastic
          Author

          Not easy to measure because when I insert the multimeter in series to the power supply, the device becomes unstable. I managed to measure around 400uA with the contact open. I could not take a measurement with the contact closed.

Harvey Specter
Posted at 11:20 June 25, 2021
Olivier
Reply
Author

Hello, with premium PSM, is it possible to wakeup every X seconds for example, without using external PIN? Is it also possible to test premium PSM for a day ?
Thanks a lot for this great job.
Olivier

    Harvey Specter
    Posted at 11:28 June 25, 2021
    Owner
    Reply
    Author

    Hello. Yes, the PSM firmware wakeup if the reporting interval is not zero. Sorry, but you cannot test the PSM version without a license.

Harvey Specter
Posted at 23:05 May 9, 2021
Nokia
Reply
Author

Hi,

Is there any ZigBee solution for a DIY end device with a low (maybe 1-5 mA?) standby power consumption? I.e. the device is not in deep sleep, and is always ready to immediately receive a command from the coordinator. I know this is possible in commercial products (the Danalock smart lock for example can last many months with 7200mAh total battery capacity), but I would like to achieve similar with a DIY device/firmware. Any suggestions would be appreciated.

Thanks

    Harvey Specter
    Posted at 03:31 May 10, 2021
    Owner
    Reply
    Author

    Hi,
    Does the Danalock smart lock use the CC2530 chip?

      Harvey Specter
      Posted at 08:24 July 3, 2021
      Nokia
      Reply
      Author

      Hello,

      I’m not sure of the chipset used. However, I’ve looked more into this and it seems the POLL_RATE variable is what is being used – when sending a lock or unlock command to the Danalock it isn’t always instant, so it seems to poll for queued commands every few seconds. Can this be done with the deep sleep so that for instance it checks for new commands every 5 seconds? Would this enable 5+ months of battery life?

      Thanks

        Harvey Specter
        Posted at 09:39 July 3, 2021
        Owner
        Reply
        Author

        Hello
        There is the “Poll for queued commands” option on the “Expert” tab. It will work in the PSM version too. You can measure consumption and calculate battery lifetime for your case. The average consumption is 30uA in 120 seconds (~21ma per day).

Harvey Specter
Posted at 17:12 April 11, 2021
Damian
Reply
Author

I have problem with pairing CC2530 in PSM. The same firmware generated but as end device without routing pairs succesfully. But when I set PSM – the it will announce itself, start to interview but interview will fail… I tink that device goes to sleep too fast, and it is not waiting for interview to complete. Next wake up whole procedure starts again – announce, start to interview and after a while interview failed…

    Harvey Specter
    Posted at 03:48 April 12, 2021
    Owner
    Reply
    Author

    You should add the External wake-up input to your device and configuration. When you pair a device, you should press this button every 30-40 seconds.

      Harvey Specter
      Posted at 06:10 April 12, 2021
      Damian
      Reply
      Author

      I really don’t want to… External wake-up also sends periodic report, and I need to read counter value each 60 secs, not faster… I could rewrite code to check when last read was done, but I don’t need external wakeup so it is redundant for me.. Could it be fixed in firmware – to not enter into sleep until pairing is done?

        Harvey Specter
        Posted at 06:38 April 12, 2021
        Owner
        Reply
        Author

        The firmware does not send reports if it is not paired. So, you may press the external wakeup button only when you pair a device and do not touch it other times.

Leave a Reply to Pawel
Cancel Reply