Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Tool to estimate the head wind while driving !

This site may earn commission on affiliate links.
Hi,

It been bugging me for a while to find a way to know what is the current head wind (or tail wind)... So I've finally took the time to make a prototype app !

http://matesla.ca/headwind.html

For the people still in the stone age, you can use this : http://matesla.ca/headwind.html?unit=imperial :)

It should work on pretty much any browser (even your phone), but I just cared so it show OK in the Tesla. (No dark theme yet)

It basicly get your heading by taking 2 GPS coordinate (30 second interval), and download the weather information for that specific coordinate.

It not perfect, but might help some of you to determine if your high wattage usage is from wind or not... Though, weather information is not that accurate, but it still should give you an idea.

By default, the app use openweathermap as it data source, but I found it to be pretty inaccurate...

If you want to try a different source like forecast.io, you can go create your self an account to get a API KEY (FREE for 1000 query or less per day) at : Forecast for Developers

Then you can enter it in this URL : http://matesla.ca/headwind.html?w_engine=forecast&forecast_key=YOUR_PERSONAL_API_KEY_HERE NOTE: That your API will hit my server... You can copy that html page if that bother you.

UPDATE !!!
I've added another source of weather information that seem even better !
Weather Underground Weather Forecast & Reports - Long Range & Local | Wunderground | Weather Underground. (500 free api call) You can register here : API | Weather Underground (Note that you better create an account first and login into that account before, else you will have to do the process again). You can check a map of the different weather station data it have here : WunderMap | Interactive Weather Map and Radar | Weather Underground

You can then access it this way : http://matesla.ca/headwind.html?w_engine=wunderground&wunderground_key=YOUR_PERSONAL_API_KEY_HERE

Hope you guys find it useful !

Moc
 
Last edited:
  • Like
Reactions: bhzmark and David99
This seems very useful. Thanks for providing it. A quick question, though...

Since you said the weather information in openweathermap wasn't that accurate, I did sign up for the free api key at the other site, and tried using that. What I noticed, though, is that when using the api key in the URL, no city is displayed. I see this:

Moc Tesla Tools / Head Wind Estimator


[FONT=&#8216]Speed : 0.99 kph
Heading : 216 deg.
Wind Heading : 213 deg.
Wind Speed : 3.60 kph

Last GPS Update: 27 sec.
Last Weather Update: 23 sec.


However if I use your basic site, with no API key, I do get a location. In that case, I see this:

Moc Tesla Tools / Head Wind Estimator


Speed : 0.02 kph
Heading : 302 deg.
Weather City: Manlius
Wind Heading : 303.501 deg.
Wind Speed : 10.26 kph

Last GPS Update: 7 sec.
Last Weather Update: 5 sec.

Any idea what could be going on?

Thanks!

Note: (The values in the Last Weather Update field in both examples above are wrong. I just made them up and edited them in, as they didn't copy and paste well, but they were there.)



[/FONT]
 
Last edited:
Since you said the weather information in openweathermap wasn't that accurate, I did sign up for the free api key at the other site, and tried using that. What I noticed, though, is that when using the api key in the URL, no city is displayed. I see this:
[FONT=&amp]However if I use your basic site, with no API key, I do get a location. In that case, I see this:[/FONT]

Yes, I didn't get any city information from the other API, it why it doesn't display any city information.
 
Yes, I didn't get any city information from the other API, it why it doesn't display any city information.

So is the page that uses the API key still using accurate GPS data? I ask because the numbers for Head Wind or Tail Wind from the two different pages were not close to being the same last night when I checked. They're also not close to the same now. I just want to make certain that when using the API key, I'm not supposed to also somehow pass through the GPS information, or anything along those lines.

Also is there any chance you could provide an option for showing the numbers in Miles Per Hour instead of Kilometers Per Hour, for those of us more used to that system?

Thanks!
 
So is the page that uses the API key still using accurate GPS data? I ask because the numbers for Head Wind or Tail Wind from the two different pages were not close to being the same last night when I checked. They're also not close to the same now. I just want to make certain that when using the API key, I'm not supposed to also somehow pass through the GPS information, or anything along those lines.
It should be yes... I also found the value to be really different. I've added a third API source that look ever better I think... Free API for 500 call. You can check my first post to find the information about it.

Also is there any chance you could provide an option for showing the numbers in Miles Per Hour instead of Kilometers Per Hour, for those of us more used to that system?
And done :) http://matesla.ca/headwind.html?unit=imperial
 
As an alternative, I use the Weather Underground WunderMap with Personal Weather Stations (PWS) displayed with the on board browser; add "Weather Stations" and remove "Radar." It's a little slow to display and pan, but there is a pretty good density of PWS's in most areas. Once you get a display you like, you can save it as a favorite.

Here is an example:
WunderMap | Interactive Weather Map with Personal Weather Station Display | Weather Underground

Just remember that the wind vectors point the way the wind is coming from; if you are driving the way the vector points, it's a headwind. Also, the barbs are 10 knots each with half barbs for 5 knots, and triangles are 50 knots each. Once you start seeing many triangles it's time to reconsider the drive.
 
As an alternative, I use the Weather Underground WunderMap with Personal Weather Stations (PWS) displayed with the on board browser; add "Weather Stations" and remove "Radar." It's a little slow to display and pan, but there is a pretty good density of PWS's in most areas. Once you get a display you like, you can save it as a favorite.

Here is an example:
WunderMap | Interactive Weather Map with Personal Weather Station Display | Weather Underground

You can get wunderground data source using the UI I made. You just need to get a dev key (free for 500 daily query). I was about to share the wunderground map when you posted your link. I've added it to my first post still. Seem to be the best source of data so far.
 
Thanks very much!

So to get the MPH on either of the API sites we just add "?unit=imperial" after .html, right? I tried that, and it seems to work. The only issue I had was that doing that, and even just using the wunderground site in KPH, the GPS info seems to be off. It's giving me GPS info for some place in Arizona. I'm in New York state.

This is what I see:

Moc Tesla Tools / Head Wind Estimator


[FONT=‘Open Sans’]Speed : 0.0 mph
Heading : 294 deg.
Weather City: Rickety Bones, Tucson, Arizona
Wind Heading : 163 deg.
Wind Speed : 1.0 mph

Last GPS Update: 8 sec.
Last Weather Update: 27 sec.

Thanks for any additional help![/FONT]
 
So to get the MPH on either of the API sites we just add "?unit=imperial" after .html, right? I tried that, and it seems to work. The only issue I had was that doing that, and even just using the wunderground site in KPH, the GPS info seems to be off. It's giving me GPS info for some place in Arizona. I'm in New York state.

You can add &debug=true at the end of the url and you should see data at the bottom with the GPS data and weather gps coordinate it tried to retrieve. Are the gmap link point to your NY location ? If it does and still say weather city in Arizona, send me a private msg with the Debug text and I'll see what wrong with the data the api return.

Also note that URL are encoded this way : HTTP://domain/file.html?option1=1234&option2=5678 So ? = after the html and every extra option are separated with &

Ex : http://matesla.ca/headwind.html?w_engine=forecast&forecast_key=yourkey&unit=imperial&debug=true
 
DavidB, You might get more useful information using the wunderground map at : WunderMap | Interactive Weather Map and Radar | Weather Underground

As you can see, wind shift around. We would have to take point along the route, then average the total distance and different wind source to get an average head wind. We could even calculate based on driving speed and future weather information for when you get to a specific location... But that is a bit further my plan I had for this tool.
 
I want to say that mochouinard has been helping try to figure out what the issue is with getting the weather underground version of his page to work for me with the API key I have obtained from them. We haven't been all that successful, so if anyone if using the weatherunderground version if his page, in MPH, and has it working well, I'd be interested in hearing about it.

That being said, today I used this tool in my car for the first time. Though I couldn't get the weather underground site to work, I was able to get the URL using the forecast.io site to work. I was driving along and the site was telling me I was driving directly into a headwind of anywhere from 9.6 to over 12 miles an hour for a while. Since mochouinard had said himself he wasn't happy with that site's accuracy, I was wondering about whether this was true or not. And then I passed some flags. The flags were flying straight out, and indicating that the wind was, in fact, coming from exactly where the website said it was coming from!

This is a very useful URL!
 
Although somewhat archaic it would be extremely accurate.

Using a pitot tube like airplanes use would be very helpful. It would show you your headwind cs your ground speed and give you an accurate measurement of what your true headwind is.

Micro climates (especially wind data) make using macro weather data not very accurate.
 
Although somewhat archaic it would be extremely accurate.

Using a pitot tube like airplanes use would be very helpful. It would show you your headwind cs your ground speed and give you an accurate measurement of what your true headwind is.

Micro climates (especially wind data) make using macro weather data not very accurate.

I twitted Elon to get a Pitot static system on the Tesla :) I don't think I'll ever get a response hehe...

Might not be super accurate, but might give an idea still. We could start a Kickstarter to install windsock along all the highway in the worlds too :) In the mean time, I'll use this tool when on the highway.
 
  • Like
Reactions: hiroshiy
Mounting a pitot tube is easy, it's finding an accurate location for the static port that becomes truly challenging ... you could vent directly to the cabin and calibrate the gauge but not sure of the accuracy.

I would think that the best place would be by one of the wing mirrors. Reading should be accurate and it should be relatively easy to mount. The main problem will be how to measure side winds.