Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MCP23017 plugin
#3
Cool.

I have found a couple of challenges while working on building my controller which uses the MCP23017. Firstly, it seems to be very sensitive to electromagnetic interference. That led me to some work on putting in snubbers on my relay circuits (combination of a MOV and RC snubber on each solenoid). Transients generated by my relays are dealt with via the flyback diodes in the ULN2803A Darlington transistor array that I use to drive the relays.
A second challenge is that if the Pi reboots, the MCP23017 does not automatically reset. That means, if you have an irrigation program running, and for whatever reason the Pi crashes and reboots, the GPIO output pin on the MCP23017 that is driving your relay will stay high and your solenoid will stay open. That is bad. That led me to using a GPIO pin on the Pi to control the Reset line on the MCP23017. That means that in order to start using the MCP23017, I first have to bring the Reset line (which is active low) high to bring the MCP23017 into normal operation. That works well as a fail-safe and also allows me to software-control the reset line on the MCP23017.
A second MCP23017 on my controller provides the interface to a flow sensor. Rather than directly connecting the open drain output of the Hall Effect sensor to a GPIO on the Pi, I am bringing it into a pair of cascaded 4 bit binary counters, which are connected to the GPIO inputs of a MCP23017. I then have the MCP23017 only generate inputs when bit 7 changes, meaning that my interrupt rate is reduced drastically. If I want a more precise reading, I can read the counter any time I want to. It makes the interface more complex to build, but drastically reduces my interrupt rate.
Reply


Messages In This Thread
MCP23017 plugin - by geoffr - 2016 Nov 08, 11:41 PM
RE: MCP23017 plugin - by dan - 2016 Nov 10, 09:51 PM
RE: MCP23017 plugin - by geoffr - 2016 Nov 10, 10:40 PM
RE: MCP23017 plugin - by Matias - 2016 Nov 13, 04:00 AM
RE: MCP23017 plugin - by dan - 2016 Nov 17, 11:11 PM
RE: MCP23017 plugin - by geoffr - 2016 Nov 18, 01:01 AM
RE: MCP23017 plugin - by dan - 2016 Nov 19, 11:53 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)