Guidance in selecting the best Arduino for my project (WiFi + 30 GPIO)

I have a project that I want to use an Arduino in as opposed to something like a Pi0 only because I expect this device to be plugged and unplugged all the time and I don't want corrupted code.

I need to read a series of three-position switches where up is on one GPIO, the middle is connected to nothing and down is connected to another GPIO) with a total of 6 of those switches, then I need to run 8 relays. So I think I need 20 GPIOs right there, then I need to read a hull sensor as well and a 1-wire temperature probe. I will also be adding a non-contact liquid level sensor. So all-in-all I am thinking like 30 GPIOs to make sure I have enough to handle everything I want it to do.

It also needs WiFi built into the board.

Oh, and it needs to be pretty quick since it will both need to respond to a RaspberryPi telling it what relays to throw as well as calling out to a restful API on the Pi itself to update it with switch position information, temperature, etc.

On the Pi, all of this is easy and while I have used many Arduinos, I have never attempted something like this with one.

I was thinking about the Arduino Mega 2560 since it shows 54 digital and 16 analog GPIOs, but alas - no WiFi. I thought I found one, it is basically a Mega 2560 with an esp8266 but you have to keep flipping all of these dip switches to make the WiFi work, and its a knockoff from Bangood.

I also looked at the Arduino MKR WiFi 1010 with I2C where I could drop and MCP23017 or 2 on it to get the GPIOs I need, but I was not sure about the speed and if it would be enough to do everything. The same with the MKR1000 WiFi (which based on the model number might be slower than the 1010?)

And finally, I looked at the Arduino Nano 33 IoT, but again it does not have the necessary GPIOs to do what I need it to do and I am not sure where the different processors actually fall in regards to speed. Although it also has I2C so I can add a GPIO expander to what it already has.

Anyway, I am hoping for some guidance for those of you in the know!

Many Thanks

You can read the specifications for the different controller and look at the system clock rate. A Mega looks good regarding the number of I/O needed. Surely a Wifi board can be addd. But..., there might be some more controller that meets Your demands. Look at the data sheets for I/O and clock speed.

Thank you...is it just the faster the clock speed the faster the device? It has no basis on the cpu itself?

Compare which CPU the various boards use. If the CPU is the same, choose the one using the highest clock frequency.
Maybe some other helper can tell more, knowing which boards use faster CPUs.

Did you look at an ESP32 board.
Leo..

Wawa:
Did you look at an ESP32 board.
Leo..

Leo -

I did see that board but it does not seem to use the Arduino IDE but a combination of other software, so it looks like a much higher learning curve. But for $8 I might give it a try. Thank you

MD500_Pilot:
Leo -

I did see that board but it does not seem to use the Arduino IDE but a combination of other software, so it looks like a much higher learning curve. But for $8 I might give it a try. Thank you

Nonsense. I've been programming ESP boards using the Arduino IDE, mostly the Wemos D1 Mini and the NodeMCU boards. And one ESP32 project.

I have one project that needs 12 GPIO ports to discreetly drive some 3-color LEDs. It uses a Wemos d1 mini and an MCP23017 Port Expander. If you need more than 16 GPIO ports, add a second MCP23017. A Wemos ($5) and two port expanders ($2) gives you 32 GPIO ports, WiFi, more RAM than most Arduino boards, and built-in WiFi.

Whenever you say "WiFi", I say "ESP8266". The ESP32 is of course another option.

This replaces an Arduino - but programs perfectly well with the Arduino IDE. And dirt cheap!

30 I/O? OK, that sounds like two MCP23017 or two PCF8575.

In fact if there are no other I/O requirements, you might even make do with an ESP-01.

The ESP32 was mentioned because might have enough I/O by itself,
without having to add any port expanders.
Leo..

Since the RPi can do this easeasily, and you seem to be familiar with it. Why not use a Pi?

You also say plugged and unplugged all the time.

It seems like too many undefined variables.

What is "all the time"
What is "speed"
What is "plugged?"

Also what are you connecting? Are you changing sensors or creating a portable box with fixed sensors?

An ESP8266 with port expanders and shift Registers may be able to handle the project.

A simple option might be to connect an ESP8266-01 module to a Mega?

...R

SteveMann:
Nonsense. I've been programming ESP boards using the Arduino IDE, mostly the Wemos D1 Mini and the NodeMCU boards. And one ESP32 project.

I have one project that needs 12 GPIO ports to discreetly drive some 3-color LEDs. It uses a Wemos d1 mini and an MCP23017 Port Expander. If you need more than 16 GPIO ports, add a second MCP23017. A Wemos ($5) and two port expanders ($2) gives you 32 GPIO ports, WiFi, more RAM than most Arduino boards, and built-in WiFi.

Yeah, I like the MCPs, I have a large project that runs 42 different relays using MCP23017s, but all on Pis and under python. What I am going to be designing is my first remote module for that project and I am going to be space-constrained so I was hoping for one with all the GPIOs built-in already. Also, I watched a bunch of videos on the Wemos boards and they had to keep switching dip switches around to talk to different parts of the board and to get the WiFi to talk to different parts of the board, not at all what I expected.

dave-in-nj:
Since the RPi can do this easeasily, and you seem to be familiar with it. Why not use a Pi?

You also say plugged and unplugged all the time.

It seems like too many undefined variables.

What is "all the time"
What is "speed"
What is "plugged?"

Also what are you connecting? Are you changing sensors or creating a portable box with fixed sensors?

An ESP8266 with port expanders and shift Registers may be able to handle the project.

Well, one time getting unplugged the wrong way can nuke a Pi file system, so even once is too much.

This device I am building is part of another project and it will hold several sensors (liquid level, temperature, water flow) and will operate six water valves, a 1400GPH pump, a 12V peristaltic nutrient pump, and have 6 triple position switches for local operation. All of this needs to talk WiFi back to my main unit and the main unit will make all of the necessary decisions and then send commands back for the MC to follow.

It will likely be in a spot where no one cares about unplugging it without making sure the computer running it is shut down correctly. My main unit has a real Pi UPS with auto shutdown, etc. I don thave room in this case for that kind of hardware. Microcontrollers don't give two cents how many times you unplug them.

SteveMann:
Nonsense. I've been programming ESP boards using the Arduino IDE, mostly the Wemos D1 Mini and the NodeMCU boards. And one ESP32 project.

I have one project that needs 12 GPIO ports to discreetly drive some 3-color LEDs. It uses a Wemos d1 mini and an MCP23017 Port Expander. If you need more than 16 GPIO ports, add a second MCP23017. A Wemos ($5) and two port expanders ($2) gives you 32 GPIO ports, WiFi, more RAM than most Arduino boards, and built-in WiFi.

Well, I might have been looking at a different board, All of my microcontroller stuff around the house uses Moteinos from Low Power Labs. They have nothing like this that I need.

I think I will get one of the ESP32-S2 boards to try out. For $8 it is worth trying it out.

Thank You

Robin2:
A simple option might be to connect an ESP8266-01 module to a Mega?

...R

I was really hoping for a single board solution due to space constraints. This is why I didn't want to use the GPIO expanders as well. :slight_smile: