Would anything prevent deep sleep mode, if an add-on is wired correctly?
Closed this issue · 7 comments
Hi! I'm trying to create an "offline bulb" that can wake and do a little computation every minute or so. To accomplish this, I'm planning to add a coin cell battery, and connect EXT_RSTB (pin 32) to XPD-DCDC (pin 8) to accomplish hardware wake after deep sleep.
I'm wondering if there is anything already wired that might prevent this setup from working? I imagine that the circuit board for a light bulb in a socket is not necessarily anticipating having to be particularly energy conscious at this level. Is there anything I should be aware of before getting my hands dirty (and various things ordered)?
Thanks!
I don't really know how to answer this. I don't know that the XPD-DCDC pin is exposed in such a way that it could be connected to easily. I also don't understand what you want to do. Are you going to have the bulb connected to AC power? Why does it need to go to sleep? What does "offline bulb" mean? Not connected to network or not connected to power? What kind of computation are you trying to do every minute?
(I sent an email earlier that may have been sent to spam, but I'm reposting the relevant parts here in response to your questions):
I'm making a light bulb that mimics sunlight based on the time of day, without being network-connected. Basically, I want the privacy of a "regular lightbulb" but with just enough smarts to be a daylight bulb during the day and an evening bulb during the evening, with a smooth (imperceptible) fade during the hours in between. When the light is off, it isn't secretly communicating with anything. When I turn the light on, it knows the time of day (because it has been secretly waking up every minute or so) and correctly initializes as a cold white or warm white light as appropriate (or in-between temperature).
Here's what I'm imagining:
- a coin cell battery to wake every few seconds and track time (or perhaps even a rechargeable battery that recharges whenever the light is on? just dreaming...)
- a way to tell if the ESP was awakened via coin battery or via mains power (i.e. a normal light switch should turn the light on)
- min/max color temp config thresholds so that you can (for example) still turn the light on at night when the sun is technically behind the earth and it's pitch black out
- a long/lat position config so that the ESP knows where it is positioned on Earth's surface
- a software program that, when activated via light switch / mains power, looks up the time and long/lat & sets the color temperature to something approximating current sunlight (e.g. sunrise, noon, sunset, etc.)
- possibly a "simple mode" config setting that ignores long/lat and just tracks time, if you always want your lights to mimic an artificial sunset time, i.e. regardless of season
Why do you need to recalculate every minute and not just do it when the bulb turns on? Can you just keep the bulb powered all the time and use a smart switch to turn on the light? I'm sure you could hard-code in the adaptive lighting algorithm or something similar (https://github.com/basnijholt/adaptive-lighting). Keeping track of time might be the hardest part here.
Regarding your question about waking, I don't really know. You'd have to open a bulb and see if it is possible. There is no terminal labelled XPD-DCDC or similar. You'd probably be better off trying to design this through more general esp8266 sources than with my help.
Why do you need to recalculate every minute and not just do it when the bulb turns on?
EDIT: AFAIU I just need to keep track of time, and "every minute" is one way to do that. No computation is necessary other than an increment of some kind to track the passage of time. An on-board RTC would be better, but bulky, so... I'm trying things :)
Can you just keep the bulb powered all the time and use a smart switch to turn on the light?
No, my goal is to create a smart bulb (i.e. microcontroller with light capability) that is not network connected--i.e. for people like me who don't want networked smart devices (aka "threat vectors" to the paranoid) in the home. I also just enjoy a challenge.
Keeping track of time might be the hardest part here.
Yeah, as far as I understand it, if the mcu is powered off completely, there is no way to track time. Hence the coin cell idea.
There is no terminal labelled XPD-DCDC or similar.
I'm basing the pinout from this diagram. Is it incorrect?
You'd probably be better off trying to design this through more general esp8266 sources than with my help.
No worries! Your bulb is amazing for this project, as it is so much more hackable than anything else I've seen--plus it uses esp8266 which is a chip I'm more familiar with.
You're right, if I can mount an RTC inside the bulb, that should work. The heat may affect its performance or accuracy, but it's worth a shot :) I've ordered a ChronoDot 2.0 and I'll see how it goes. Thanks for the suggestions.