Project Echo - Your 6th Sense
Hello everyone! Welcome to my first real Arduino project, and my first instructable. I made a headband that has time of flight sensors and vibration motors attached that will allow you to "see" in the dark! While wearing Echo, as you get closer to objects in front of you, the vibration motors will vibrate quicker. This essentially acts as your sixth sense, similar to how some animals like bats and dolphins use echolocation. Did you know that dolphins can use echolocation to not only communicate over long distances, but also to map out 3d objects and create a detailed picture of it in their mind? Shape and texture and all! Anyways, shown above is my mad scientist looking headband.
Supplies
List of Supplies:
- VL53L0X Time of Flight sensor
- Coin Vibration Modules
- Headband (Any fabric headband works, whether or not it has a Velcro strap does not matter. Make sure it will fit your head comfortably. I would recommend using and thicker headband, both in width on the head as well as fabric thickness. This will give you enough room for the sensors, the wires, the battery, and the Uno)
- ELEGOO starter kit (I used the wires, the uno, etc. from this kit)
- Soldering kit (very helpful kit if you do not already have soldering equipment)
- I recommend buying strands of wire in red, black, green, yellow, and white. This will make it easier to have the correct length wire, and then you can solder on pieces of the included wires in the ELEGOO kit to make the ends of the wires have either male or female connectors. Those connections on the included wires usually stay in place in the Uno fairly well. and definitely better than just plain wire. This is a good choice. I do not recommend using solid core wire as it is less flexible, and for this, flexibility is needed.
- I also used string. You can buy any kind of sewing kit but this is the one I bought.
- Superglue! I just used Gorilla super glue but you can use any type of quick adhesive.
Buy and Test
First things first, you need to buy your supplies that you need and test your sensors to make sure none of them are broken or not working. There are sample codes in Arduino IDE for the VL53L0X sensors to make sure they work themselves. Your next step is to make sure you have enough wire for the project. For the sensors, you will need to solder the small pins to the sensor board so that it has connections. It comes with all the pins connected together by a plastic holder where the pins are longer out of one side than they are out of the other side. On the sensor, the top side with the names of the pins (Vin, GND, SCL, etc.) is the side where the shorter end will be poking through. You will insert the pins from the bottom side (so the plastic holder is on the bottom) and the short side of the pins are going through. Then, add solder to the top side where the short pins are poking through. I've found that this is the best way to do it so it's secure and does not obscure the sensor at all, even when wires are added. The pictures added show what it looks like when I first unpackaged them, and them at the very end. (Pardon the dried messed up superglue on the second picture, the superglue got cold and turned white because I left it in my car overnight...)
Measuring and Cutting the Wires
Measure the length from where the sensors will sit on the front of the headband to where the Uno will sit on the back of the headband. I recommend putting the headband on and then stretching the wire across it while it is on your head. Then, hold your finger where you need to cut, and then cut a little more than you need. You should always cut the wire a little longer just incase it breaks at any point while stripping the wire coating or soldering. You will need four red wires that length for the power pins for the time of flight (ToF) sensors and the vibration motors. You will also need four black wires the same length for the ground pins. Two yellow wires are needed for the SCL pins and two green wires for the SDA pins on the ToF sensors. Finally, you will need two white wires, same length as all of the others, for the shutdown pins on the ToF sensors.
In total you should have 14 wires.
- 4 red for power.
- 4 black for ground.
- 2 yellow for SCL.
- 2 green for SDA.
- 2 white for shutdown.
Soldering the Wires: Vibration Motors
Attached is a schematic I drew of the whole wiring system. Here you can see that some wires join together before going to the Uno. With every wire you solder together, make sure you put heat shrink on the wire before you solder, that way it will slip over the soldered part easily and shrink well. Keep the heat shrink away from the soldering area until you're done soldering it, otherwise it will be heated up before you need it to. I will start by explaining the vibration motors' wires. For the red wires on the vibration motors, those will stay separated so that they can vibrate independently. Solder one end of one red wire to vibration motor #1. Take one of the jumper wires from the ELEGOO kit that has at least one male end and cut the male end off, leaving a bit of wire at the end for soldering. Solder the male part to the plain red wire that has the other end is connected to the vibration motor. It should be vibration motor with extended red wire with a male end. Do the same thing with the other vibration motor and one of the other red wires you cut.
Next, is the black ground wires for the vibration motors. I would recommend soldering the black wires you cut to the blue wires on the vibration motors first (the vibration motors I listed in the supplies list have blue wires for ground instead of black, if yours have black wires use those). Do the same for both vibration motors. Now, their ground wires are extended. Now, connect the two ends of the ground wires together and add a male end as well. Solder all three together and don't forget your heat shrink! After that, the vibration motors are done!
Soldering the Wires: VL53L0X Sensors
Onto the ToF sensors. The two red power wires you have left will be attached to the Vin pins on the ToF sensors. You can either solder a female end onto one side and then connect it that way, or solder the wire directly to the pins and then put heat shrink over top. Once the Vin pins have their red wires connected, now you can do the same thing you did with the vibration motors' ground wires. Connect the two Vin red wires at the bottom and add a male end piece and solder all together. (Remember the heat shrink!) You will do the same thing with the ground wires for the ToF sensor. Solder them to the GND pins on the sensors, one black wire for each sensor, and then connect them at the bottom with a male end and solder together. For the yellow wires for the SCL pins, you will do the same. As well for the green wires for the SDA pins.
Now, for the white wires, all you will need to do is solder them to the XSHUT pins on the sensors and add a male end. The white wires will not be connected. These are used for shutting down and resetting the sensor so that they can be assigned different addresses from each other in the code. Apply heat shrink where needed on the wires as you go.
In the picture attached to this step, from top to bottom, the wires are as follows: red Vin, black GND, yellow SCL, green SDA, GPI01 (not using), and white XSHUT (reset pin).
Connecting to the Board
Back in the schematics I included, it shows which wires go to which pins. The red power wire for the sensors will need to go to the 3.3V pin on the Uno. In the datasheet for the VL53L0X, it says to use 3.3V so that's why we are using that pin. The black wire will go to one of the GND pins. The yellow wire will go to the A5 pin. The green wire will go to the A4 pin, and last but not least, the white wires will go to pins 6 and 7. Pin 6 should be for the right side sensor, and pin 7 should be for the left side sensor.
For the vibration motors, the black ground wire goes to one of the GND pins on the Uno. The left side motor's red wire will go to pin 11, and the right side motor's power wire will go to pin 12.
Easy peasy~!
Testing.. Testing.. Is This Thing On?
Now it is time for us to test our setup and run the code. Attached is the final code for the whole thing, but in the Adafruit VL53L0X library, there is a test code simply for 2 sensors alone. If anything does not work with the main code, use that premade test code and check your wires and connections. If it works, then you're good to move on to the next step! The vl53l0x_dual.ino is the full code for both sensors and both vibration motors. The TpF_And_Vibration_Intervals-1.ino is code for just one sensor and one vibration module. You can also use that to test your sensors incase anything goes wrong or does not work.
The Sensors' Box
I will include a STL file of the box I created for the sensors. You may have to file down the top of the opening that allows the sensor to see out of the box for it to fit in perfectly, but even if you don't, the sensor will still have a clear line of sight out. These are 3d printed holders for the sensor so that they stay put at a specific angle the whole time. This is where I used super glue. I put a tiny amount on the top of the sensor which is the side with the names of the pins (Vin, GND, SCL, etc.) and then put a small amount on the edges of the sensor where it would fit into the hollow area of the box. It stayed well after that! Make sure you only put the glue on the black parts of the sensor where it won't interfere with any of the components or the actual laser sensor area on the top (That's the small raised rectangle on the top). Then, put the head band on and mark where you want the sensor to sit. Note that the box has a slightly taller side than the other, this goes on the top side when putting it against the headband. I added that to make sure the sensor points forward, and not up like it would in a simple box with all sides the same height. You want to look at the placement of it in a mirror to make sure they are close enough together on your forehead that they point straight and not out to the side.
While you have the superglue out, you can either use the normal stickiness that the vibration motors have, or superglue them, but you will put them on the inside of the headband, making sure they are on the correct sides. Thge on connected to pin 11 goes to the left side, pin 12 goes to the right side.
Downloads
What's That String For?
Now, moving onto the string. My wires were all over the place and looked like hair that just got shocked. So, I used string to wrap all of the wires together into a single, thicker "wire." I did end up wrapping just the wires from the sensors together on either side, and then the two wires from the vibration motors together on either side but you can do them all together. Just make sure to keep the left side wires separated from the right side wires. You could also use heat shrink to keep them grouped together, I just used string because it seemed easier for me at the time. This helps keep all of the wires looking neat and pressed against the headband. I then used the same black string and sewing over top (not through) the wires and sewed them directly to the headband. This is after I superglued the box to the correct spot on the headband. This not only helps keep the wires tidy and in place, but it can also help reduce strain on the wire connects and keep them from being moved around too much.
Next, I put the Uno on the back of the headband and used string to keep it in place there. I pretty much secured the start of the string by leaving a bit out and tying it in a few knots to make sure it stays, and then using the needle and thread to go over top of the excess string at the start and hold it in place even more. Then I wrapped it around the Uno and went through the headband multiple times, from multiple sides and angles, (make sure to use a looooong thread) and then did the same thing at the end to secure the string as I did at the beginning. If you want to super glue the Uno to the headband, go ahead, just make sure to avoid covering important parts with glue. I just wanted an easily reversable hold.
Then, I attached the battery wire connector to the Uno, figured out where I wanted to place the battery on the headband where the wire would reach, and then sewed the battery to the headband in a similar way. I will include pictures of my messy sewing job and how I kept both pieces in place. To keep some of the looser wires in the Uno pins, I tied a couple loops around the wire, above where the male end connecters start, (this is another reason why having those is nice, because they provide a slightly larger area compared to the wire for the thread to sit on top of rather than just sliding down) then I used the needle to sew that part down to the headband and keep pressure on the wire so it stays in the pin.
Finally...
Run the code, double check it works, and you're finally done!