
Estimating an approximate location doesn't always require a dedicated GPS module; a NodeMCU board built around the ESP8266 chip can use the surrounding Wi-Fi networks themselves to estimate a geographic location, relying on a Wi-Fi-based geolocation service offered by providers such as Google.
Components needed
A NodeMCU (ESP8266) board, an active internet connection, and an API key issued by the geolocation service being used.
How it works
The ESP8266 board scans nearby Wi-Fi networks and collects their MAC addresses along with each one's signal strength, without needing to actually connect to any of them. This list is sent to the geolocation service via an HTTP request, which compares it against a massive database linking Wi-Fi network addresses to previously known geographic locations (originally built from smartphone data with location services enabled). The service returns estimated latitude and longitude coordinates with an approximate accuracy figure, and this accuracy improves the more networks are detected and used in the triangulation.
Software needed
The ESP8266HTTPClient library handles sending the request and receiving the response, while ArduinoJson parses the returned coordinate data in JSON format. The result (latitude, longitude, and accuracy) is printed to the serial monitor and can be copied directly to verify on Google Maps.
You can find NodeMCU boards at Juthour Tech.
اترك تعليقا