Hi,
I am building a door sensor using a 3-pin switch, an ESP2866-01 (standalone) for communication to a server and a battery as power supply. (I'm using theArduino IDE for ESP 8266 to program the ESP2866 directly without the need to control it using a regular Arduino.)
Requirements of the setup are:
- door open and close events should be send to the server. (Door open is in fact powering on of ESP2866, door close can be detecting by change of switch state.
- power needs to be turned off when (or shortly after) the door is closed and the events are send to server, so the battery will last long.
I have build the attached circuit
The Arduino code is here: http://fritzing.org/media/fritzing-repo/projects/d/door-sensor-esp8266-on-battery/code/forumcode.ino
In the code on power up I set pin 0 to high to keep power on (circumventing the switch in case door is closed before esp can send data over wifi) however this does not seem to work. I suspect something is wrong with the circuit.
Any ideas?
(To be complete, I also have two other problems: an error generated by the reset method 'unknown opcode jmp' but this could be specific for the ESP2866 IDE environment; Also pin 2 is not registering the closing of the door / receiving 5V )
thx, Nard
I am building a door sensor using a 3-pin switch, an ESP2866-01 (standalone) for communication to a server and a battery as power supply. (I'm using theArduino IDE for ESP 8266 to program the ESP2866 directly without the need to control it using a regular Arduino.)
Requirements of the setup are:
- door open and close events should be send to the server. (Door open is in fact powering on of ESP2866, door close can be detecting by change of switch state.
- power needs to be turned off when (or shortly after) the door is closed and the events are send to server, so the battery will last long.
I have build the attached circuit
The Arduino code is here: http://fritzing.org/media/fritzing-repo/projects/d/door-sensor-esp8266-on-battery/code/forumcode.ino
In the code on power up I set pin 0 to high to keep power on (circumventing the switch in case door is closed before esp can send data over wifi) however this does not seem to work. I suspect something is wrong with the circuit.
Any ideas?
(To be complete, I also have two other problems: an error generated by the reset method 'unknown opcode jmp' but this could be specific for the ESP2866 IDE environment; Also pin 2 is not registering the closing of the door / receiving 5V )
thx, Nard