PIR in 3.3V and ESP8266-01

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
engberg
Normal user
Posts: 11
Joined: 21 Feb 2017, 16:42

Re: PIR in 3.3V and ESP8266-01

#11 Post by engberg » 24 Feb 2017, 17:55

So I'm just gonna document here..

Got my FTDI232 device and found drivers here:
http://www.ftdichip.com/Drivers/VCP.htm

Then connected the FTDI232 and the esp8266 this way:
http://iot-playground.com/blog/2-uncate ... are-update

And followed the flash instructions here:
http://www.letscontrolit.com/wiki/index ... are_Upload

I had to do it twice, before it worked..

engberg
Normal user
Posts: 11
Joined: 21 Feb 2017, 16:42

Re: PIR in 3.3V and ESP8266-01

#12 Post by engberg » 28 Feb 2017, 15:48

It only runs on standart power, if I connect both the VCC and the CH_PD to 3,3V

helio58
Normal user
Posts: 20
Joined: 11 Mar 2017, 10:21

Re: PIR in 3.3V and ESP8266-01

#13 Post by helio58 » 25 Mar 2017, 08:16

Hi Justblair please could you share your PIR Sonoff configuration and rules?
Thanks
Justblair wrote: 22 Feb 2017, 10:04 I am using a PIR module with a Sonoff wireless smart switch.

https://www.itead.cc/sonoff-wifi-wireless-switch.html

I modified the PIR module to bypass its 3.3v power regulator and then connected the PIR sensor to the 3.3v power header in the Sonoff switch.

Works very reliably in my kitchen switching my under unit and other spotlights. Love it. The sonoff is very reasonably priced, and basically gives you everything that you need to complete the project.

Justblair
Normal user
Posts: 63
Joined: 08 Aug 2016, 23:42

Re: PIR in 3.3V and ESP8266-01

#14 Post by Justblair » 27 Mar 2017, 13:03

espeasy.items

Code: Select all

Switch	kitchenPIR			"Kitchen Motion Sensor"	<kitchen>	(Sensor)		{ mqtt="<[broker:/KitchenMood/pir/Switch:command:ON:1],<[broker:/KitchenMood/pir/Switch:command:OFF:0]" }
Switch	kitchenDownlights	"Kitchen Lights" 	<light>	(lights,downstairs_lights,backroom_lights)	[ "Switchable" ]	{ mqtt=">[broker:/KitchenMood/gpio/12:command:ON:1],>[broker:/KitchenMood/gpio/12:command:OFF:0]" }
espeasy.rules

Code: Select all

var Number counter = 0
var Number lastCheck = 0

rule "kitchenLightOn"
    when   
            Item kitchenPIR changed from OFF to ON
    then   
            counter = counter + 1
            //sendCommand(br_x10_lamp, ON)
            sendCommand(kitchenDownlights, ON)
    end

rule "kitchenLightOff"
    when   
		Time cron "0 0/3   * * * ?"
    then   
            if(lastCheck == counter) {
                    counter = 0
                    lastCheck = -1;
                    //sendCommand(br_x10_lamp, OFF)
                    sendCommand(kitchenPIR, OFF)
                	sendCommand(kitchenDownlights, OFF)
            } else {
                    lastCheck = counter
            }
    end
    

On the Sonoff:
rule

Code: Select all

on pir#Switch do
    if [pir#Switch]=0
        gpio,13,1
    else
        gpio,13,0
    endif
endon
Task 1: System Uptime (not needed really)

Task 2:

Code: Select all

Device:	Switch input
Name:	pir
Delay:	0 (Optional for this device)
IDX / Var:	1
1st GPIO:	GPIO-12
Pull UP:	false
Inversed:	false
Switch Type:	switch
Switch Button Type:	Normal Swtch
Send Boot state:	false
Send Data:		true	
Global Sync:		false
Optional Settings	Value
Value Name 1:	Switch
Task 3:

Code: Select all

Device:	Switch input
Name:	status
Delay:	0 (Optional for this device)
IDX / Var:	5
1st GPIO:	GPIO-12
Pull UP:	false
Inversed:	false
Switch Type:	Switch
Switch Button Type:	Normal Switch
Send Boot state:	false
Send Data:		true
Global Sync:		false
Optional Settings	Value
Value Name 1:		Switch

helio58
Normal user
Posts: 20
Joined: 11 Mar 2017, 10:21

Re: PIR in 3.3V and ESP8266-01

#15 Post by helio58 » 27 Mar 2017, 14:23

Thanks

Post Reply

Who is online

Users browsing this forum: No registered users and 117 guests