Remote Agriculture Solution
Blog Links:
#02: Components and Design Structure
#04: Setting up Arduino Nano 33 IOT
#08: Linking Everything to Arduino Nano 33 IOT
#09: Time to See the Work in Action
In this blog, we will configure Arduino 33 nano IOT for the first time.
For this project, I will be using Blynk.
Setting up:
Our main aim for this blog, is to setup the Arduino Nano 33 IOT(the kit). We would need to do a few setup changes to the Arduino IDE for this. As the other boards like the Arduino Uno are a little different from this board.
To use this board, we need to go to the Board Manager and download Arduino SAMD Boards.
To connect this board to WiFi, we need WiFiNINA library. You can download this from Library Manager.
For getting started with Blynk, I had to download Blynk App on my phone. I created an account on the website and opted for the free option as that was enough for this project. Login with your credentials.
As this was my first time using the board, I tried a very simple task of turning On/Off the inbuilt LED(on D13) on Arduino Nano 33 IOT.
Blynk Setup:
- To do this, create a new project in Blynk.
- Name your project.
- Choose device as "Arduino Nano"
- Choose connection type as " Wifi"
- Choose any theme of your choice
- The authorization token will be sent to your registered email.
- Using the "+" button in the top bar, add a Button
- Click on the newly added Button
- Set Output Pin to "D13"
- Name the Button as "Led"
You are all set to go now. The Blynk Project is ready. Now it's time to write the code and upload it to the board using the Arduino IDE.
Code:
I used this example code provided by Blynk.
The code file can be downloaded from this https://github.com/aaryan2134/Remote-Agriculture-Solution/tree/main/Blink_Led_using_IOT
#define BLYNK_PRINT Serial #include <SPI.h> #include <WiFiNINA.h> #include <BlynkSimpleWiFiNINA.h> // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "add your authorisation code"; // Your WiFi credentials. // Set password to "" for open networks. char ssid[] = "enter your SSID"; char pass[] = "enter your password"; void setup() { // Debug console Serial.begin(9600); Blynk.begin(auth, ssid, pass); // You can also specify server: //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80); //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080); } void loop() { Blynk.run(); }
Just upload this code to the board. After that open the Blynk App and run the project.
When you press the button, the LED will turn on. Pressing again will turn off the LED.
Finally, we are done with the initial setup of Arduino Nano 33 IOT using Blynk!
Stay connected for further progress.
We will finish setting up the complete monitoring system in the next Blog.
Connect with Me:
Github - aaryan2134