I am trying to use Adafruit's ESP8266 implementation for a project of mine, which makes use of a bunch of sensors. The problem I have is the limited amount of pins available from ESP8266:

  • 2 pins are currently being used by I2C (SCL & SDA, pins 4 & 5)
  • 4 pins used by the SD card (MOSI,MISO,CLK & CS, pins 12,13,14,16)
  • 1 as a button input (pin 15)
  • 2 for a UART sensor (Tx and Rx)
  • 2 used for LEDs (pins 0 & 2, using the onboard LEDs)

This leaves me with no serial debugging and no future expansion capabilities, which is quite problematic, as I will probably need to add 1 more UART sensor.

One solution would be to use the analog input pin as the button input and free up one of the LED pins to create a 2nd software UART (not ideal, but it is a solution indeed).

My question is, is it somehow possible to multiplex the pin functionality without using an external IC (space is already quite limited)? So for example, use 2 pins as UART, when I am not writing to the SD card. Or would this just cause more problems?

Thanks in advance!

  • If you need debug capability, and you may expand later with more sensors, and you don't want any additional chips, its probably best to just get another MCU with more GPIO pins. Apr 23 '16 at 4:16
  • I also think you have made a suboptimal hardware choice, but ... There are probably software multiplexing solutions, but are you using the Node lua or Arduino "C"? However I think you might be better reconsidering you design and seeing if you can replace the SPI bus with I2C (ideally) or I2C with SPI. Apr 23 '16 at 18:17
  • I am using Arduino "C" and normal C. Do you have in mind any of the software multiplexing solutions? I cannot find any.
    – DimP
    Apr 23 '16 at 21:33

This site is temporarily in read only mode and not accepting new answers.

Browse other questions tagged .