Signal generators are a handy thing to have around the lab. They are perfect for testing inputs on a new hardware design and verifying the behavior of a circuit before connecting all the pieces together. In recent years these lab tools have not only decreased in size but also in cost. The result has been a plethora of portable versions that now exist on the market.

For an engineer-on-the-go, this is very convenient but often times having to bring one more piece of equipment always seems to put the tool bag over the 50 pound limit. This is one reason why it is becoming popular to design lab equipment that can be plugged into a smart phone. Rather than carry around another device with a computer in it, utilizing the computing power and capabilities of the phone allows the device to be smaller, cheaper and weigh less!

So how can someone turn their smart phone into a signal generator? The simplest way is to exploit the headphone jack that is already present on the phone! There is no need to get fancy and try to interface to the onboard USB! Now just like any engineering project there are limitations on the requirements of what this port can do.

A standard headphone jack will typically only cover the frequency ranges that a human can hear (20 – 20,000 Hz). This seems like a limited range but for most sensors and applications this is actually a pretty wide range. A great example application is for medical sensors such as EKG, EEG and EMG. These signals don’t have components much over 100 Hz at the most!

The smart phone signal generator can be built for less than $15! The hardware consists of a single stereo 3.5 mm headphone plug, some wire and then optionally three alligator clips to connect the signal generator to the test device. The headphone jack consists of a right and left channel in addition to a ground. Figure 1 shows an image of the headphone jack being soldered with three wires. The big metal tab on the bottom is the ground with the green and red wires being attached to the left and right channels respectively. Once the headphone jack is soldered, it can be closed up and the alligator leads can be connected either through solder or the set screw depending on the type of connector chosen. The final piece of hardware can be seen in Figure 2.

There are a number of software options available for both iOS and Android operating systems through their respective application stores. For iOS, Sig Gen seemed to be the best option available on the market and for a cost of less than $3! Figure 3 shows an example of how the application looks on the phone. For Android, there were far more choices than for iOS. The best looking option that was tested was called Waveform and literally was designed to look like the front panel of a signal generator! It can be seen in Figure 4.

Click for larger image



Figure 3. iPhone Sig Gen



Figure 4. Android Waveform

Both of these applications provided the ability to change common functions such as the output signal level, the waveform and frequency. Since the hardware is a phone, the applications also include the ability to generate different waveforms on left and right channels of the headphone jack; each of which is independently controlled! It’s like buying one channel and getting a second one for free!

Now this all looks really cool so far but the real question is does it work? For a simple test, the hardware was connected to a resistive load and later onto a medical device that was in development in the lab. Setting the signal generator for a sine wave at 12 Hz, the resultant waveform can be seen in Figure 5. It worked!

Click for larger image



Figure 5. Initial Sine Wave Test

There was just one small problem; varying the output amplitude in the application allowed for a signal of 0 to about 50 mV! Quite the curious problem! This doesn’t seem like the maximum voltage that could be driven to a set of headphones. One would expect 3.3 volts to be the peak-to-peak voltage. It turned out that despite changing the amplitude in the application, the volume setting of the phone was limiting the maximum output voltage. Changing the volume of the phone to the maximum then allowed for the expected range of voltage. This can be seen in Figure 6. Since the application supports other waveforms Figure 7 shows a saw tooth output waveform just for fun.



Click for larger image/span>

Figure 6. Volume Turned Up Sine Wave Test

Click for larger image



Figure 7. Saw tooth Test

There was only one other problem encountered with the iPhone version of software. If the phone went to sleep the signal generator application stopped outputting the waveform! In order to use the signal generator, the phone has to be kept from going to sleep! This is a slightly annoying problem especially since with the display on the phone battery will drain much quicker. The only solution at the moment is to simply plug the phone into a charging cable. What can be expected from a $15 dollar signal generator anyways? (Hopefully this software “non-compliance” will be fixed in future versions).

This simple trick for creating a signal generator has come in quite handy! It fits a variety of applications and so far has kept my travel bag weight down considerably. There are occasions where this simple signal generator doesn’t fit the bill and a higher end portable unit is required. Commercial portable units cost around $150 and can handle frequencies upwards of 1 MHz. At a tenth of the cost though it’s amazing just how useful this little cable really is and how often it is used. Enjoy building your own and I look forward to hearing from everyone on their experience!

Jacob Beningo is a lecturer and consultant on embedded system design. He works with companies to develop quality and robust products and overcome their embedded design challenges. For additional tips and tricks check out his website at www.beningo.com, twitter @Jacob_Beningo and #EmbeddedTips or feel free to contact him at jacob@beningo.com.