for a battery powered project I would like to put an Attiny85 into deep sleep mode immediately after program start and let it wake up only when a sensor value (in this case a photo resistor) changes. Unfortunately I could only find examples for interrupts by a button and not for photo resistors in the internet. Does anyone have an idea how I could implement it, or if it is impossible?
How to deep sleep an Attiny until an analog value of a photoresistor changes?
1.3k Views Asked by Michael Brown At
1
There are 1 best solutions below
Related Questions in ATTINY
- is it possible compare a 16-bit value with a 8-bit compare match ISR
- Attiny85 AC Phase Control for dimming a light bulb
- TinyAVR 0-Series: Can I use pin-change sensing without entering interrupt handler?
- Unexpected Timer/Counter B interrupt frequency on ATtiny204
- avrdude with usbasp and attiny2313 return errors
- Fatal error in avr-gcc, specifies incorrect MCU
- How to compile and flash attiny88 with arduino-cli?
- Arduino/Attiny85: Delay in ISR and port manipuation
- Fast PWM - ATTiny2313 on OC0A (PB2)
- Optimising C code for small size - sharing static variables?
- master slave communication between two attiny 85 IC
- ATTiny 1626 pullup input does not trigger falling edge ISR, is there something wrong with my setup?
- Supported Arduino functions on ATTinyCore by SpenceKonde
- How to deep sleep an Attiny until an analog value of a photoresistor changes?
- UDR register always reads 0xFF
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Turn out that this is probably a software question.
Probably to lowest power and simplest way to implement this would be to...
Each time the watchdog fires...
How power efficient this will be really depends on how often the timer interrupt fires - the less often the better. If your application can live with only checking the sensor, say, once per second then I bet power usage will be single digits of microamps or less.
If you really need very low latency when that sensor values changes, then you could instead use the build in analog comparitor...
.. to generate an interrupt when the input voltage goes above or below a threshold value, but this will likely use much more power since just the analog comparitor itself uses ~30ua while on, and you will also need to generate the voltage that you are comparing to either with the internal 1.1 voltage reference or an external resistor bridge or buffer capacitor.