Closed C-Duv closed 6 years ago
Yes, your schema is OK and must work fine If you receive false triggers from push button add a small cap between gpio3 and gnd
100nF across the switch will help debounce the switch
@smadds do you mean the capacitor will be connected to GND and GPIO3/VCC in parallel to the switch? Or where is it located exactly (sorry, I'm a software guy ;-) and currently refreshing my electronics skills).
It can be either end of the wire - it's just easier to mount it on the back of the switch. Effectively it's between the I/O pin and gnd
@ionciubotaru @smadds If I get this correct: I should first try with the 4.7k resistor only. Then, if I get false triggers, I should add the 100nF capacitor (keeping the resistor).
I dont suppose you have documented how you get the temp readings, I have been trying for ages to get this working without success
@2e0vet I used a AM2302 sensor connected as follows on the Sonoff:
AM2302 pins:
Pin number | Usage |
---|---|
1 | VDD (Power) |
2 | SDA (Data) |
3 | Nothing |
4 | GND (Ground) |
(Pins are numbered from left to right: see this specification document).
Connection to the Sonoff:
DHT22/AM2302 | Sonoff |
---|---|
VCC (pin 1) | 3V3 |
SDA (pin 2) | GPIO14 |
GND (pin 4) | GND |
(See GPIO Locations for Sonoff pins locations)
Then of the Tasmota web interface, go to Configuration > Configure Module and set the GPI014 Sensor field to 03 DHT22. Click the Save button and the Sonoff should reboot. After a few seconds (~30s) temperatures and readings should be displayed on the web interface main page.
My setup (only using a 4.7kΩ resistor) works fine.
In Configuration > Configure Module page, I set GPIO3 Serial In to the value 09 Switch1.
And changed the SwitchMode to 3 by accessing the following URL:
curl http://THE.SONOFF.IP.ADDRESS/cm?cmnd=SwitchMode1%203
(SwitchMode1%203
= SwitchMode1 3
= Set SwitchMode for relay 1 -My Sonoff only has one- to mode 3)
Hello, I have an already working setup of a Sonoff Basic running Tasmota (v5.2.4) and reading temperature and humidity on a DHT22 connected on GPIO14 (in Module settings page, GPI014 Sensor is set to 03 DHT22). Both relay state and DHT22 values are retrieved on home automation software via MQTT).
I would like to add a push (momentary) button to this setup so that pushing the button toggles the relay (directly but also sends the new state MQTT message). I know I'll have to configure the SwitchMode and/or SwitchTopic but I am more concerned about how and where connect the push button...
I have found issue #508 (Toggle Switch on GPIO 1(RX) or 3(TX)) which suggest to use GPIO03 (RX) but it uses a toggle/maintained switch not a push/momentary like I want, so I am not sure the following schema works:
(Ignore the gray "F" zones: they symbolizes female pins on a male header I soldered on the Sonoff board)