Peripheral Radar for the Visually Impaired

by tpsully in Circuits > Wearables

2203 Views, 17 Favorites, 0 Comments

Peripheral Radar for the Visually Impaired

ST_TOF.jpg

As a result of a horrific accident, a friend of mine recently lost sight in his right eye. He was out of work for a long time and when he came back he told me that one of the most unnerving things he has to deal with is the lack of knowing what is on his right side. Less peripheral vision means bumping into things and people. This bothered me. I decided there had to be something we could do.

I wanted to build a device that could measure distance to objects on my friend's right side. My plan is use a haptic motor to vibrate the device inversely proportional to the distance to an object. Then if objects were far away the motor would not vibrate and as an object was closer, it would begin to vibrate at a low level. If the object was close it would vibrate at a much higher level ( or whatever level you wanted). The device would have to be small enough to hang onto the side of glasses with the sensor pointing to the right. My friend would put the device on the right side of his glasses but of course for someone else, it could be the left side.

I remembered that I had some acoustic distance sensors at home. But, they are a little big and bulky, less precise and would likely be too heavy for use on glasses. I started to look for something else.

What I found was the ST Electronics VL53L0X Time-of-Flight sensor. This is an infrared laser and infrared detector in a single package. It emits a pulse of laser light outside of the human-visible range (940 nm) and records the elapsed time it takes to detect the reflected pulse. It divides this time by 2 and multiplies by the speed of light producing very accurate distance in millimeters. The sensor can detect distance out to 2 meters but as I have seen, 1 meter is more optimal.

As it happens, Adafruit has a VL53L0X breakout board. So I needed a vibrating motor, which they also had, and a microcontroller to run it all. I happened to have a PJRC Teensy 3.2 on hand. While larger than I wanted it had the ability to be clocked at a slow speed. I wanted to lower the clock speed in order to save power. And as far as a power source goes, I had a Sparkfun boost regulator in my junk box along with a AAA battery holder. I had just about everything I needed.

First Prototype

IMG_3079.jpg
IMG_3084.jpg

I took the parts I had on-hand and made a handheld prototype of the device I envisioned. I 3D printed the handle and mounting plate and soldered all of the electronics onto an Adafruit protoboard. I connected the vibrating motor to the Teensy via a 2N3904 NPN transistor. I added a potentiometer to be used to set the maximum distance the device would respond to.

I had it running by the next weekend (see the picture above). It wasn't pretty but it demonstrated the principle. My friend could hold the device on his right hand side and test whether or not the device would be useful and to help refine what he wanted for features.

Prototype #2

IMG_3132.jpg
IMG_3133.jpg
IMG_3134.jpg

After the first hand-held prototype I started making a smaller version. I wanted to get closer to my goal of making something that could fit on glasses. The Teensy I used on the handheld version allowed me to slow the clock down to save power. But size was going to be a factor and so I switched to an Adafruit Trinket M0. While its clock rate is 48 MHz, the ARM processor it is based on can be clocked slower. By using the internal RC oscillator it can run at 8, 4 2 and even 1 MHz.

Prototype #2 came together pretty fast as I had it all together by the next weekend. The circuitry was the same as prototype #1 except for the ARM M0. I 3D printed a small enclosure and put guides on the back so it could be slid onto glasses. See the picture above. Initially it is being clocked at the 48 MHz rate.

Prototype #3

IMG_3276.jpg

So, this Instructable really begins here. I decided to make one last prototype. I decide to squeeze it as small as I could short of using a custom PWB (which is where I am sure we are headed). The rest of this Instructable will be about showing you how to make one. Just like people making 3D printed hands for kids with disabilities, my hope is that people will make these for anyone with a similar loss of vision in an eye.

I kept the parts list the same as prototype #2 but I decided to remove the potentiometer. After talking with my friend we decided to make the maximum distance set using software. Because I have the ability to use a touch sensor using the Teensy, we could always make the max distance a setting by touching. One touch sets a short distance, or more touch a longer distance, another touch the longest distance and then for one more touch, wrap around back to the beginning. But at first, we'll use a fixed distance to get going.

Parts

Mess.jpg

For this prototype I needed a smaller board. I went with a Sparkfun protoboard (PRT-12702) because it's small dimensions (about 1.8" X 1.3") would be a good size to shoot for.

I also needed to use something other than a AAA battery as a power source. A LiPo seemed like the right choice as it would have storage capacity and light weight. I tried a coin cell but it didn't have enough power to handle the motor for very long. I chose a small LiPo that has 150 mAH capacity.

I was going to stay with the Trinket M0 and of course, the VL53L0X breakout board.

Now that we are down to the details, here is a list of parts for this prototype:

Adafruit VL53L0X Time of Flight Distance Sensor - PRODUCT ID: 3317
Adafruit - Vibrating Mini Motor Disc - PRODUCT ID: 1201
Adafruit - Lithium Ion Polymer Battery - 3.7v 150mAh - PRODUCT ID: 1317
SparkFun - Solder-able Breadboard - Mini - PRT-12702
Sparkfun - JST Right-Angle Connector - Through-Hole 2-Pin - PRT-09749
10K ohm resistor - Junkbox (look on your floor)
2N3904 NPN Transistor - Junkbox (or phone a friend)
Some hookup wire (I used 22 gauge stranded)

To charge the LiPo battery I also scooped up:

Adafruit - Micro Lipo - USB LiIon/LiPoly charger - v1 - PRODUCT ID: 1304

Schematic

Schematic.png

The schematic for this device is shown above. The touch input will be for a future version but it is shown in the schematic anyway. Also, the 10K resistor between the Trinket M0 and the base of the 2N3904 provides just enough base to turn on the motor without slamming it too hard.

What follows is a step-by-step assembly description.

The Protoboard

Protoboard.png

Many of you who are experienced knows this but, this is for those who may be new to soldering protoboards:

The Sparkfun protoboard (PRT-12702) shown above has 17 columns (groups) of 5 pins on each side of a three tenths of an inch gap. Each vertical column of 5 pins on either side of the gap are common to one another. By this I mean that any connection to a pin in the group is a connection to every other pin in the group. For this board, that doesn't seem obvious but you can verify this if you use a DVM (Digital Volt Meter). If you look on the back you can just make out the traces connecting the groups.

Component Placement

PartPlacement.png
PartPlacement2.png

You probably have to solder pin strips to both the Trinket M0 and the VL53L0X. Both of them come with the strips but they need to be soldered. Adafruit has instructions in their Learning Center for both of these parts. If you are new to this, please go there (here and here) before soldering the strips onto the boards. The pin strips provide a lower profile than a socket would.

The first thing to consider when soldering something onto a protoboard with limited space is component placement. I placed the Trinket and the VL53L0X in the positions shown in the figure above. The Trinket has pins on both edges of the board but the VL53L0X has 7 pins all on one edge of its board. The side of the VL53L0X that does not have pins we'll use to connect some components...as we'll see.

I also soldered the slide switch into position and I soldered the 2N3904. I've darkened the holes where those parts are placed and, for the 2N3904, I've noted which pins are the Collector, Base and Emitter. When you first solder it you should leave it perpendicular to the board so you can solder other connections. Later you will be able to bend it over (carefully) so it is closer to being flush with the board.

NOTE: The JST Battery Breakout does NOT get soldered to the board at this time. It will be soldered onto the back of the board but only AFTER we solder our other connections. It will be the last thing we solder.

Wires

Wiring1.png

The diagram above shows the protoboard again with darkened holes where components will be located. I have added the labels for them along the edges to make it easier to wire. Note the vibration motor is shown but it will be located on the back side of the board and will be connected nearly last so for now, just ignore it. I also show the JST Battery Breakout with a dashed line. As identified in the previous step, do not connect it but please do leave the 4 holes at the top of the board open (i.e. don't solder to them).

I assume at this point that you know how to strip insulation from a wire, tin the ends with solder and solder to a board. If not please go see one of the Instructables on soldering.

For this step, solder wires as shown in yellow. The end points are the holes that you should solder them to. You should also solder the 10K ohm resistor to the board as show. The connections being made are:

1. A connection from the battery's positive terminal to the COMmon (center) terminal of the slide switch. One side of the slide switch will make contact with the BAT input to the Trinket. The Trinket's on-board regulator generates 3.3V from the BAT input voltage.

2. A connection from the battery's negative (ground) terminal to the ground of the Trinket.

3. A connection from the battery's negative (ground) terminal to the emitter of the 2N3904

4. A connection from the Trinket's 3.3 volt (3V) pin to the VIN of the VL53L0X. The VL53L0X will further regulate this to 2.8 volts for its own use. It also brings this voltage out to a pin but we do not need it so it will be left unconnected.

More Wires

Wiring2.png

So now we add the next group of wires as shown above. Here is a list of each connection:

1. A connection from the Trinket's pin labeled as a 2 to the VL53L0X SCL pin. This is the I2C clock signal. I2C serial protocol is what is used by the Trinket to communicate with the VL53L0X.

2. A connection from the Trinket's pin labeled as a 0 (zero) to theVL53L0X SDA pin. This is the I2C data signal.

3. A connection from the VL53L0X GND pin across the gap on the protoboard to the Emitter of the 2N3904. This provides ground to the VL53L0X.

4. A connection from the Trinket's pin labeled as a 4 to the 10K resistor. This is the drive for the vibration motor. This wire should definitely be soldered onto the back side of the board if you choose my connection point.

Remember that, any vertical group of 5 pins are common to one another so you can connect anywhere in this group that is convenient. You'll notice in the photos of my board I changed a few of my connection points. As long as they are the correct connection, then whichever pad you choose is fine.

Vibration Motor

Wiring3.png

The vibration motor comes with a peal-able sticker on the back. You pull this off to reveal a sticky material that allows the motor to be stuck onto the back of the board (but, see comment below before you stick it). I placed it to the left (looking at the back of the board) of the JST Battery Breakout board which we haven't attached yet. So, leave some space for the JST Battery Breakout board. I also wanted to make sure the motor's metal case didn't short any pins across the gap of the protoboard. So, I cut a small piece of double-sided tape and stuck that to the back of the vibration motor's sticky side. Then I pushed that onto the back of the board. It helps to keep the metal case up high and away from any pins. But still, be careful to place it in a way that DOES NOT short any pins.

Solder the red wire of the vibration motor to the 3V pin of the Trinket. The vibration motor's black wire is soldered to the collector of the 2N3904. When the software pulses the 2N3904 (provides a logic 1 as 3.3V) the transistor turns on connecting the black wire of the vibration motor to ground (or close to it). This makes the motor vibrate.

I could have added some capacitance at the Vibration Motor's red wire connection point. But there is capacitance on the Trinket';s 3.3V line so I am sure it is fine but if you want to add some other capacitance you can...as long as you can squeeze it in. For that matter the red wire could get connected directly to the LiPo battery's positive side. I chose the 3.3V side to keep the voltage constant. So far, it seems to work fine.

Last But Not Least...

IMG_3344.jpg
IMG_3284.jpg

Last we connect the JST Battery breakout board to the back side of the protoboard. I soldered pins onto the board and placed the JST Battery breakout board with its top side facing the protoboard as shown above. Make sure that you soldered the wires for positive battery and ground to the right pins when you place this part. If you are wrong you will reverse polarity to the parts and likely destroy all of them. So please, check and recheck before soldering and plugging in the battery.

Software

Chart.png

To install and/or modify the software you'll need the Arduino IDE and the board files for the Trinket M0 as well as the libraries for the VL53L0X. All of that is here, here, and here.

Follow the instructions for using the Adafruit M0 on their learning site here.

Once the software is loaded the board should start up and run on the USB serial connection. Move the side of the board with the VL53L0X close to a wall or your hand and you should feel the motor vibrate. The vibration should get lower in amplitude the further away from the device an object is.

A behavior seen in the device is somewhat explained in the comments in the source code. But the attached graph should make this point well. The device should not start to vibrate until about 863 mm from an object. It will reach its maximum vibration level at 50 mm from an object. If you move any closer to an object than 50 mm the device will not produce any more vibration than it does at 50 mm.

Enclosure

IMG_3537.jpg
IMG_3538.jpg
IMG_3539.jpg
IMG_3545.jpg

I designed an enclosure and 3D printed it in ABS plastic. You could print it in PLA or ABS or whatever material you want. I use ABS because I can acetone weld pieces onto the board if needed. The board I designed is simple and has a hole for the USB port on the Trinket and a hole for the power switch. I made the two board snap together with little arms on the sides of the box. I don't like it very much so I am likely to change it. Of course, you can make whatever changes you would like to see.

Right now for this version, the box has to be opened up to disconnect the LiPo battery to recharge it. If I do create a circuit board for this project I will add another connector to make the battery accessible without opening the box. It may be possible to do that on this protoboard design and make a hole for the connector for charging. If you want to try this please share your results.

I managed to design a box I didn't completely hate. We'll use this one to test the system. I have attached the top and bottom of the box as STL files as well as the bracket/guide I added the the bottom. I added a pair of guides using acetone to chemically weld the parts together. If you do this, be careful. You can see the assembly above.

Now What?

IMG_3548.jpg

Check me...I'm old and may have forgotten something or messed up. I'm re-reading and checking this but, I can still miss things. Feel free to tell me whatever I did/do wrong.

And, now that you have constructed the Peripheral Radar board and loaded it and the LiPo battery is in a nice 3D printed case (when I finish it or, if you did your own), what do you do next? I think you should get experience with how it operates and make modifications to the software. The license agreement in the software states you can use it but if you make any changes you are required to share them. I'm not saying that the software for this project is complicated or amazing in some way. It accomplishes its objectives but there is room for improvement. Help make this device better and share that with all of us. Remember, this project is all about helping people. So, help!