Introduction: Miniature Wearable Lock-in Amplifier (and Sonar System for Wearables, Etc..)

About: I grew up at a time when technologies were transparent and easy to understand, but now society is evolving toward insanity and incomprehensibility. So I wanted to make technology human. At the age of 12, I c…

Build a miniature low-cost lock-in amplifier that can be embedded in eyeglass frames and to create a sonar vision system for the blind, or a simple ultrasound machine that continuously monitors your heart and uses Human-Machine Learning to warn of problems before they happen.

A lock-in amplifier is an amplifier that can lock-in on a specific signal (reference input) while ignoring everything else. In a world of constant bombardment with noise and distraction, the ability to ignore something (i.e. ignor-ance) is a valuable asset.

The best amplifier ever built in the entire history of the human race is the PAR124A made in 1961, and while many have tried to surpass or equal its performance, none have succeeded [].

Lock-in amplifiers are fundamental to sonar, radar, lidar, and many other kinds of sensing, and good ones typically cost around $10,000 to $50,000, depending on specifications, etc..

S. Mann, Stanford University, Department of Electrical Engineering, 2017.

Cite Mann, Lu, Werner, IEEE GEM2018 pp. 63-70

Step 1: Obtain the Components

The WearTech wearable computing student club at University of Toronto has generously donated a parts kit to every student enrolled in ECE516.

You can join WearTech and get a parts kit, or alternatively, purchase the parts from Digikey.

Bill of Materials:

  • Signal generator (which you will still have from Lab 1 and initially you won't need the full complex signal generator, i.e. for the first part of this lab, any suitable real-valued signal generator will do);
  • LM567 or NE567 tone decoder (8-pin chip);
  • RT = top resistor of reference input voltage divider: approx. 5340 ohms;
  • RB = bottom resistor of reference input voltage divider: approx. 4660 ohms;
  • RL = load resistor for output (Pin 3): approx. 9212 ohms;
  • The three capacitors (coupling capacitors for reference and signal input, as well as lowpass filter capacitor on the output);
  • Optional switches;
  • Output amplifier such as TL974 (you can also use a sufficiently sensitive audio amplifier or headphone amplifier with sufficiently high input impedance so as not to overload the output filter capacitor);
  • Other miscellaneous components;
  • Breadboard or other circuitboard for assembly of the components.

Additionally, to do something useful with the lock-in amplifier, you will want to obtain:

  • Ultrasonic transducers (quantity two);
  • Audio headset or speaker system;
  • Computer system or processor or microcontroller (from Lab 1) for the machine learning part.

RT, RB, and RL are relatively critical, i.e. values that we have carefully selected through experimentation.

Step 2: Wire Up the Components

Connect the components according to the diagram shown.

The diagram is a nice blend between a schematic diagram and a wiring diagram, i.e. it shows the circuit layout as well as how the circuit is connected.

The way in which the 567 tone decoder is being used has been regarded by some as a creative departure from its normal conventional usage. Normally Pin 8 is the output pin, but we don't use that at all. Normally the device detects a tone and turns on a light or other item when the tone is detected.

Here we are using it in a way that is completely different from the way in which it was intended to be used.

Instead, we are taking the output at Pin 1 which is the output of a "Phase Detector". We exploit the fact that a "Phase Detector" is simply a multiplier.

Also, Pin 6 is normally used as a timing capacitor connection.

Instead, creatively, we use Pin 6 as the reference input for using the 567 chip as a lock-in amplifier. This allows us to access the multiplier at one of its inputs.

To get maximum sensitivity to reference inputs, we found that if we bias this pin to 46.6% of the supply rail, and capacitively couple into it, we get best results. You can also try feeding the reference signal directly to it, as indicated by the switch (you can just use a jumper wire on your breadboard instead of the switch).

The only input/output pin that we use conventionally (i.e. the way it was meant to be used) is Pin 3 which is supposed to be used as the input, which we do indeed use as the input!

Step 3: Put the Lock-in Amplifier to Good Use: Vision Aid for the Blind

We wish to use the lock-in amplifier to create a vision aid (seeing aid) for the blind.

The idea here is that we use it for sonar, to create a Doppler sonar sensing system.

Although you can buy a sonar sensor as an Arduino attachment, we choose to build the system ourselves from first principles in this Instructable for the following reasons:

  1. Students will learn the fundamentals when they build things themselves;
  2. This gives you direct access to the raw signals for further research and development;
  3. The system is much more responsive and instantaneous, compared with prepackaged systems that merely report aggregated information with quite a bit of delay (latency).

Mount the two ultrasound transducers on a headset (headphones), facing forward. We like to put them on either side so that the head shields the transmitter from direct signal from the receiver.

Connect them to the lock-in amplifier according to the provided diagram.

Connect an output of the amplifier to the headset. The "Extra Bass" type of headset works best, since the frequency response extends all the way to the lowest of frequencies.

Now you will be able to hear objects in the room and construct a mental visual map of the room's objects in motion.

Step 4: Human-Machine Learning

The "Father of A.I.", Marvin Minsky (he invented the whole field of machine learning), together with Ray Kurzweil (Director of Engineering at Google), and myself, wrote a paper in IEEE ISTAS 2013 (Minsky, Kurzweil, Mann, "Society of Intelligent Veillance", 2013) on a new kind of machine learning, called Humanistic Intelligence.

This arises from machine learning on wearable technologies, i.e. "HuMachine Learning", in which sensors become a true extension of the mind and body.

Try taking the Doppler sonar returns and supplying them to a computer system's analog input, and running some machine learning on this data.

This will take us a step closer to Simon Haykin's vision of a radar or sonar system capable of cognition.

Consider using the LEM (Logon Expectation Maximization) neural network.


Here's some additional papers on machine learning and chirplet transform:

Step 5: Other Variations: Heart Monitor

The number 1 cause of death is heart disease, and we can create a wearable system that helps address this. Use two hydrophones or geophones to "see" into your own heart. The same technology that helps the blind "see" can now be turned inwards to look inside your own body.

Such a heart monitor, combined with traditional ECG as well as outward-facing video for context, gives you a wearable context-aware heart monitor for personal health and safety.

Machine learning can help predict problems before they arise.

Step 6: Other Variation: Bicycle Safety System

Another application is a rear-vision system for a bicycle.
Place the transducers facing rearward on a bicycle helmet.

Here we wish to ignore ground clutter and generally everything moving away from you, but only "see" things gaining on you.

For this purpose you will want to use a complex-valued sonar system, as indicated in the wiring diagram above.

Feed the outputs (real and imaginary) into a 2-channel AtoD (Analog to Digital) converter and compute the Fourier transform, then consider only the positive frequencies. When there is strong positive frequency components there is something gaining on you. This can activate an enlargement of your rear-camera feed, to call attention to objects behind you that are gaining on you.

For better results, compute the chirplet tranform. Even better: use the Adaptive Chirplet Transform (ACT) and use the LEM neural network.

See Chapter 2 of the textbook "Intelligent Image Processing", John Wiley and Sons, 2001.

Additional references:

Step 7: Other Variation: Binaural Seeing Aid for the Blind

Use the above complex-valued lock-in amplifier to provide stereoscopic sound, with the real and imaginary outputs to the two stereo channels of audio.

In this way you can hear the complex nature of the world around you, since human hearing is very attune to slight phase changes, and is this very adept at learning to understand the subtle changes between in-phase and quadrature channels of the Doppler return.