Raspberry PI GPIO płytka rozszerzająca

I would like to show You a board I built A board lets You to easily expand amount of digital inputs and outputs of raspberry PI What is on that board There is full size GPIO port which allows You to connect directly to Raspberry PI In this example I’m using Raspberry PI model B, which has shorter GPIO pinout but the board is suitable mostly for Raspberry PI 2 and 3, where GPIO has 40 pins With these models You can easily connect board with Rasbperry PI using 40 pin ribbon cable and have very good and comfortable connection Additionaly there is another GPIO output So, after connecting board to Raspberry PI You will still have a GPIO port available the board is not blocking GPIO port And now, what can You do using this board There are two MCP23017 chips which are I2C GPIO expansion chips Each of them has 16 PINs which You can use as inputs or outputs On this board I placed two chips So in summary I have 32 pins available I assumed that 16 pins will be used as digital inputs and another 16 will be used as digital outputs here are those chips In the middle of the board there are connectors where You can connect swiches for example bell switch shortcutting those pins (with a swich or anything else 0 – ie a jumper) gives a high state to one of input pins of MCP23017 chip and in this way those pins works as input We can use them for discovering switch state and steering another devices Additionaly I wanted this board to work with any DC voltage level Personally I tested it with +5V DC and with +12V DC but I think there should be no problem with using for excample +24V DC voltage I used 16 transistor keys which are connected to MCP23012 chips outputs 8 on one side and 8 on another side In this way with this board You can control devices which requires higher voltage and higher current than Raspberry PI can supply Here on the board We have connector where external DC power supply is connected In this example I connected another +5V DC supply from my breadboard because for testing purposes I connected 16 leds with resistors which requires +5V DC and now I easily can test my board functionality So, here are the inputs here are the outputs. 8 on one side and 8 on another side These are outputs which works as transistor keys So, enabling one of outputs gives high level on its output pins “high level” in this case is the voltage level which we connected as external voltage supply

So if I connected +5V as external DC then after enabling selected chip output I will have +5V DC in selected LED output If I will connect +12V DC as external DC, I will have +12V on selected output It gives us quite large flexibility because thanks to this board we can easily connect to Raspberry PI devices which require higher voltage level than Raspberry PI supplies and of course we have higher current efficiency personally I tested it with devices using 1.5A current and everything worked OK I thing there still was some reserve, but I didn’t have higher current devices what else interesting we have here so… we have two chips which gives us 16 input and 16 outputs this side of the board contains 10 one wire bus inputs so we can connect 10 one wire devices directly to Raspberry PI Personally I’m using it with dallas 18b20 temperature sensors in my project I don’t have to connect another “cable spider” to Raspberry I’m connecting 3-pin sensors directly to my board I do not have to add another resistor to one wire bus, because it is already placed on the board so one wire devices can be connected directly It is very comfortable Here on the board we have descriptions: minus, plus, signal so we know how to connect one wire device another interesting thing… here we have 3 pins there is description “LIRC” on the board I assumed that I will need infrared remote control for my devices So I can directly connect here one of TSOP type here there are many TSOP type chips and configuring Raspberry PI in specified way, installing LIRC modules, etc (configuring LIRC is a subiect for another movie) we can control connected devices using any remote control Sometimes we do not want to have digital output with transistor key (with external voltage level) we simply want to have high or low state directly from MCP chip In this case high level is +5V and low level is GND For this requirement I added additional goldpins connected directy to MCP chips outputs (before transistors) So you can connect device directly to those gold pins if You do not want transistor key and You have direct access to high or low state from MCP chip Where can we use it For example quite popular are relay PCB boards which are powered with separate plus and minus pins and we are steering relays with low level state then we cannot connect it to transistor key outputs because on output pins we have directly external power supplied we need direct output value from MCP chip in this situation control pins from relay board we connect to MCP output pins

and then everything works perfectly I also placed additional 8 goldpins with external DC So after connecting +12V DC you will have +12VDC on those pins here I placed 8 pins with +5V DC and 8 pins with GND It gives me another flexibility and allows me to use a board in different situations And now I will show You a board at work I’ve written small program in Java using Pi4J library Ofcourse I will share it if someone is interested this program enables specified output after receiving a signal from input, and a LED on output should start to lit I hope it will be visible enough When I shortcut this input the LED is on. When I disconnect input the LED is off And I can test it in that way Ofcourse there is no direct correlation between inputs and outputs It all depends on a software You will use What am I using it for I personally use this board for home automation I placed in in my garage in rack cabinet and I’m using it for remote controlling of my house lights and other 220V devices as a entrance gate I connected bell switches to those pins and then pressing a switch gives high state to one of those outputs and it changes a state of e relay which turns specified 220V device all circuit works pretty stable and I encourage you to try this approach I’m also using one wire connections I have connected 8 dallas temperature sensors Everything works without any problems It reads temperature pretty well we can use another software, for example OpenHab which can steer your home automation very well I’ve written additional bindings for OpenHab which allows us to use this board with OpenHab I’ve written a binding for reading temperature from one wire inputs and then using OpenHab functionality it is possible to store values in database draw some charts an make analisys additionally I’ve written a binding which allows to use MCP23017 chip with OpenHab Software I’ve written is designed for OpenHab 2 There were modules for OpenHab 1, but not compatible with OpenHab 2 So I was forced to write my own solution These bindings are available for free If someone is interested, I can send a link ofcourse You can use multiple inputs at one time we can turn on any output we want It is not all what You can do with this board MCP chips use I2C bus, so any of them has its own address These addresses are set using jumpers on the board We have 3 bits for setting a chip’s address so we can have 8 different addresses We can easily control 8 MCP chips at one time

Because I placed another GPIO output on the board We can connect second board to the first one readdress chips on the second board and then We have 16 inputs and 16 outputs on first board and additional 16 inputs and 16 outputs on second board because of these two boards we have 32 digital inputs and 32 digital outputs available in simple way We can easily address 8 chips, so It is easy to count how many input and outputs we can get using 4 boards And what is interesting, each of these boards can work with different external DC voltage In this example first board is powered with +5V DC so these outputs will support +5V devices but this board I’ve connected to +12V DC because I wanted to controll this relay board I’ve connected 4 relays of 16 available I only had 4 male wires available but we can ofcourse connect all of them and with one board You can control 16 devices working with 220V AC this relay board works as low level input so when switches aren’t shortcutted, the relay is enabled Ofcourse we can easily programatically give high level to MCP output after start and then these relays will be off by default it is fully programmable and dependent of a user In my case it is on by default and as You can see after I shortcut a switch connected relay state is changing so we have four relays easily controlable ofcourse here we have 10 one wire connectors and here we have additional 10 one wire connectors so we can easily connect 20 one wire devices to raspberry PI as You can see these relays are controlled directly with low level state so this is what I said before I didn’t connect it to transistor key because enabling a switch gives us 12V at transistor output this board is connected to +12V DC I didn’t want to use transistor keys I wanted to use low level state from MCP chips directly so I connected relays to those goldpins I told You before In this way I can control relayboard easily It is not important if it is one, two, four or 16 relay board I cant connect it easily and control relays I think it is full functionality of my board feel free to post comments and ask questions If someone is interested in buying that board I’m soldering it manually I can prepare it and put on some auction portal or sell it in another way Thank You for watching