A device or tool which can measure actual wind speed to the ground rather than to the airplane. Also a device which detect the wind direction to the plane. The device I meant is something like this pitot. But unfortunately this pitot is measures the airplane relative to the air around it, not the ground.
The "wind speed relative to the ground" would just be the (vector) difference between ground speed and true air speed:
Most aircraft do not measure ground speed and track directly with instruments installed on the aircraft. It can be measured with a Doppler radar (see Peter Smith's answer), which is only used on military aircraft (mostly helicopters) today.
Ground speed and track can be determined with external tools:
DME: The Distance Measuring Equipment can be used to measure distances to fixed radio beacons equipped with DME (usually VOR/DME or VORTAC). If you know the angle at which you are flying towards/away from/to this station, you can calculate ground speed from the change in distance. Some DME instruments display this:
When tracking a VOR, you also know the true track angle required for computing the wind direction.
GNSS: A Global Navigation Satellite System like e.g. GPS allows precise determination of the aircraft's position. The ground speed can be calculated from the change of this position and the true track is simply the direction of change. A more accurate determination is possible by measuring the Doppler shift of the signal (thanks to bogl for pointing this out).
ADIRS: An Air Data Inertial Reference System as installed on airliners knows the aircraft's attitude and position based on integrating data from accelerometers and gyroscopes. It can be updated via GNSS, but would still provide data for ground speed and track without it.
Modern avionics can display the result of these computations directly:
Such systems require at least 3 beams and often are 4 beam (the 4 beam system fitted on the Wessex 1 was a high precision unit used in seaborne rescue - overcoming the backscatter from the water and waves makes for a challenging design).
The Sea King HAS 1 had a 3 beam system which actually fed ground track information to the ARI5955 Radar display (cannot find a suitable link) so the operator could view a moving aircraft across a static terrain map (very interesting and new for the time - early 70s).
The basic principle is that the beams are transmitted at 45 degrees, -45 degrees and -135 degrees (and +135 degrees for a 4 beam solution) to form a cross:
The beams are aimed downward so they measure the doppler effect relative to the ground; each beam will have sine and cosine elements; if they are equal for all the beams then there is no drift; of they are not equal, the actual sine and cosine outputs can be effectively added to find the actual ground track.
From there, if we know:
We can compute the aircraft drift angle and therefore the wind speed and direction relative to the ground.
Although the 4 beam system is rather intuitive, we actually only need 3 beams to compute the drift angle.
Dopplers do have susceptibilities (much of which depends on the downward beam angle), but the advantage of being totally self-contained is quite large.
The cheap way is by means of a drift meter, which is a telescope that points straight down towards the ground and which contains a set of crosshairs that can be rotated. The navigator looks through the telescope and rotates the crosshairs so as to determine the angle between the plane's movement through the air and its movement over the ground. From this she can calculate the wind triangle. This is how it was done before doppler radar and other electronic navaids were invented.
As far as I know, airplanes just use external data for winds aloft. GPS allows to measure ground speed and true course over the ground, that's good enough.
The closest thing to measuring actual wind speed at altitude is GPS drift in a balloon, or gliding flight computer that detects circling flight (using GPS) and calculates drift.