expand GPIOs

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
andy-ich
Normal user
Posts: 10
Joined: 17 Mar 2016, 07:59

expand GPIOs

#1 Post by andy-ich » 06 May 2016, 16:51

Hi,

i have bought the following button-switch(Gira Tastsensor 24v):
http://download.gira.de/data2/20011210.pdf

... and will now make it smart with an ESP and ESP Easy and integrated into my openhab.

The goal is to use all the 6 buttons and drive the 6 status LEDs and the backlit individually via PWM.

Unfortunately the esp8266-07 has for too little GPIOs. Even with a esp8266-12f it looks bad.

What do you think the following is possible with Esp Easy?

esp8266-12f GPIO0 LED1 with PWM
esp8266-12f GPIO4 SDA for PCF8574
esp8266-12f GPIO5 SCL for PCF8574
esp8266-12f GPIO12 LED2 with PWM
esp8266-12f GPIO13 LED3 with PWM
esp8266-12f GPIO14 LED4 with PWM
esp8266-12f GPIO16 LED5 with PWM
esp8266-12f GPIO9 LED6 with PWM
esp8266-12f GPIO10 BG LED with PWM
PCF8574 P1 Button1
PCF8574 P2 Button2
PCF8574 P3 Button3
PCF8574 P4 Button4
PCF8574 P5 Button5
PCF8574 P6 Button6

Wie kann ich in EspEasy den "Switch Button Type" des PCF8574 Ports einstellen?
How can I set the "Switch Button Type" of PCF8574 ports in EspEasy?

Thank you very much

dduley
Normal user
Posts: 93
Joined: 06 Feb 2016, 17:56

Re: expand GPIOs

#2 Post by dduley » 06 May 2016, 17:23

andy-ich wrote:Hi,

i have bought the following button-switch(Gira Tastsensor 24v):
http://download.gira.de/data2/20011210.pdf

... and will now make it smart with an ESP and ESP Easy and integrated into my openhab.

The goal is to use all the 6 buttons and drive the 6 status LEDs and the backlit individually via PWM.

Unfortunately the esp8266-07 has for too little GPIOs. Even with a esp8266-12f it looks bad.

What do you think the following is possible with Esp Easy?

esp8266-12f GPIO0 LED1 with PWM
esp8266-12f GPIO4 SDA for PCF8574
esp8266-12f GPIO5 SCL for PCF8574
esp8266-12f GPIO12 LED2 with PWM
esp8266-12f GPIO13 LED3 with PWM
esp8266-12f GPIO14 LED4 with PWM
esp8266-12f GPIO16 LED5 with PWM
esp8266-12f GPIO9 LED6 with PWM
esp8266-12f GPIO10 BG LED with PWM
PCF8574 P1 Button1
PCF8574 P2 Button2
PCF8574 P3 Button3
PCF8574 P4 Button4
PCF8574 P5 Button5
PCF8574 P6 Button6

Wie kann ich in EspEasy den "Switch Button Type" des PCF8574 Ports einstellen?
How can I set the "Switch Button Type" of PCF8574 ports in EspEasy?

Thank you very much
Hi Andy,

Don't use GPIO 9 or 10!! Its a good way to brick your ESP. I learned this the hard way. See this thread for more info: http://www.esp8266.nu/forum/viewtopic.php?f=6&t=1462
I assume you want to dim the LEDs and that's why you want to use PWM?

regards

Dave

andy-ich
Normal user
Posts: 10
Joined: 17 Mar 2016, 07:59

Re: expand GPIOs

#3 Post by andy-ich » 06 May 2016, 17:43

Yes, I would like to dim the status leds at night - in the bedrooms.

dduley
Normal user
Posts: 93
Joined: 06 Feb 2016, 17:56

Re: expand GPIOs

#4 Post by dduley » 06 May 2016, 18:27

andy-ich wrote:Yes, I would like to dim the status leds at night - in the bedrooms.
Hi Andy,

Here's a crazy idea. Change the drive method slightly for your LEDs. Use an additional PCF8574 or use a single MCP23017 as the on off control for the individual LEDs then That would free up most of the ESP GPIOs. Then use a single GPIO as a PWM output to drive the other side of the LEDs. Normally you would connect the Cathode (-) of the LED to the GPIO or PCFGPIO through a current limit resistor. The Anode of the LED would then just be tied to +3.3. A 0 or low on the GPIO would light the LED. This is usually best because in most cases GPIOs can sink more current than they can source. In this case you would do the same thing. Connect the Cathode through a resistor to the PCFGPIO. Connect a GPIO through a resistor to the base of a PNP transistor and use the transistor to drive the common anodes of all your LEDs. The transistor is used to bump up the drive capability of the GPIO so it can drive 6-8 LEDs at 10-20ma each. You would not be able to individually dim the LEDs but if its just a day/night thing then this would work. The PCFGPIOs would be the on/off control and the GPIO would set the brightness. Then you have GPIO to spare!

Regards

Dave

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 16 guests