1. Outline
2. Hardware Description
hardware | image | description | official links |
---|---|---|---|
| Use to develope and set the applications based on the LoRaWan | https://wiki.seeedstudio.com/Seeeduino_LoRAWAN/ | |
| Can show the data from other devices on the screen | ||
| Get the latitude and longitude data | https://wiki.seeedstudio.com/Grove-GPS-Air530/ | |
| With loads of connectors, we can connect several devices at thr same time without jump wires | https://wiki.seeedstudio.com/Base_Shield_V2/ | |
|
| Use Ultrasonic wave to detect the distance | https://wiki.seeedstudio.com/Grove-Ultrasonic_Ranger/ |
3. Hardware Setup
1.how to connect with the Seeeduino LoraWan
2.how to connect the Base Shield
3.how to connect the LCD screen
4.how to connect the ultrasonic distance sensor
4. sensor measurement and observation
4.1. To blink a LED
blink a LED
void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_BUILTIN, OUTPUT); } // the loop routine runs over and over again forever: void loop() { digitalWrite(LED_BUILTIN, HIGH); // turn LED on (HIGH is the voltage level) delay(1000); // wait for 1000ms = 1 second digitalWrite(LED_BUILTIN, LOW); // turn LED off by making the voltage LOW delay(1000); // wait for a second }
4.2. To print message(Hello World!) on the screen
#include <Wire.h> #include "rgb_lcd.h" rgb_lcd lcd; const int colorR = 255; const int colorG = 255; const int colorB = 0; void setup() { digitalWrite(38, HIGH); Serial.begin(9600); lcd.begin(16, 2); lcd.setRGB(colorR, colorG, colorB); // Print a message to the LCD. lcd.print("Hello world!"); //delay(1000); }
4.3. To show result of supersonic range finder on the screen
#include "Ultrasonic.h" #include <Wire.h> #include "rgb_lcd.h" rgb_lcd lcd; Ultrasonic ultrasonic(7); void setup() { digitalWrite(38, HIGH); lcd.begin(16, 2); Serial.begin(9600); lcd.print("The distance is: "); } void loop() { long RangeInInches; long RangeInCentimeters; Serial.println("The distance to obstacles in front is: "); RangeInInches = ultrasonic.MeasureInInches(); Serial.print(RangeInInches);//0~157 inches Serial.println(" inch"); lcd.print(RangeInInches); lcd.println(" inch"); delay(250); RangeInCentimeters = ultrasonic.MeasureInCentimeters(); // two measurements should keep an interval Serial.print(RangeInCentimeters);//0~400cm Serial.println(" cm"); lcd.print(RangeInCentimeters); lcd.println(" cm"); delay(250); }