arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.24k stars 4.82k forks source link

Electrodragon(dual relay) with Capacitive touch sensor on gpio #3928

Closed amitubale closed 6 years ago

amitubale commented 6 years ago

IMPORTANT NOTICE If you do not complete the template below it is likely that your issue will not be addressed. When providing information about your issue please be as extensive as possible so that it can be solved by as little as possible responses.

Make sure these boxes are checked [x] before submitting your issue - Thank you!

I have connected the capacitive touch sensors on GPIO 4 and 5. and configured it to "09 Switch1" on the wes console -->configure-->configure module. for both GPIO 4 and 5. capacitive touch i am using is from ali express -"Blue HTTM-SCB 2.7V-6V Capacitive Touch Switch Module Strong anti-interference" the OUT pins of 2 sensors are connected to GPIO 4 and 5 resp.

The sensor light is turin on and off when touched. What should I configure theGPIOs to or what command i need to type on the console. DrZZZ has a video on the sonoff basic with the same sensor but i tried 'switchmode1 2' and it did not work.

since there are 2 relays, they show up in Mqtt as POWER1 and POWER2. If i need to type the command in the console do i need to change the mode for both ? please let me know the commands. thank you!

ascillato2 commented 6 years ago

Hi,

The sensor light is turin on and off when touched. What should I configure theGPIOs to or what command i need to type on the console.

What exactly you want to do? Please explain what is the issue.

amitubale commented 6 years ago

the sensor is working that is it turns on and off but it does not have any effect on the 2 relays. Can i use the GPIO's 4 and 5 to drive the relay1 and relay2. what shoudl be the configuration on the GPIOs 4 and 5 to drive the relays. thanks

ascillato commented 6 years ago

Hi, I'm so sorry. I don't understand.

You have 2 capacitive sensors connected to gpio 4 and gpio 5. It is Right? Have you also connected gnd?

You have set gpio 4 as button1 in module config (tasmota web menú). It is Right? You have set gpio 5 as button2 in module config (Tasmota web menú). It is Right?

Frogmore42 commented 6 years ago

The Electrodragon already has two buttons (KEY1 and KEY2) defined. I don't know if you can have two GPIOs with the same definition or not. If you can, that might work.

ascillato commented 6 years ago

No, you can't have two gpio with the same definition.

I'm asking @amitubale how it is connected and configured because it is not clear in the description.

Please, try the generic module instead and set all your pins there

amitubale commented 6 years ago

the capasitive sensor had +,- and OUT. all 3 wires are connected both OUT pins of 2 sensors are connected to GPIO 4 and GPIO5. when i touch the sensors the light on the sensor does show that it turning on and off. but it does not have any effect on the Relays. i have configures GPIO4 to '09 switch1' and GPIO5 to '10 switch2' and the relays are not turing on or off. To test i have tried the push button on the PCB and it works. Is there a switchmode command i need to configure the GPIOs to control the relays ?

ascillato commented 6 years ago

Hi,

As you have a hardware modification, chosing electrodragon module will not work anymore.

You need to chose Generic Module and set all the GPIOs for Relay, Leds and your new switches as:

GPIO4 as Switch1 GPIO5 as Switch2 GPIO12 as Relay2 GPIO13 as Relay1 GPIO16 as Led1

amitubale commented 6 years ago

HI ascillato, what do you mean by 'As you have a hardware modification" ?

I have not modified the hardware.

i am using the gpio4, 5 (to touch sensor) and gpio 15 to PIR wich are on the PCB. i also connected dht22 on the connecor provided on the pcb( gpio14- and its working )

Do you mean that the version of electrodragon i have is not he same as the the one thats in the 6.2.1 version of tasmota code ?....so it was coded for a previous version of the the eletrodragon hardware ?

ascillato commented 6 years ago

HI ascillato, what do you mean by 'As you have a hardware modification" ?

I meant that Chosing ELECTRODRAGON from module config will work for you ONLY if you use ELECTRODRAGON as standard (as it cames from factory) Adding switches to your device is a Hardware modification, so you need to chose module generic and set the GPIOs as:

GPIO4 as Switch1 GPIO5 as Switch2 GPIO12 as Relay2 GPIO13 as Relay1 GPIO16 as Led1

Please, Try that.

amitubale commented 6 years ago

img_0898 it did not work. i have attached the picture of the hardware and the components

ascillato commented 6 years ago

Sorry but you need to be more specific in order to let me help you. The phrase didn't work lack a lot of information. What happened?, what do you see in the console output? which switchmode and switchtopic did you use? what you tried to do? How you have configured your GPIOs? what steps did you do?

amitubale commented 6 years ago

sorry i did not use the console commands. I configured the following GPIO4 as Switch1 GPIO5 as Switch2 GPIO12 as Relay2 GPIO13 as Relay1 GPIO16 as Led1

in the web configure module and then tested the touch sensors. the touch senors aer working but did not drive the relay. is there a swithmode1 x (& swithmode2 x) command i need to type in the console window ?

ascillato commented 6 years ago

Are you connecting GND besides GPIO4 and GPIO5?

amitubale commented 6 years ago

there are 2 GND pins on the 12 pins on the pcb and yes i am using the GND pin not the one next to 4 and5 but the one next to 3V3 and 5V pins...i am guessing the GND pin for both are the same. I will ceheck it with a multimeter on another spare electrodragon module. I appreciate you helping me out with this issue.

ascillato commented 6 years ago

May be there is something misconfigured. Try switchtopic1 0 and switchtopic2 0 in the console

amitubale commented 6 years ago

10:41:05 CMD: switchtopic1 0 10:41:05 MQT: stat/masterbathtoiletlightfan/RESULT = {"SwitchTopic":""} 10:41:25 CMD: switchtopic2 0 10:41:25 MQT: stat/masterbathtoiletlightfan/RESULT = {"SwitchTopic":""} did that no luck. I need to lookup the diffrence between switchmode and switchtopic. I had tried it before with "switchmode1 2" as it was on the youtube tutorial for sonoff basic module. i had a PIR on GPIO15 and i had set is as switch3 and used switchtopic3 pirmotion....but could not see anyactivity on the console ..but that i will tackle once i get the touch switch to work

amitubale commented 6 years ago

10:41:38 MQT: tele/masterbathtoiletlightfan/STATE = {"Time":"2018-09-29T10:41:38","Uptime":"0T00:31:35","Vcc":3.103,"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"myssid","RSSI":98,"APMac":"31:CA:38:AC:C1:31"}} 10:41:38 MQT: tele/masterbathtoiletlightfan/SENSOR = {"Time":"2018-09-29T10:41:38","Switch1":"ON","Switch2":"ON","Switch3":"OFF","AM2301":{"Temperature":73.8,"Humidity":65.3},"TempUnit":"F"} 10:41:59 MQT: stat/masterbathtoiletlightfan/RESULT = {"POWER2":"ON"} --> this is with push buttons on PCB(and also work from web main page) 10:41:59 MQT: stat/masterbathtoiletlightfan/POWER2 = ON 10:42:01 MQT: stat/masterbathtoiletlightfan/RESULT = {"POWER1":"ON"} --> this is with push buttons on PCB and (also work from web main page) 10:42:01 MQT: stat/masterbathtoiletlightfan/POWER1 = ON

ascillato commented 6 years ago

if the pushbuttons are working, you didn't use the generic module nor the config you told me:

GPIO4 as Switch1 GPIO5 as Switch2 GPIO12 as Relay2 GPIO13 as Relay1 GPIO16 as Led1

Buttons from the PCB are not configured there.

So, what is the REAL configuration that you are using?

amitubale commented 6 years ago

after i tried your config ( the pcb buttons did not work) so after it failed, i put it back to Electrodragon module. Let me put it back on generic and try the switctopic command

ascillato commented 6 years ago

Ok, let's continue this in the Tasmota Discord Chat. The communication will be more dynamic.

amitubale commented 6 years ago

sounds good

ascillato commented 6 years ago

From the Chat:

Measuring with a DMM the output of the Capacitive sensors, those gives 2.2V(when off) and 3.3v(when on). So, adding a 4.7Kohm resistor between the GPIO4 and GND, solves the issue.

TLCary commented 5 years ago

I found that the knock-off Heltec HTTM Capacitive Touch sensors (blank white back with “touch button” printed on the back) have this problem. The real Heltec with green screen printed logo on the back work fine.