"Develop Your Creations"

get a lot of electronic circuits

"Develop Your Creations"

get a lot of electronic circuits

"Develop Your Creations"

get a lot of electronic circuits

SDR Soundcard Tester

The key to using a soundcard successfully in digital signal processing or digital radio applications lies principally in the characteristics of the soundcard itself. This applies in particular to SDR (software defi ned radio) programs that turn your PC into a top-class AM/SSB/CW receiver, assuming your soundcard cooperates. If you want to experiment with SDR and avoid a lot of frustration, it is worth checking fi rst whether the PC soundcard you plan to use is suitable. There are three essential elements to success:
  • the soundcard must have a stereo line-level input;
  • the card must be equipped with an input anti-aliasing filter; and
  • the sample rate must be at least 48 kHz and the card must be able to cope with signals up to 24 kHz.
Many laptops have only a mono microphone input, sometimes also rather limited in bandwidth. In this case it may be possible to use an external USB soundcard. Most desktop PCs these days have an internal integrated soundcard, although some of these do not feature an anti-aliasing fi lter. Attempts to disable the integrated soundcard and replace it with a better one often meet with failure; again, an external USB soundcard is a possible solution.

Circuit diagram:

SDR Soundcard Tester circuit diagram
SDR Soundcard Tester Circuit Diagram

To avoid guesswork, the best way to proceed is to test the soundcard using this very small circuit. This will help to diagnose any problems and will help determine whether the card is suitable for use with an SDR program. Figure 1 shows a simple square-wave generator built around an NE555 timer IC. At the output is a 15 kHz signal rich in higher harmonics. Using this we can determine whether or not the soundcard can process the harmonics at 30 kHz, 45 kHz and so on. An anti-aliasing filter at the soundcard input should attenuate all signals above 24 kHz. The frequency of the test generator is, within limits, dependent on its supply voltage.

SDR Soundcard TesterUsing an adjustable power supply, a frequency range from 10 kHz to 20 kHz can therefore be covered. There are two RC networks at the output of the test circuit, a high-pass filter and a low-pass filter, acting as simple phase shifters. At the basic frequency of 15 kHz these provide a total phase difference of 90 degrees, corresponding exactly to the typical situation at the output of an SDR receiver circuit using an I-Q mixer: signals at the same frequency but differing in phase. To test the soundcard we need an SDR program running on the PC as well as the circuit of Figure 1. Suitable software includes SDradio (available for download from http://digilander.libero.it/i2phd/sdradio/).

When things are running correctly, the screen should display just two signals: the wanted signal at 15 kHz and a weaker image at –15 kHz (Figure 2). Suppression of the image may not be particularly good as the test circuit does not have very high phase and amplitude accuracy. If, however, the signals have the same level, there is a problem in the processing of the two channels: it is probable that the soundcard only has a monophonic input. If there is no anti-aliasing filter at the input of the soundcard the spectrum will show a large number of extra lines (Figure 3): it is easy to work out which harmonic corresponds to which alias frequency.

SDR Soundcard TesterThe results obtained using an I-Q receiver were grim: frequencies all the way out to 100 kHz were wrapped into the audible range, resulting in bubbling, hissing and whistling. In theory it would be possible to add an anti-aliasing filter to the output of the receiver to allow use with soundcards that are not equipped with such a filter. In practice, however, it is not easy to achieve the required sharp cutoff and symmetry between the two channels. A typical soundcard has a low pass filter set at 24 kHz which by 27 kHz is already attenuating the signal by some 60 dB. This is only practical using digital fi lters; an adjustable analogue circuit to achieve this performance would be so complex that the simplicity benefits of SDR receiver technology would entirely evaporate.

DIY Electronics Projects and Circuit Diagrams, Schematics only at www.extremecircuits.net

Ultrasonic Distant Obstacle Detector

The first sensor a robot usually gets fitted with is an obstacle detector. It may take three different forms, depending on the type of obstacle you want to detect and also — indeed, above all — on the distance at which you want detection to take place. For close or very close obstacles, reflective IR sensors are most often used, an example of such a project appears elsewhere in this blog. These sensors are however limited to distances of a few mm to ten or so mm at most. Another simple and frequently-encountered solution consists of using antennae-like contact detectors or ‘whiskers’, which are nothing more than longer or shorter pieces of piano wire or something similar operating microswitches.

Circuit diagram:

Ultrasonic Distant Obstacle Detector circuit diagram
Ultrasonic Distant Obstacle Detector Circuit Diagram

Detection takes place at a slightly greater distance than with IR sensors, but is still limited to a few cm, as otherwise the whiskers become too long and hinder the robot’s normal movement, as they run the risk of getting caught up in things around it. For obstacles more than a couple of cm away, there is another effective solution, which is to use ultrasound. It’s often tricky to use, as designers think as if they needed to produce a telemeter, when in fact here we’re just looking at detecting the presence or absence of obstacles, not measuring how far away they are. So here we’re suggesting an original approach that makes it possible to reduce the circuit required to a handful of cheap, ordinary components.

 Ultrasonic Distant Obstacle Detector Our solution is based on the howlround or feedback effect all too familiar to sound engineers. This effect, which appears as a more or less violent squealing, occurs when a microphone picks up sound from speakers that are connected to it via an amplifier. Feeding back the output signal from the speaker into the input (the microphone) in this way creates an acoustic oscillator. Our detector works on the same principle, except that the microphone is an ultrasound receiver while the speaker is an ultrasonic emitter. They are linked just by a very easily-built ordinary amplifier. Feedback from the output to the input occurs only when the ultrasonic beam is reflected off the obstacle we are trying to detect.

As Figure 1 shows, the receiver RXUS is connected to the input of a high-gain amplifier using transistors T1 and T2. As the gain of this stage is very high, it can be reduced if necessary by pot P1 to avoid its going into oscillation all on its own, even in the absence of an obstacle. The output of this amplifier is connected to the ultrasonic emitter TXUS, therby forming the loop that is liable to oscillate due to the effect of feedback. When this takes place, i.e. when an obstacle is close enough to the ultrasonic transducers, a pseudo-sine wave signal at their resonant frequency of 40 kHz appears at the amplifier output, i.e. at the terminals of the transmitting transducer.

This signal is rectified by D1 and D2 and filtered by C3 and, if its amplitude is high enough, it produces a current in R6 capable of turning transistor T3 on to a greater or lesser extent. Depending on the nature and distance of the obstacle, this process does not necessarily happen in a completely on/off manner, and so the level available at T3 collector may be quite poorly-defined. The Schmitt CMOS invertors are there to convert it into a logic signal worthy of the name. So in the presence of an obstacle, S1 goes high and S2 goes low. Powering can be from any voltage between 5 and 12 V.

The gain, and hence the circuit’s detection sensitivity, does vary a bit with the supply voltage, but in all cases P1 makes it possible to achieve a satisfactory setting. Although it is very simple, under good conditions this circuit is capable of detecting a normally-ultrasound-reflective obstacle up to around 5 or 6 cm away. If a smaller distance is needed, you simply have to reduce the gain by adjusting P1. Building the circuit is straightforward. Both transducers are 40 kHz types that can be found in any retailers, and the other components couldn’t be more ordinary.

However, one precaution is needed when wiring up the transducers. Even though they aren’t strictly speaking polarized as such, one of their terminals is common with the metal case, and this is the one that must be connected to the circuit earth, on both emitter and receiver. The circuit should work at once, and all you have to do is adjust P1 to set the detection distance you want — but this is also dependent on the positioning of the transducers. For optimum operation, we recommend you angle them as shown in Figure 2.

DIY Electronics Projects and Circuit Diagrams, Schematics only at www.extremecircuits.net