Wifi shield for Mega2560 Arduino

I need a well-documented and reliable Wifi shield for a school project using a Mega2560 that needs to connect to a home router, so I want to avoid having to spend time dealing with idiosyncrasies. Could someone help with the purchasing decision - is the Adafruit WINC1500 with PCB antenna in this class or do I need to spend more money and go with the DFRobot Wifi shield with detachable antenna, or something else entirely? Any help is greatly appreciated.

Hi @PETER21635,

There are a lot of WiFi boards, although I assume what you are looking for is a way to manage serial data wirelessly from the Arduino Mega. If so, consider these favourites (lots of intel on the product pages)

Many people turn to more-modern boards (the Mega is quite dated) that have WiFi onboard and feature over the air programming along with cloud connectivity, such as the Particle Photon:

1 Like

Graham, thanks for that. I’ve already got 2 Mega2560s and a bit of work has already been done connecting to sensors and driving motors so I’m reluctant to change horses now to the photon.

I already have a tiny webserver working but connected via Ethernet shield to my router. I’ve got it talking to the Internet using port redirection. What I want to do is avoid the physical Ethernet connection if possible.

I need something that’s as close to plug and play you can get and is well supported with libraries using the Arduino IDE. I’d rather pay a bit more now than burn a lot of time getting things to talk together.

Hi Peter,

If you’re after something that is guaranteed to be easy to work with, then I’d definitely recommend pivoting to the Photon. By the time you connect your Arduino up using a WiFi board, the Photon is already cheaper, not to mention easier to use. That said, if you did want to stick with the Mega, the Adafruit module that Graham linked to would be your best option.

Photon will be almost a copy/paste for most things porting from Arduino. However, that’s not always the case and perhaps you’d be better off with the Adafruit module.

Full guide for it is here

Graham,

The description for the Adafruit ATWINC1500 WiFi Breakout says “seems to work OK on Uno but may not work on other Arduinos” so I assume that you are supremely confident it will work on the Mega.

Secondly it may be a silly question but why would I go with the breakout as opposed to the shield ?

thanks

I haven’t been down that road so the short answer is “I don’t know”.

I’ve noticed there are fewer WiFi shields on the market and well-supported modules are harder to find. This is perhaps driven by modern devices that have WiFi “built-in” such as Particle Photon, Pi Zero W, Onion Omega, ESP8266, ESP32, and so on.

With Arduino/MCU projects, makers lean to wireless serial devices such as these. The chips at the heart of the Arduino Uno and Mega (ATmega328 & ATmega2560) were designed in a pre-“Internet of Things” era, but are still very relevant wherever serial data is used (UART/SPI/I2C).

I’m curious to hear where you go with the project - keep us updated!

Graham, if I could get a refund if it doesn’t cooperate I’d be happy to give it a go. And thanks for all your input

Hi Peter,

We can’t sustainably offer refunds for that sort of scenario, especially for parts that have been soldered.

I gave it a go but eventually came up with 1 insoluble problem and one worry. All works well with the example sketches up to the web server - then I find that internet browsers on wired PCs and wifi notebooks work but smartphone browsers over wifi do not work. Could find no way around this despite considerable investigation including trying out different APs. No go. The other worry was the instability, the board would drift off and cease responding after various intervals. Since I couldn’t solve problem 1 I gave up at this point.

I’m really not sure where to go from here but have been reading up on the ESP32 and photon. I’m tempted to go with the Sparkfun Thing and use an I2C expansion if I need more pins.

Hi Peter,

If the webserver is serving basic HTML content, then it should work on mobile devices without anything special. Might be worth checking the IP range of the mobile devices, it’s possible they are on a different IP range (which could happen for a range of reasons, such as how the dual band is configured on the device). If just the last cluster is different, then that’s perfect.

Secondly, do not use “localhost” or text hostnames. Use the IP address of the Arduino device in your browser address bar. Providing the first 3 clusters of the IP address are the same on the Arduino web server and the smart device, then should connect fine.

For example, if the IP address of the Arduino device was 192.168.1.85, then put in your phones browser

http://192.168.1.85

This will open a HTTP request over port 80. If you wanted to define a specific port (unsure if the Arduino library supports this) then you could do this for port 3050:

http://192.168.1.85:3050

The problem isn’t that the browser on the Samsung is invisible to the webserver on the breakout (and vice versa), it’s that when the browser sends the URL the web server does recognise it has a client as client.connected() is true, but client.available() is false, so it never takes the next step to send the page. From the browser’s viewpoint it is definitely waiting for the page from the server. It will only report an error when I turn off the server. There is something quite deep about the browser’s communication that the server doesn’t like. As I said if I try from my notebook it just works. Who knows maybe it is a Mega related issue.

Even if I could resolve this simply I’m going to look for another solution due to the many reports of instability. My thinking is to either try and use the Sparkfun Thing for WiFi only, or maybe port the whole application, and if I run out of pins use the Sparkfun I2C expansion.

I’m interested in your thoughts.