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.
- You can use a TinyZero in place of the TinyDuino and USB TinyShield
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.
- 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!
As always, if you have any questions or feedback, feel free to email us at email@example.com.
Show us what you make by tagging @TinyCircuits on instagram, twitter, or facebook so we can feature it!
Thanks for making with us!