Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wake up ESP32 from Light sleep using photoresistor #7753

Unanswered
peetman asked this question in Q&A
Discussion options

To save energy I put the ESP32 in Light sleep mode after some minutes. Then I have a photoresistor that detects when a light is turned on and it should wake up the ESP32.

touchAttachInterrupt(READ_VALUE, loop, THRESHOLD);
esp_sleep_enable_touchpad_wakeup;

I've tried the above code, but found out that the touchAttachInterrupt wakes up when the READ_VALUE is below THRESHOLD, but I want to wake up when READ_VALUE is above the THRESHOLD.

You must be logged in to vote

Replies: 3 comments

Comment options

Have you ever found a solution?

You must be logged in to vote
0 replies
Comment options

Don't understand the problem. A lot of phototransistors are NPN. If you use such a phototransistor as common emitter with a resistor between collector and Vcc, voltage across phototransistor will go down, when it gets light.

You must be logged in to vote
0 replies
Comment options

I think that using touch to wake up isn't a good way.

It may be better to use an external circuit that triggers clear levels (High 3.3v or Low 0v) to an ESP32 port and make the ESP32 wake up based on a pin level.

The external circuit can use some potentiometer to adjust the lighting level for triggering a transistor that would set the ESP32 pin level.
Or it can also use something more elaborate.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /