Hi
I'm trying to use the hallsensor to wake up my esp32 from deepsleep. For this I use this example https://github.com/espressif/esp-iot-so ... all_sensor
On it's own this works fine.
However, as soon as I've read out the hall sensor when the esp32 is awake using the hall_sensor_read() function the device no longer wakes up if it goes to sleep a second time.
What am I doing wrong?
Hall sensor readout during ULP and normal power mode
Re: Hall sensor readout during ULP and normal power mode
Try to add this call before enter deep sleep:
Code: Select all
adc1_ulp_enable();
Re: Hall sensor readout during ULP and normal power mode
Hi
Thanks for the tip.
I tried to add the
works fine.
The ulp wake up will reliably work for >20 sleep-wake cycles
However if I use the following code the ulp wakeup stops working after 1-7 sleep wake cycles. The sensor will then no longer react to changes in the magnetic field.
This behavior is reproducible over multiple esp32 dev boards.
I'm using the hall sensor of the esp32 to detect if a door has been opened and go back to sleep again once the door has closed again.
Is there a different method to achieve this?
Thanks for the tip.
I tried to add the
Code: Select all
adc1_ulp_enable();
Code: Select all
adc1_config_width(ADC_WIDTH_BIT_12);
printf("Hall Sens: %d\n", hall_sensor_read());
adc1_ulp_enable();
esp_deep_sleep_start();
The ulp wake up will reliably work for >20 sleep-wake cycles
However if I use the following code the ulp wakeup stops working after 1-7 sleep wake cycles. The sensor will then no longer react to changes in the magnetic field.
This behavior is reproducible over multiple esp32 dev boards.
Code: Select all
while(hall_sensor_read()>0)
{
printf("Hall Sens: %d\n", hall_sensor_read());
vTaskDelay(5000/portTICK_PERIOD_MS);
}
adc1_ulp_enable();
esp_deep_sleep_start();
Is there a different method to achieve this?
Re: Hall sensor readout during ULP and normal power mode
Hard to say, maybe try to add small delay just before deep sleep command.
Who is online
Users browsing this forum: msfujino and 69 guests