Difference between revisions of "MCP23017"

From Let's Control It
Jump to navigation Jump to search
Line 21: Line 21:
 
You can control output pins on this chip with the following http command:
 
You can control output pins on this chip with the following http command:
  
http://<ESP ip>/control?cmd=mcpgpio,<gpio>,<value>
+
<nowiki>http://<ESP IP address>/control?cmd=mcpgpio,<pin>,0</nowiki>
 +
 
 +
<nowiki>http://<ESP IP address>/control?cmd=mcpgpio,<pin>,1</nowiki>
  
 
== ESP Connextio ==
 
== ESP Connextio ==

Revision as of 15:49, 25 September 2015

Introduction

The number of GPIO pins on the ESP module can be expanded with a IO Expander. We will use the MCP23017 that provides 16 more outputs. This way it becomes possible to control a 16 channel relay board.

Hardware

MCP23017DIP28.jpg

The MCP23017 needs to be connected through the I2C interface. This chip is compatible with 3V3 and it can be connected to the ESP without levelshifters..

Connections

 MCP23017 	ESP-01
 GND 	 	GND
 VCC    	VCC
 SDA		GPIO 0
 SCL		GPIO 2

Software

ESP Easy

You can control output pins on this chip with the following http command:

http://<ESP IP address>/control?cmd=mcpgpio,<pin>,0

http://<ESP IP address>/control?cmd=mcpgpio,<pin>,1

ESP Connextio

Command:

MCPWiredOut <pin nr>,<On/Off>
Parameter: Beschrijving: Bereik: Opmerking:
Pin nr Output pin 1 t/m 16
On/Off Aan of Uit On/Off

Sample

MCPWiredOut 1,On