Single I/O pin – double function

There are many situations when you simply run out of I/O pins on microcontroller. For new project you can always select different microcontroller with more pins or ad I/O expander. If you have project running on Raspberry Pi and almost all your pins are busy, then you should try to go smart way. Emilio faced this problem when he needed to add LED indicator and button to his existing project, but there were only single free pin available. So he thought that functionality could be achieved with single pin quite easy. He attached LED to power supply via current limiting resistor. Then using same pin he added push button to ground through another resistor. The rest depends on how program controls that pin. In this case Python script simply runs… Continue reading

Arduino I2C expansion I/O

Did you have a situation when you ran out of microcontroller pins. Especially when you do lots of interfacing, adding many buttons or LEDs then you definitely need many I.O pins. Sometimes you can use more advanced microcontrollers, but this isn’t best solution especially when you don’t need much processing power. Why not to use I/O port expansion? Keith decided to experiment with I2C port expanders connected to Arduino board. He used Texas Instruments PCA9535 and PCA9555 16-bit I/O port expanders – one for inputs and another for outputs. This way he managed to add 16 additional I/O pins by scarifying 2 MCU pins. Author has provided a generous description about whole process and even gives us a program code for trying. Continue reading