Post topics, source code that relate to the Arduino Platform

User avatar
By Joe Job
#50748
trackerj wrote:Strange enough. Are you sure that you are properly processing the interrupts events generated by PIR?
Are you coding in Arduino IDE or something else? Take a look at my code for an idea how can be done, even if is not C++.


I am using the Arduino IDE yes and the Arduino library, sorry for delayed reply will do thanks.
User avatar
By Barnabybear
#50749 Hi, I had to tape up any exposed parts on the PIR (all part from the plastic bulb) and then wrap in aluminium cooking foil to stop the ESP trigering the PIR.
User avatar
By trackerj
#50752
Barnabybear wrote:Hi, I had to tape up any exposed parts on the PIR (all part from the plastic bulb) and then wrap in aluminium cooking foil to stop the ESP trigering the PIR.


Remember as I said above in thread that you need to keep 4-5 cm distance from ESP to avoid false triggering. Also shielding might work ;)
User avatar
By Joe Job
#50759
trackerj wrote:If you have a separate "Main Application MCU" (the Atmega in your case) then just use one digital I/O pin of it to do the power ON/Off for the ESP8266.
On the Atmega Software side you just need to add your new "Transmitter ON" or "Transmitter OFF" functions (aka PIN High/Low or Low/High, depending on the MOSFET type you want to use for ESP8266 Power switching) and that's it. I will suggest you a P-MOSFET and high side switching but it's your choice, you know better your setup.


The way I have done this as I don't have a P-Mosfet is using 3 220 resistors as a voltage regulator which I read should work, from port b4 on ATMEGA328p-pu when motion is detected I first apply power to CH_PD wait 1000 ms and then send serial and then stop the power the CH_PD , the esp just flashes the blue light quite fast, no data is received on the broker should I be waiting longer for the esp to boot up ?