Author Topic: Does anyone know how smart bulbs count power up cycles?  (Read 695 times)

0 Members and 1 Guest are viewing this topic.

Offline e100Topic starter

  • Frequent Contributor
  • **
  • Posts: 603
Does anyone know how smart bulbs count power up cycles?
« on: April 17, 2022, 09:09:50 am »
(In order to initiate a factory reset.)

A common theme of mains powered smart bulbs is that they have no reset switch to restore the default factory settings. Instead you have to cycle the power a particular number of times over a particular number of seconds. The timing of the sequence is designed to minimize the chance of an accidental factory reset due to a child 'playing' with the light switch.

I've noticed that with some of my older bulbs that the required timing behavior to initiate a factory reset has changed since they were new. Does that indicate the use of analog circuitry? I find that odd as these things are cost optimized to the extreme.
« Last Edit: April 17, 2022, 11:17:08 am by e100 »
 

Offline NaxFM

  • Regular Contributor
  • *
  • Posts: 124
  • Country: it
Re: Does anyone know how smart bulbs count power up cycles?
« Reply #1 on: April 17, 2022, 09:48:26 am »
I always thought that they may use a capacitor to power up the microcontroller while powered off. In a super low consumption state a small capacitor is able to keep them running for several seconds. Then they just run a timer and detect when there is mains power. I higly doubt they have a coin cell inside.
This may also explain why the timing in your old bulb is different: the capacitor may have started going bad. This is just my personal guess, i have yet to teardown one, but that timing problem you described makes me feel more confident
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17117
  • Country: us
  • DavidH
Re: Does anyone know how smart bulbs count power up cycles?
« Reply #2 on: April 18, 2022, 02:42:53 am »
A CMOS counter or a charge pump circuit which is sort of an analog counter could do it.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: Does anyone know how smart bulbs count power up cycles?
« Reply #3 on: April 18, 2022, 09:51:25 am »
Usually modern MCU stuff can detect power on resets and may or may not have non-volatile storage, and often have some kind of low power storage and RTC that is intended to be used with an external battery.

While the power is on, the MCU easily can detect how long it is turned on - save a flag e.g. while you're turned on for a certain amount of time, and reset that flag if the timing condition isn't met (too short or too long turned on). On next power on, read that flag from non-volatile or a "few seconds alive from a capacitor" storage", and increment a counter, otherwise reset that counter. If the counter reaches a certain value, do the factory reset.

I'd guess it's all implemented without any additional hardware. I'd guess too, it cannot detect the power off duration precisely (power on duration is easy in software), but something that just can discriminate between "longer than a few minutes" and "shorter than a few seconds" should be fine to do the job - might be an otherwise unused RTC within the microcontroller that is buffered by a small capacitor. So the criteria might be "RTC is still alive, or RTC has reset" to discriminate long or short "off".

Safety devices hinder evolution
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf