Wall-Ping Sensor

by david358371 in Circuits > Arduino

85 Views, 0 Favorites, 0 Comments

Wall-Ping Sensor

20230501_193017.jpg
Wall-Ping Demo

This is a simple yet innovative project for my Digital Electronics class designed to "extend the human senses" or in other words, make someone less reliant on one sense in trade for another of unusual nature. This project senses when the wearer or user of the device is about to run into something like a wall or table and beeps in their ear along with a flashy light to alert them before the collision. It's especially helpful for those with limited vision (e.g. cosplay mask) or trying to shuffle around the dark or eye-hidden environments without giving yourself away too much.

Supplies

Tools/Kits

Materials

Alternatives

Physical Setup

berthodperezd_myworkbenchpic02 (1).jpg

As you wait for things to arrive in the mail or gather supplies via other methods it's always good to have a plan in mind. You need a place to work (hence a 'workspace') with good air ventilation (even near a window works).

You also need room to work on a solid non-flammable space like a counter or non-conductive desk (dry wood works).

Disregarding the materials I already had I estimate a minimum of $50 was spent on this project but that was mostly the case of me rushing to get materials in my time scope before finding better solutions for them which I made sure to exclude from the supply list so you don't make the same mistake :)

Of course, you may also find cheaper materials/tools on your own.

What Is Arduino?

arduino-sketch-structure.png

Arduino is an open-source programming language based on C/C++ coding language with specifications for designing functions for electronic circuits (such as our Arduino R3 Uno). You can learn more here.

Of course, you need a computer-oriented device/OS (preferably Windows) and download the IDE here. Be sure to follow the download instructions accordingly.

Next, you may be lost on how to get started (luckily I'll provide the code so you don't have to worry too much about learning how to code if you've never done so before). Here is a good place for references.

Finally and MOST IMPORTANTLY you'll need the libraries so the code actually works which I'll teach you how but note an internet connection is required:

  1. Open Arduino IDE (after installing).
  2. View the left side of the application.
  3. Click the icon that looks like books on a shelf to open the 'Library Manager'.
  4. Filter your search and click 'Install' for the following:
  5. 'Adafruit NeoPixel' by Adafruit
  6. 'VL53L0X' by Pololu
  7. 'DFRobotDFPlayerMini' by DFRobot

After all is downloaded you can check your installed library by browsing through your managed library to see if you're good to go.

Getting Started - NeoPixel

20230501_200112.jpg
20230426_181505.jpg

In these 'Getting Started' steps I'll essentially split all parts of this circuit into modules/parts for the less experienced or those who want to just test parts separately (otherwise you can just skip to the 'Final Setup & Solder').

For a quick guide on 'What are NeoPixels?' you can go here. In short, NeoPixels are just smarter LEDs (Light Emitting Diodes) or smart lights that can be coded individually. The AdaFruit NeoPixel library for Arduino comes with a few examples you can see for yourself I'll describe them later, but first we need to set up the circuit!

To start let's look at your NeoPixel. If you got the first mentioned 7-ring NeoPixel instead of the 6-ring NeoPixel, you'll likely need first snap off the outer 2 rings and then solder each wire individually (which I might add can be a long painful experience) but I'll describe soldering more further down, just remember 'Vi' (in) goes to 'Vo' (out).

Moving on to the breadboard you'll need:

  • Breadboard
  • Elegoo R3 Uno
  • 3.0 USB to mini USB
  • Yellow Male-Male Wires
  • Red Male-Male Wires
  • Black Male-Male Wires
  • Wired NeoPixel (note video wire may be another color than yellow)
  • 470uf Capacitor
  • 330uF Resistor

You can download my code (put together with the assistance of the Adafruit examples found by going to the top left of Arduino then clicking 'File>Examples>Adafruit NeoPixel>...' and prior coding knowledge) then open it with the Arduino IDE.

Now check the code (click the check at the top) and plug in your Arduino to your computer, then upload (click the arrow at the top) the code to your Arduino. Now we can create the board in the above image:

  1. Start with putting the capacitor on the power and ground bus (the side edge outlined with red/blue) of the breadboard (note the longer wire of the capacitor is +/Red/Power and the shorter is -/Blue/Black/Ground).
  2. Lead a black wire to a separate part on the board, and do the same for a red (ideally after the capacitor).
  3. Match the red and black wires of the NeoPixel to be in the same row as their respective wire (red-red, black-black), but not in the bus position.
  4. Place your resistor elsewhere on the board with each end being in 2 different rows, then put the yellow wire of the NeoPixel in the same row as one end of the resistor.
  5. Now, grab an extra red, black, and yellow wire:
  6. Connect the black with the blue bus on the board and plug it into a 'gnd' on the Elegoo.
  7. Connect the yellow with whatever pin the code is using (possibly ~3) on the Elegoo then respectively to the unused end of the resistor on the board.
  8. Connect the red wire to the red bus on the board and plug it into a '5v' on the Elegoo.
  9. Watch, then clean the board if satisfied.

Downloads

Getting Started - MP3 Player

20230427_001734.jpg

The MP3 player is a little more complicated than our NeoPixel but quite similar. This reference was a good start for me as it goes over the necessary steps for the TF card.

The TF card is where you place your sound/mp3 files to be played, of which I also provided sound files for but feel free to use your own. The modified code I provided (this time with the assistance of 'File>Examples>DFRobotPlayerMini>...' examples for the DFRobotPlayerMini library) helps startup the Decoder and play the sounds on the TF card when plugged in. Note: sounds played may be different based on the order your place them onto the TF card.

Moving on to the breadboard you'll need:

  • Breadboard
  • Elegoo R3 Uno
  • 3.0 USB to mini USB
  • Yellow Male-Male Wires
  • Red Male-Male Wires
  • Black Male-Male Wires
  • Other Color M-M Wires
  • Another Color M-M Wires
  • Serial MP3 Player Module
  • 470uf Capacitor

Once again, check the code (click the check at the top) and plug in your Arduino to your computer, then upload (click the arrow at the top) the code to your Arduino. Now we can create the board in the above image:

  1. Start with putting the capacitor on the power and ground bus (the side edge outlined with red/blue) of the breadboard (note the longer wire of the capacitor is +/Red/Power and the shorter is -/Blue/Black/Ground).
  2. Lead a black wire to a separate part on the board, and do the same for a red (ideally after the capacitor, but this time preferably in rows next to each other).
  3. Match the red and black wires of the MP3 Player to be in the same row as their respective port/wire (VCC-red, GND-black).
  4. Now, grab an extra red, black, and 2 other color wires:
  5. Connect the black with the blue bus on the board and plug it into a 'gnd' on the Elegoo.
  6. Connect the Tx wire with whatever pin the code is using as the Rx pin on the Elegoo then respectively to the Tx row on the board.
  7. Connect the Rx wire with whatever pin the code is using as the Tx pin on the Elegoo then respectively to the Rx row on the board.
  8. Connect the red wire to the red bus on the board and plug it into a '5v' on the Elegoo.
  9. Watch, then clean the board if satisfied.

Getting Started - ToF Sensor

20230424_005607.jpg

The ToF (Time of Flight) sensor is essentially and IR(Infra Red) rangefinder/laser. This code is easily accessible by clicking 'File>Examples>VL53L0X>Single'. I provided a shortly modified version if you prefer to just download and use that instead.

Moving on to the breadboard you'll need:

  • Breadboard
  • Elegoo R3 Uno
  • 3.0 USB to mini USB
  • Yellow Male-Male Wires
  • Red Male-Male Wires
  • Black Male-Male Wires
  • Other Color M-M Wires
  • Another Color M-M Wires
  • ToF Sensor
  • 330uF Resistor
  • 470uf Capacitor

Once again, check the code (click the check at the top) and plug in your Arduino to your computer, then upload (click the arrow at the top) the code to your Arduino. Now we can create the board in the above image:

  1. Start with putting the capacitor on the power and ground bus (the side edge outlined with red/blue) of the breadboard (note the longer wire of the capacitor is +/Red/Power and the shorter is -/Blue/Black/Ground).
  2. Lead a black wire to a separate part on the board, and do the same for a red (ideally after the capacitor, but this time preferably in rows next to each other).
  3. Match the red and black wires of the ToF Sensor to be in the same row as their respective port/wire (VIN-red, GND-black).
  4. Now, grab an extra red, black, and 2 other color wires:
  5. Connect the black with the blue bus on the board and plug it into a 'gnd' on the Elegoo.
  6. Connect the SCL wire with the SCL pin on the Elegoo then respectively to the SCL row on the board.
  7. Connect the SDA wire with the SDA pin on the Elegoo then respectively to the SDA row on the board.
  8. Connect the red wire to the red bus on the board and plug it into a '5v' on the Elegoo.
  9. Watch, then clean the board if satisfied.

Downloads

Final Setup & Solder

20230427_110230.jpg
20230427_110319.jpg
20230501_193047.jpg
20230501_193157.jpg
20230501_193017.jpg

With all modifications in place, let's merge everything together! I provided the merged code so that they all work together correctly as seen in the first video. Download the code then follow the images above, remember the boards you just put together, and practice good soldering techniques here. If you're uncomfortable or unable to solder you can still stick with the breadboard.

Moving on to the final board you'll need:

  • Elegoo R3 Uno
  • 3.0 USB to mini USB
  • Stackable R3 Uno Proto-shield
  • Yellow Male-Male Wires
  • Red Male-Male Wires
  • Black Male-Male Wires
  • Yellow Male-Male Wires
  • Other Color M-M Wires
  • Another Color M-M Wires
  • Serial MP3 Player Module
  • New Other Color M-M Wires
  • New Another Color M-M Wires
  • ToF Sensor
  • 470uf Capacitor
  • 9v Battery & plug-in power/wire

Once again, check the code (click the check at the top) and plug in your Arduino to your computer, then upload (click the arrow at the top) the code to your Arduino. Now we can create the board in the above image, note some parts may need space while others will be easier to place before another:

  1. Start with putting the capacitor on the power and ground bus (the side edge outlined with red/blue) of the board (note the longer wire of the capacitor is +/Red/Power and the shorter is -/Blue/Black/Ground).
  2. Lead a black wire to a separate part on the board, and do the same for a red (ideally after the capacitor, but this time preferably in rows next to each other).
  3. Match the red and black wires of the NeoPixel to be in the same row as their respective wire (red-red, black-black), but not in the bus position.
  4. Match the red and black wires of the MP3 Player to be in the same row as their respective port/wire (VCC-red, GND-black).
  5. Match the red and black wires of the ToF Sensor to be in the same row as their respective port/wire (VIN-red, GND-black).
  6. Now, grab an extra red, black, and 2 other color wires:
  7. Connect the black with the gnd bus on the board and plug it into a 'gnd' on the Elegoo.
  8. Connect the yellow with whatever pin the code is using (possibly ~3) on the Elegoo then respectively to the unused end of the resistor on the board.
  9. Connect the Tx wire with whatever pin the code is using as the Rx pin on the Elegoo then respectively to the Tx row on the board.
  10. Connect the Rx wire with whatever pin the code is using as the Tx pin on the Elegoo then respectively to the Rx row on the board.
  11. Connect the SCL wire with the SCL pin on the Elegoo then respectively to the SCL row on the board.
  12. Connect the SDA wire with the SDA pin on the Elegoo then respectively to the SDA row on the board.
  13. Connect the red wire to the pwr bus on the board and plug it into a '5v' on the Elegoo.
  14. Check your solder joints and connections, and enjoy!

To hear the noises make sure you have that AUX cord & speaker or headset/earbuds on hand, then simply plug it into the MP3 player (be sure not to obstruct the ToF sensor). If connections feel loose feel free to use the hot glue gun.

(Optional) Holding Case

20230501_194407.jpg
20230501_194427.jpg
20230501_200015.jpg
20230502_012119.jpg
20230502_023603.jpg
20230502_023614.jpg
20230502_023632.jpg

This step is completely optional as it was mostly to the help of my JunkBoxâ„¢ and on-hand tools to scrap together a case I can simply hold in the R3 Uno with some adhesive strips and plastic cuts hot glued around the edges, with some cut pieces of a water hose.