Tasmota: 4CH Pro External Switches

Created on 19 Oct 2017  Â·  20Comments  Â·  Source: arendst/Tasmota

Hi, I've an sonoff 4ch pro and I'd like to add 4 external switches, I know it's possible to use GPIO2 and GPIO1 and 3 for this, for the fourth I've searched where is possible to connect it, and in the schematic seems that GPIO 16 and maybe also GPIO6/7/8/11 (SPI) are available, is it possible to use them for switches? How can I set them? Thanks

Most helpful comment

Man I wish all these Sonoff devices had terminals for external buttons.... Even if they were just wired into the existing physical buttons...

All 20 comments

First read https://github.com/arendst/Sonoff-Tasmota/wiki/Sonoff-4CH-and-4CH-Pro
To define your own switches via web interface go to CONFIGURATION / CONFIGURE MODULE
To add even more switches read https://github.com/arendst/Sonoff-Tasmota/wiki/Adding-new-Module-types

Man I wish all these Sonoff devices had terminals for external buttons.... Even if they were just wired into the existing physical buttons...

OK, just modify the template as described here https://github.com/arendst/Sonoff-Tasmota/wiki/Adding-new-Module-types

@TommySharpNZ but for what I've read the onboard buttons are different from the external switches... @ionciubotaru So I need to edit the template, add the pull up resistor on those pins and it should work?

Buttons and switches are different, but you can replace buttons 2, 3 & 4 (GPIO9/10/14 ) by Switches.
Simply replace GPIO_KEYx by GPIO_SWTx in template for Sonoff 4CH Pro (in sonoff_template.h), then rebuild firmware and uprade device with it.
Even better is set value to GPIO_USER, so you can then change the GPIO type in Web interface (in Configure Module section).
Caution: Absolute maximum number of switches is 4.

@calcipher49 Thanks, it's working! :)

Sry to open this again, calcipher 49 says the absolute maximum number of switches is 4?
1,2,3 would be (GPIO9/10/14) what would be 4?
and how would you deal with the Programming mode for Remote if somone presses a button to fast? With switches not possible, but with buttons it is....

Maximum number 4 is Tasmota software limitation, but you can assign any available GPIO as switch.
On 4ch Pro, GPIO 1/2/3 are by default user defined, so can be easily assigned to switches.
Internal buttons are GPIO 0/9/10/14

Can you send a schematic how the physical wall switches are connected with gpio on board?

I would really appreciate if someone could point out where and how I can connect the pins? I know how to re-programme the firmware, but I'm not too great on the electrical component side. Also if you could let me know if you need to pull these pins down using a resistor as well... I know some have a pull down built in. :-)

@daspid92 I have actually just soldered some screw terminals connected the the push buttons already in the Sonoff 4CH... Works a treat, although I wish I could make it tidier....

Is it possible to connect a sensor to 4ch Pro? Desired sensor requires power i.e. 3,3V, GND or GND (it is fine) but is there any free GPIO on board or it is necessary to change one button to sensor, solder there a terminal to connect sensor and therefore lost possibility to control switches by buttons and by MQTT at the same time.

Yes it is, you can use one of the free GPIO pins to connect it to. Personally I connected it to the Serial Out pin which is also a GPIO pin exposed in Tasmota.

From: kajmaj [mailto:[email protected]]
Sent: 03 March 2018 13:38
To: arendst/Sonoff-Tasmota Sonoff-Tasmota@noreply.github.com
Cc: Steve Pearce Steve@bespokexl.co.uk; Comment comment@noreply.github.com
Subject: Re: [arendst/Sonoff-Tasmota] 4CH Pro External Switches (#1037)

Is it possible to connect a sensor to 4ch Pro? Desired sensor requires power i.e. 3,3V, GND or GND (it is fine) but is there any free GPIO on board or it is necessary to change one button to sensor, solder there a terminal to connect sensor and therefore lost possibility to control switches by buttons and by MQTT as well.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/arendst/Sonoff-Tasmota/issues/1037#issuecomment-370148089, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACtmJ2tC2UhpWJutXi0mbG8P7r1ZaGu_ks5tapyvgaJpZM4P_wh_.

Thanks. It might be GPIO2 I guess. But where on the board is this pin located? Is it TX on J6?

@radebebek Did you happen to find a way to attach on board gpio's to physical wall switches?

Hey. Would someone mind pointing out what GPIO pins I can use to monitor the state of switches and where they are located on the 4CH Pro.

To connect external sensors/switches you can use RX and TX (GPIO1 and 3, in schematic namend E-RX and E-TX) located in J1. The same as is used for flashing.
Furthermore you shall disable SerialLog via WebInterface.
View more on<#2160 (comment)>

Hi, is it not recommended to solder some external switches in parallel with the 4 push button switches? I've done it and it seems to work without issue.....

@TommySharpNZ : I got a Pro 4CH R2, and so far, I've been unable to make it work as you say: If I close a connection at the back of a button, the press gets detected only on buttons 1-3, and it somehow crashes the ESP.
The buttons are labeled with a different number each , i suspect these are not simple buttons..
can you please post a photo of how you did soder yours?
thanks

@TommySharpNZ I am interested as well, I have a Pro 4Ch on the way and would like to know if this is possible.

Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ximonline picture ximonline  Â·  3Comments

j4k3 picture j4k3  Â·  3Comments

abzman picture abzman  Â·  3Comments

kckepz picture kckepz  Â·  3Comments

Joeyhza picture Joeyhza  Â·  3Comments