Pages

30 May, 2014

Temperature compensation for an Arduino ultrasonic distance sensor

161.3 cm
27.0°  347.7 m/s
Ultrasonic distance sensors can find the range out to 2-4 meters and are popular in e.g. robotics. Here I look at how the accuracy can be improved by compensating for the variation of speed of sound with temperature. It actually varies quite a lot in air and around 0 C it is:

      c = 331.3 + 0.606 * T

where c is in m/s and T is in C. The formula is good to up to at least +/-30 C. There is also a dependence of humidity, but as it is so small it is neglected here.

The equation can be analyzed for sensitivity (a little bit of differentation, you know). The result is that a two-way range measurement creates an error of 1.8 mm/C/m. That means that with a 4 degree C error, the deviation will be 14.4 mm at a range of 2 meters. Not a lot, but more than the wavelength which is 9 mm at 40 kHz. Considering how easy it is to compensate for, then why not give it a try?

19 May, 2014

Nice, watery CW signals from Alaska

 Great circle path between Anchorage and Oslo
Here's what a transpolar signal sounds like (click here to listen) and looks like (below). This one has traveled from Anchorage, Alaska to Oslo, Norway.

The characteristic sound of a CW signal that has passed over a moderate geomagnetic disturbance (Kp = 2) isn't too hard to recognize with a little practice. There is also some static on this short recording as we had a local thunderstorm coming in with the first summer days here.

The great circle distance between the two cities (actually their two airports) is 6446 km as illustrated by GPSVisualizer. Anchorage and Oslo are about at the same latitude, 61° N and 60° N, respectively. As they are at longitudes 149° W and 10° E, there is a difference of 159 ° - almost 180 ° - and this means that the signal almost passes directly over the North Pole, although a bit hard to see on the projection used in the map.

03 May, 2014

Practical Wireless with the LM386 unleashed

"Improving the LM386 Audio Amplifier" is the title of always inspiring Rev. George Dobbs G3RJV's column in this month's Practical Wireless. George talks about the basic amplifier with a voltage gain of 20 (26 dB) and how it is straight forward to increase gain to any value up to 200 (46 dB). The article then shows how it can be built dead-bug style.

Then he goes on to talk about various ways to improve the circuit such as for hiss reduction and even higher gain. In that connection he also mentions my article "Unleashing the LM386" from SPRAT in the Autumn of 2003. That circuit was an enhanced version of the high-gain circuit of Kazuhiro Sunamura JF1OZL. Basically it increases the gain to up to more than 70 dB, enough for it to drive a loudspeaker. My circuit also adds bandpass filtering. All this is achieved by adding only 5 passive components to the basic amplifier. The circuit was recently revisited in SPRAT by Johnny Appel SM7UCZ. He added a 40 dB Darlington pair preamplifier for even further gain.

The bandpass filtering (not low pass as the article says) is due to the series resonance of 100 uF and 1 mH which happens at about 500 Hz making it a nice CW filter.