WiFi Connection via TinyDuino and WiFi TinyShield

by TinyCircuits Staff June 05, 2018

WiFi Connection via TinyDuino and WiFi TinyShield

In this tutorial, we are simply going to learn how to connect to WiFi using the WiFi TinyShield ATWINC1500.


Materials:

Hardware:

or
  • You can use a TinyZero in place of the TinyDuino and USB TinyShield

Software:


Step 1: Assembly (Hardware)

To create the desired set up, place the TinyDuino as the base, then the USB TinyShield on top of the TinyDuino, and the WiFi TinyShield on the very top.

There first picture on this blog shows you how the setup looks!

Make sure the TinyDuino is powered on, and use the Micro USB cable to connect the hardware to your computer.


Step 2: Software (Setup)

We can then open up the Arduino IDE and make sure the necessary libraries for this project are downloaded. We will need:

  • Arduino WiFi101 library (This can be installed through the library manager: Sketch ->  Include Library -> Manage Libraries... -> Search for WiFi101 and install)

Now we can select the hardware that we want to program!

Using the Tools tab, we will make the following selections:

  • Board -> Arduino Pro or Pro Mini
  • Processor -> ATmega328P (3.3V, 8 MHz)
  • Port -> "PORT##"  (If you’re having trouble establishing which port this is for you, check out this help page.)

Step 3: The Code!

Now that our environment and hardware are ready to go, we just need to write a program for the WiFi connection.

You’ll need:

  • The name of your WiFi (ssid)
  • The password to your WiFi
  • The ability to copy and paste :)

Here’s the code:



Some important things:

  • You must edit the ssid and wifiPassword variable in the code to match with your WiFi!
  • To show you are connected successfully, the WiFi shield will produce a solid green light. If you do not get this light, check your Serial Monitor (there’s a button to open it in the top right of the Arduino IDE) to aid in debugging. Double check your ssid and password!
  • This WiFi board is compatible with the Arduino WiFi101 library which is available through the Arduino IDE Library manager! However, the pin configuration is different, which requires the following line at the beginning of your setup() function:
    • WiFi.setPins(8, 2, A3, -1); // VERY IMPORTANT FOR TINYDUINO

That's all, folks!


Contact Us

As always, if you have any questions or feedback, feel free to email us at info@tinycircuits.com.

Show us what you make by tagging @TinyCircuits on instagram, twitter, or facebook so we can feature it!

Thanks for making with us!



TinyCircuits Staff
TinyCircuits Staff

Author



Also in Learn

SRAM TinyShield Tutorial
SRAM TinyShield Tutorial

by Nick DiVitto July 02, 2018

The SRAM Tinyshield allows you to add memory to your TinyDuino projects that can read and write at a virtually instant rate. Here's...

View full article →

Servo Controller TinyShield Tutorial
Servo Controller TinyShield Tutorial

by Nick DiVitto June 26, 2018

Learn how to control servos with TinyDuino using the Servo Controller TinyShield!

View full article →

Battery Voltage Reading Using the TinyScreen+
Battery Voltage Reading Using the TinyScreen+

by TinyCircuits Staff June 15, 2018

View full article →