Post topics, source code that relate to the Arduino Platform

User avatar
By certeza
#24915 I finally succeeded in using a PIR connected to an ESP-12 as a motion detector.
I modified the PIR to work on 3.3V, check out this webpage http://lowpowerlab.com/motionmote/#pirsensor on how to do that.
I also used an ATTiny45 to have more control over the logic of the input and output signals.
So, PIR connected to ATTiny, ATTiny connected to ESP-12.
Both ATTiny and ESP-12 are in a state op deep sleep.
The PIR detects motion and sends a positive pulse to the ATTiny.
The ATTiny wakes up and resets the ESP-12.
It also brings a second line high for the ESP-12 to see that is reset by the ATTiny and not by anything else.
The ESP-12 sends the motion detection to a web server and sends a signal back to the ATTiny indicating it has finished its task and is going back to deep sleep.
ATTiny receives the signal and also goes back to deep sleep.
In this state it is ready to receive triggers from the PIR again.

Source code follows later, but here is a drawing.

Image
User avatar
By tytower
#24975 Look forward to the code ..Suppose ATTiny85 would do as well.Gives you more analog pins but can't the ESP do it without help . If put into deep sleep I have one going 15 minutes then connecting to network on waking .

Yours would be in deepsleep and wake up on PIR signal or timer and on PIR signal look for access point , connect, and send then if PIR no longer active go back to sleep. On timer go to sleep again and I only put this in because I don't understand what the watchdog timer is doing in deep sleep . It does not seem to affect mine at all

Would that work? There is code available in Wiki (Arduino IDE) to do all that except the check signal from PIR and that would be pretty easy to do.
User avatar
By certeza
#24981 I would like to combine the external interrupt trigger with a watchdog timer that wakes the attiny up ever 5 minutes or so. If that is what you mean?
But all my attempts to do that have failed so far.