Notifications
Clear all

Arduino I2C Bus and 6 x MCP23017 devices

5 Posts
3 Users
3 Likes
841 Views
(@john40131)
Estimable Member
Joined: 4 years ago
Posts: 104
Topic starter  

I am still working on my Model Railway layout and I eventually got one section to control Points and Aspect signals when a train is detected and allowed to past on a route I select ... but now the original section is going to get a make over with another Mimic panel which has 40 Bi-Colour Leds on it and is using a Nano's I2C bus connected to 6 x MCP23017 devices and I am using all 96 IO ports for Inputs and outputs, the devies are all mounted on a PCB I designed using Eagle Cad and is the size of A4, it also has 20 push buttons for point and route selection, I have yet to write the sketch and is going to be a challenge but once I have the first Switch Case it will just be a copy and paste and modify content ...

I did make provision for a Nano, an ESP32 and a standalone Atmega328P ... not sure which yet but the Atmega328P is a contender ..

4 way Crossing Mimic Panel Control
This topic was modified 2 years ago 2 times by John40131

   
Inq and Inst-Tech reacted
Quote
Inq
 Inq
(@inq)
Noble Member
Joined: 2 years ago
Posts: 1846
 

I'm a big fan of the ESP8266.  The CPU power of nearly 10x Atmega 328 with WiFi ability and cheaper too.  You could host a web server on it and all your fantastic track switching could be duplicated virtually on a web app to control and see details of what's going on on a cell phone or a big screen TV and everything in-between.  

Do you have the train set up already or drawings you can share?

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5900
 

@inq Yes, but the ESP32 has all that plus a LOT more GPIO. 

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote
Inq
 Inq
(@inq)
Noble Member
Joined: 2 years ago
Posts: 1846
 
Posted by: @zander

@inq Yes, but the ESP32 has all that plus a LOT more GPIO. 

All true and wouldn't cost that much more than the esp8266.  It was just MY preference as I have code that works on the esp8266.  But @john40131's custom board... Sounds like it has far more pin capability than any of them and is fully controlled by i2c... Thus only needing 2 pins of the mpu.  

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Ron
 Ron
(@zander)
Illustrious Member
Joined: 3 years ago
Posts: 5900
 

@inq Yes, his expander boards make that difference pretty much irrelevant. BTW, how is the INQ port to ESP32 coming? 

Arduino says and I agree, in general, the const keyword is preferred for defining constants and should be used instead of #define
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon
My experience hours are >75,000 and I stopped counting in 2004.
Major Languages - 360 Macro Assembler, Intel Assembler, PLI/1, Pascal, C plus numerous job control and scripting


   
ReplyQuote