Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:laboratoare:2025:lab5 [2025/10/24 21:13]
dan.tudose
iothings:laboratoare:2025:lab5 [2025/10/28 11:35] (current)
dan.tudose [Switch as a Sleepy ED]
Line 251: Line 251:
 [[iothings:​laboratoare:​2025_code:​lab5_2|Click here to get the code for this example.]] [[iothings:​laboratoare:​2025_code:​lab5_2|Click here to get the code for this example.]]
  
 +====== Switch as a Sleepy ED ======
 +
 +The previous example has the downside that the ED can be battery powered, but the code is not particularly optimized for energy saving. As a regular user will not press the switch more that a dozen times a day, it makes a lot of sense to keep the switch ED in deep sleep and wake only when the button is pressed. waking from deep sleep equates to having a hardware reset, so we will need to persist switch logic into the non-volatile RTC memory. This is all handled in the code below.
 +
 +[[iothings:​laboratoare:​2025_code:​lab5_3|Click here to get the code for this example.]]
 +
 +<​note>​**Assignment 1:**
 +Use the on-board BME680 sensor to switch lights on/off depending on the switch temperature instead of pushing a button. For example, if the temperature is above 25 degrees C, the light should turn on.
 +</​note>​
 +
 +<​note>​**Assignment 2:**
 +Encode more than simple on/off behavior from the switch. For example, a press toggles, and a hold dims up/down. Add a long-press detector on GPIO 9 and send MoveWithOnOff / Stop commands; on the bulb, implement Level Control callbacks to set NeoPixel brightness with transition times.
 +</​note>​
 +
 +<​hidden>​
 +Pentru asistenți: la laboratorul ăsta o să aveți nevoie de un gateway Home Assistant cu stick Zigbee Coordinator atașat. Dacă nu aveți așa ceva, întrebați-l pe Dan Tudose.
 +
 +</​hidden>​
iothings/laboratoare/2025/lab5.1761329593.txt.gz · Last modified: 2025/10/24 21:13 by dan.tudose
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0