[ad_1]
Table of Contents
Drones are becoming a more integral part of not only our hobbies, but our work as well. Many different industries now use drones as a critical part of inspection, surveillance, filming, and other key elements. However, nature has not let up and drones can be very susceptible to the whims of precipitation and wind.

A drone in the sky – illustrative photo. Image credit: Ricardo Gomez Angel via Unsplash, free license
These weather elements can appear without warning, putting expensive drones at risk of taking water damage or crashing outright, which can be expensive and depending on the location, dangerous to those nearby.
Thankfully, technology is improving every day, and data is becoming more democratized. In this case, it’s entirely feasible to pull real time weather data from sources like Tomorrow.io’s weather API, determine if the weather presents a danger, and program our drone to return to base if precipitation, wind, or other elements are too extreme for safe operation.
Setting Up Weather Alerts for Safe Drone Activity
For this example we will use the API call from Tomorrow.io to pull the weather data where our drone is in real time, and gathering the data so that if you wanted to you could feed it into a decision process for your drone operation, creating a safety stop that would initiate a return to base signal to the drone if the weather it is flying through becomes to extreme for it to operate safely.
Setup
First, we will create a “Timelines” endpoint. If we want the full set of data for a detailed version of the forecast we can subscribe to the premium version. However, there is a free version that provides a number of important data points for our specific drone problem, and we can pull that data without charge.

API Key
In order to obtain the data, you will first need to sign up to the platform (free version or paid subscription). This allows you to obtain a user API key, which is required for this step.

Choose Your Location
For this step, you will need to decide where your drone is going to be flying in order to obtain the most accurate forecast. The API call accepts basic “latlong” location data, but can also be chosen based on a list of location presets in the system. For those who don’t think in terms of latlong or GPS stats, you can use a free GPS coordinate converter. These are available online (one example here) and based on the address you’ll be flying, the converter can give you the proper latlong coordinates for the API data pull.

Fields of Interest
The API call would be fairly useless without the ability to select what information we’d like to see. This part of the call allows you to select those elements that are most relevant. In this case, we want to determine what weather elements will have an impact on the safety of our drone. Depending on the time of year, you might look at rain or snow, lightning, extreme weather, and of course wind (for a full list, check here). You can also look at temperature, air quality, and pollen, but for this use case these might not be as relevant. However, in terms of precipitation and wind, you can select helpful details such as intensity, type, speed, gust, and direction. This is critical for determining whether the current conditions are safe enough for the drone.

Select Your Unit System
For this step, you need to choose whether you want to use metric or imperial.

Timesteps
The timesteps section allows you to decide what time interval is best for our purposes. Given you are trying to keep a drone safe, we want to select narrow timesteps such as 1 minute or 5 minutes. However, if you wanted to you could also select 15 minutes, 30 minutes, an hour, or even a day. What may also be helpful is selecting “current”, which can pull real-time data and give you a look at where the precipitation and wind are with zero lag. Within this step, you can also decide whether you want to view the Min, Max, or average (Avg) data points within your timestep (not applicable to using “current”).

Time Frame and Time Zone Configuration
Of course, for this we want to make sure that the time frame and time zone line up with where we are launching the drone. Utilize your timezone in relation to UTC, and you can specify your timezone through a special variable (called “timezone”) that uses the standard IANA Time Zone database format. Note that if desired, you can select up to 6 hours previous and up to 15 days into the future.


Request Timelines
Using the “result” JSON formatted response, compile all the requested data and get your output.

Next Steps
Now that you’ve completed your API call and have your weather data feed, you can link it to your drone hardware using the language of your choice. At the most basic level, you need to decide what weather parameters are acceptable, then create a loop that takes real time weather data, compare it to parameters, and if it is unacceptable then a “return to home” signal is sent. If you want to allow for brief gusts, then you might need to capture a brief (eg. five second) array of values such as wind speed, then take the average and use it as the value to compare to your acceptable / not acceptable parameter.
[ad_2]
Source link