IO PI MCP23017 powered from 16ch relay board
2437 Views - Created 27/08/2018
Otherwise i would have to connect 80, 1m cables from IO PI Zero expander to relays.
I've made also one extra hole in IO PI pcb to solder pcb ground to socket pins. Now ground of IO PI and relay board are connected.
The relay board have 12v power supply and 5v inverter, I had powered IO PI from those 5v, but raspberry didn't found and device.
When i connectect 3,3v from raspberry it worked, all 16 relays are working but still have some questions and one issue.
1) I dont wanna force raspberry to power any device, so i have to power IO PI Board with 5v and 3,3 also ?
2) I use wiringpi to control of this board with command: gpio -x mcp23017:100:0x20 mode 100 out ... till 15 then i used
gpio -x mcp23017:100:0x20 write 100 ( 1 or 0 ) to change state and its working well when i'm turning on relays.
When all relays are ON i can't turn off any of them, until i'll first turn off 15, but then 8 relays are turning off, so i'm consfused.
Theres also Interrupt A and Interrupt B thing, so don't know what to do rignt now.
I'll be glad for help.
You can power the 5V side of the IO Pi Zero from your relay board but you will need to connect the 3.3V pin to the Raspberry Pi as this is used by the I2C level translator to power the Raspberry Pi's side of the I2C bus.
I haven't used wiringpi for a long time so I am not sure how it works with the mcp23017. We do have a command line program for controlling the IO Pi on our GitHub repository at https://github.com/abelectronicsuk/ABElectronics_CLI/tree/master/iopi_c You can use it for controlling all aspects of the mpc23017 directly from the bash shell. It may be worth giving that a try and seeing if it works any better than wiringpi. We also have IO Pi software libraries for Python, C, C++ and NodeJS.
Interrupts A and B are used when using the IO Pi for digital inputs. You can configure the interrupts to go high or low when a specified pin, or pins, either change state or goes to a preset state. The interrupts are normally used so you can check to see if an input changed without having to keep reading the value from that input continuously. There is a better explanation of how the interrupts work in the datasheet for the MCP23017 on page 24 but as you are using the IO Pi to control relays you shouldn't need to use the interrupt pins.
and it worked. The wiring pi was not necessary because i found iopi soft on github designed to home assistant, and now it's
working like a charm. Good Work GUYS! Therese only one problem i cannot solve myself. My relays boards are activated low.
Now i have inverterd switches in home assistant. Also when im rebooting Pi all relays blink for a second and it's not good for me
because when i will connect 230v devicec through relays it may cause fuses protection problem when all devicec turn of for a
second. Think the blinking is causes by Changing Pi state while lib is loading but when i looked in iopiswitch.py code i realised
im to stupid in this moment to understand that :-)
Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.