First after getting the board , I have set up the Arduino IDE by installing Board
From Tools menu -> Boards -> Boards Manager
Then Tried out example blink code and they worked correctly
For Controlling the Servos , they needed +5V Supply but Arduino Nano IoT only has 3.3V Supply, So I used external Power Supply
Using FireBase Database:
I have used the https://github.com/mobizt/Firebase-Arduino-WiFiNINA Library for Connecting Arduino Nano IoT to Firebase Database.
Then tried the sample code to read relatime data from Firebase which was added using Moble App . This will keep reading the Data at an interval from Database .
THe Data format was -> Medicine Name, Box Name, Time,Date.
Testing: Testing Video of Servo At all Position
Code
The Code Reads the Database by connecting to Wifi Network first so we need to define the Wifi Auth and Firebase Auth
#define FIREBASE_HOST "YOUR_FIREBASE_PROJECT.firebaseio.com" #define FIREBASE_AUTH "YOUR_FIREBASE_DATABASE_SECRET" #define WIFI_SSID "YOUR_WIFI_AP" #define WIFI_PASSWORD "YOUR_WIFI_PASSWORD"
Then Connect to Wifi and Database
status = WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH, WIFI_SSID, WIFI_PASSWORD); Firebase.reconnectWiFi(true);
Then Read The Data
for (uint8_t i = 0; i < 5; i++) { if (Firebase.getInt(firebaseData, path + "/Medi/Medicine" + (i + 1))) { if (firebaseData.dataType() == "int") Serial.println(firebaseData.intData()); else if (firebaseData.dataType() == "float") Serial.println(firebaseData.floatData()); else if (firebaseData.dataType() == "string") Serial.println(firebaseData.stringData()); } }
We get the Data in format : String: Medicine Name , String : Box Name , String : Date /Time , Int : Doses.