Mega and W5500 wiring problems and questions

Hi there, i have some Mega and W5500 wiring problems and questions i hope to get some help with.

I am making a stepper controller whit a Mega 2560 to control some peristaltic pumps (hose pumps) for watering and controlling the nutrients of the plants in my greenhouse, so it can be controlled by a SCADA like system.

This is simplified rough overview how it has to work

It should work as follows, a RS485 ground moisture censors measure the ground moisture level, if below a certain threshold it will trigger to open up a valve at that plant, and start a big peristaltic pumps that pump 1L water/min, and some small peristaltic pumps that ad nutrients to the water to help the plants grow, and the computer system will change the amount and type of nutrients depending on the type of plants and on the grow phase of the plants.

First i just wanted to use RS232 or RS485 to control the Mega, but modbus over network should work a lot easier for my solution.

I would like to use W5500 network controller, as as far as i have bin reading up on Arduino networking its the fastest/least resources solution you can get, but is the best solution for my use?

The problems that i have is hooking up a W5500.

  • I seen a lot of diagrams, and all of them uses a PWM pin, and i rather not use one, as that means i have to sacrifice a stepper controller.
  • Also rather don't use the bottom pin 50 to 53 if possible as i wane use those for relays.
  • The center ICSP pins would be best, as i seen with some W5500 wiring drawings.
  • I wane use this network controller from AliExpress, is it a good pick?

So could some one help me finish the wiring diagram.


Link to full image

And here is the first Beta PCB layout of the controller board, so you can see how its gone be used, tho the next version gone have mayor changes to it


Link to full image.

I my self am not that at home with Arduino it self, I work more with setting up SCADA systems offshore, tho i have some basic knowledge of it, but a good friend dose, but he just got a new little one, so anything i can make or find out on my own would be a good thing for him. :wink:

the SPI pins are still the same pins on ICSP header as 50, 51 and 52. 53 must be set to OUTPUT so it is best to use it for slave select. set that to library because default is 10 for Ethernet shield.

Havor:
I seen a lot of diagrams, and all of them uses a PWM pin

I guess you're talking about pin 10? That is the Ethernet CS pin. If you use version 2.0.0 of the official Ethernet library, you can configure the library from your sketch to use any CS pin you like. Let's say you take Juraj's sensible advice to use pin 53 for CS. You only need to add this line to your sketch:

Ethernet.init(53);

That function is not yet documented in the library reference because it was only recently added in the 2.0.0 release and the Arduino team hasn't yet gotten around to updating the website accordingly.

You can verify you are using Ethernet library version 2.0.0 like this:

  • Sketch > Include Library > Manage Libraries
  • Wait for the download to finish
  • In the "Filter your search..." box, type "ethernet"
  • From the search results, click on "Ethernet by Various".
  • It should say "Version 2.0.0 INSTALLED". If not, click the "Update" button and wait for the update to finish.
  • Click "Close"

Havor:
I wane use this network controller from AliExpress, is it a good pick?

Looks good to me. I really like the form factor of those much better than the Ethernet shields or the other style of W5x00 modules which are such a pain to mount securely.

pert:
I really like the form factor of those much better than the Ethernet shields or the other style of W5x00 modules which are such a pain to mount securely.

I try to solve a problem with Ethernet modules. I have two, and hey fail on EMI from a relay. The shield doesn't. I ordered original Wiznet W550io module. I hope it will work.

I'm using one of the cheap red Chinese W5100 modules from eBay in close proximity to four 5 A Songle mechanical relays on one of the cheap Chinese modules, a 20 A mechanical relay, and a 20 A mercury displacement relay switching a 15 A load. It works fine. However, during initial testing without the relays I definitely had a lot of problems. This caused me to write my code so that the system was very resilient to temporary communication failures so that might be masking problems caused by the relays.

Are you having trouble with one of these mini W5500 modules in a DIL form factor?

I've been meaning to redo that project and use one of these W5500 modules instead of the W5100 module since the W5100 module is so annoying to mount. I've done some work with the W5500 on my workbench but not actually in a finished project yet.

I'm just wondering, why you want to use the mega board but not stack on one of the POE prepared Ethernet shields.
On the other hand, if there is no need for the "Arduino like" form factor of the MEGA Board, you can consider to go towards a pro mini (with or without usb). Something like https://nl.aliexpress.com/item/Arduino-Mega-2560-PRO-MINI-Ingebed-MCU-ATmega2560-USB-CH340G-Elektronica/32896317156.html?spm=a2g0z.search0104.3.30.6b2a607apXBcE6&ws_ab_test=searchweb0_0%2Csearchweb201602_5_10065_10068_5015215_10547_10059_10548_10696_100031_10084_5015115_10083_10103_451_10618_452_5015815_10304_10307_10820_10821_5015915_10302%2Csearchweb201603_2%2CppcSwitch_4&algo_expid=8417f0c3-1de4-4b47-aa61-ec903628764c-4&algo_pvid=8417f0c3-1de4-4b47-aa61-ec903628764c&priceBeautifyAB=0

pert:
I'm using one of the cheap red Chinese W5100 modules from eBay in close proximity to four 5 A Songle mechanical relays on one of the cheap Chinese modules, a 20 A mechanical relay, and a 20 A mercury displacement relay switching a 15 A load. It works fine. However, during initial testing without the relays I definitely had a lot of problems. This caused me to write my code so that the system was very resilient to temporary communication failures so that might be masking problems caused by the relays.

Are you having trouble with one of these mini W5500 modules in a DIL form factor?

I've been meaning to redo that project and use one of these W5500 modules instead of the W5100 module since the W5100 module is so annoying to mount. I've done some work with the W5500 on my workbench but not actually in a finished project yet.

W5500 lite and NIREN W5500 module. I didn't find a schema for this modules. They stop working until reset. I suspect the EMI hits them over 'ground' connection. The relay module has recommended circuit around coil. I could add a snubber circuit to AC side, but it is an ohmic load (heater), not inductive so it should not create a strong EMI.

pert:
Let's say you take Juraj's sensible advice to use pin 53 for CS. You only need to add this line to your sketch:

Tnx thats all i needed to know. :slight_smile:

And as i understand it now pins 50, 51 and 52 share there connection whit the ICSP center connector.

You can verify you are using Ethernet library version 2.0.0 like this:

That i leave over to my friend, i am not that at home whit Arduino myself yet, and leave the programming over to him, i could learn, and i will some when doing this project with my friend, but i am more at home with SCADA systems, scripts and modbus for my work, have bin doing very little programming the last years, and non on a Arduino.

Looks good to me. I really like the form factor of those much better than the Ethernet shields or the other style of W5x00 modules which are such a pain to mount securely.

Yes, i also did not like the shields and wire solutions that much, i wanted to be able to socket mount or even solder the module to the stepper controller board.

But on Juraj advise i think i go for the Wiznet W550io module, tho i am not that afraid of EMI as i will mount the relays about 1ft/30cm away from the board, and after reading about the problems, i will put up some shielding around the relays boards.

Juraj:
I try to solve a problem with Ethernet modules. I have two, and hey fail on EMI from a relay. The shield doesn't. I ordered original Wiznet W550io module. I hope it will work.

Looks a little more robust, and can still be mounted properly, so i will go for that one.

noiasca:
I'm just wondering, why you want to use the mega board but not stack on one of the POE prepared Ethernet shields.

Don't need PoE, as i will tap 5V from the 24V to power the Arduino and the stepper modules, as the 5V out also doubles as a 5V in, and doing that way i also avoid grounding problems.

On the other hand, if there is no need for the "Arduino like" form factor of the MEGA Board, you can consider to go towards a pro mini (with or without usb). Something like

Form factor is really not that important, tho the mostly single rows of the normal Mega makes it a little easier to route the traces on the PCB, and i have a template of the Mega in the software i use.

Is this the correct way of wiring the W5500?


Link to full image.

sorry I will have WIZ850io

Juraj:
sorry I will have WIZ850io

The WIZ550io is basically the same, only the WIZ550io board has a PIC processor which does some config on the W5500 chip, i just wondering if the PIC chip is a plus or a minus?

And i can still change to the WIZ850io if that's the better option.

And i am just wondering if i hooked up the WIZ550io the right way?

Havor:
And i am just wondering if i hooked up the WIZ550io the right way?

yes