Ultrasound Parks My Car

Every day I back my Toyota 4Runner into my garage at home. I have a backup camera which makes it very easy to not hit anything. But that’s not good enough. I like to maximize my available space and this requires me getting my truck just barely inside the garage door. My quest for the perfect parking job has cost me one slightly bent garage door handle. I do have some visual aids in the garage which get me fairly close, but these all rely on me aligning them to something in the car which means there’s tons of error due to parallax. I can do better than this…

So I decided to use a sensor to detect my distance and tell me when I had reached the perfect distance for parking. There are many options, but I wanted a fairly fast sample rate (~10hz) and max range wasn’t a huge issue since the maximum distance I cared about was only the length of my garage. I decided to go with a cheap ultrasonic ranging sensor (HCSR04 Datasheet). It’s a very simple sensor to work with. You just pull the trigger line high for 10uS, the device then sends out an 8 cycle burst of sound at 40kHz. I then just wait for the ‘Echo’ line to go high and time how long it stays high. I can then calculate the distance that the sound burst was able to travel in that amount of time.

Getting distance measurements was fairly easy. I then needed to be able to see this distance value as I backed up my truck. For display, I used an Osepp LCD Keypad Shield I had been working with on another project. It has a blue background and nice bright characters. Driving an LCD with an Arduino is dirt simple. I just used the built-in LiquidCrystal library in Arduino and it worked like a charm.

An Arduino Uno, an ultrasonic sensor, and an Osepp display shield ready to be joined together like Voltron.

 

An Arduino Uno, an ultrasonic sensor, and an Osepp display shield ready to be joined together like Voltron.

The image above shows the modules I used for this project. I decided to solder some male->female jumper leads onto the LCD shield to make it easier to connect the ultrasound rangefinder and position it wherever I wanted during testing.

Utmost craftsmanship goes into testing the firmware and getting some real-world values for where I need to park my car.

 

Utmost craftsmanship goes into testing the firmware and getting some real-world values for where I need to park my car.

I crudely taped the unit to the wall at about the same height as my backup camera on my 4Runner. This allowed me to get some quick measurements of an ideal distance as seen by the sensor. Turns out, the perfect parking distance for my truck in my garage is 87cm from where I expertly taped this sensor.

Things I learned:

  • Arduino proves once again to be super easy to work with
  • The display looks great, but it is difficult to view through my backup camera
  • 87cm is the perfect parking distance to allow my hatchback to open and not hit my outdoor gear on the wall.

Next Steps:

  • Explore other display options (big 7-segment, colored LEDs, etc)
  • Explore different types of feedback (audio, mechanical)
  • Make the unit shutdown the display until it is needed.
  • Design a custom housing (either vacuum formed or 3D printed)

Here’s some rough sample code:

#define trigPin 3
#define echoPin 2

void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print(“Parking Distance:”);
}

void loop() {
long duration, distance;
lcd.setCursor(7,1);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance >= 300 || distance <= 0){
//TODO: Turn off Display
}else {
lcd.print(distance);
lcd.print(” “);
}
delay(100);
}

The Music of The Data Bus

One thing I’m really into is sound. A long time ago, I taught sound design and synthesis at a design college and loved being able to surround myself with everything audio. I still like to explore this area of creativity, but sometimes that can be tough to do. Especially when you are spending your days working in a very analytical mode. So, for this project, I figured “Why not combine the two?” I decided to make something to mash the two hemispheres of my brain together.

After some brainstorming and looking around my office to see what things I was currently working on that might fit, I came upon the idea of listening to the ‘music’ of a data bus. I had just finished designing a modular, CAN-based system and was fairly deeply immersed in the details of the internal communication bus. While watching data packets stream past my eyes for a few hours, I got the idea of listening in on them instead of watching them.

The idea was simple. Create an interface to the bus I just created, listen in on packets as they passed by, and trigger sounds based on the distinguishing features of these packets. I used a Microchip MCU for the brains and an MCP2551 as the CAN transceiver. The unit would listen for CAN packets, parse them, retrieve a certain value within the packet, and then turn around and output MIDI data over the serial output of the microcontroller.

Data Bus packets to MIDI device
Inside the box is a microcontroller that listens to CAN packets coming into the ‘Data Port’ and outputs MIDI note data based on the parsed values.

 

The end result was a fairly periodic recording where one can hear the late arrival of some packets from time to time. Enjoy!

 

Vacuum forming in the kitchen

Warning: Always make sure your work area is properly ventilated and know the materials you are working with.

NOTE: This is post from about 2013 that I am just now getting around to publishing. Please excuse any dated references. 

I wanted to experiment with some vacuum forming at home and found a great Instructable (Here) by drcrash that I used as reference. I won’t replicate those instructions here because once you understand the basic idea, you really can create your vacuum forming rig however you’d like.

In a nutshell, you want a frame that can withstand high temperatures into which you will mount a piece of thermoplastic. For your base, you want an airtight (as much as possible) seal between your frame’s bottom and the orifice connected to your vacuum source. You heat the thermoplastic up until it is soft and pliable, then you pull the plastic over your desired object while the vacuum is running. You push your frame down against your seal and the air is evacuated around your part. The soft plastic is suctioned around your part, it cools, and you are left with a plastic shell of your desired object. That is all there is to it. The rest is just details about material selection, distributed airflow, proper sealing, and master part design considerations.

supplies
Screen frame material, weather stripping, metal binder clips, & metal corners for the frame.

The materials are fairly inexpensive, I found the Instructable linked above to be fairly accurate regarding costs. Honestly though, you could make this rig even cheaper. Again, it is a simple concept that can be elaborated upon as far as your desire/pocketbook allows. Hack-sawing aluminum screen frame material is NOT the most ideal way to miter your corners. Mine came out pretty sloppy and if I were to make more frames, I’d use a band-saw with a jig.

metal frame
Metal frame all ready to go.

Regardless of the pain that was my hack-sawing adventure, the frame still came out fairly good. Not a perfect frame by any means, but it pulls just fine in the final rig.

Full assembly of vacuum forming rig
Vacuum forming base on stands with vacuum hose attached.

This is the entire rig fully assembled in my garage before it made its way into my kitchen for the actual vacuum forming process. I have a sample piece of plastic loaded into the frame ready to go. The hose coming out the bottom leads to my shop vac.

Vacuum forming base
Vacuum forming base with small, 3D printed shape over which the material will be pulled.

The photo above shows the small 3D printed part I prepped to be pulled. I was using this small dome for an LED enclosure of a small lighting project I was working on. The part is stuck to a small platform with some putty and this small platform is then resting on some folded mesh screen material. This allows the air to flow all around the part. The vacuum port is located beneath this mesh.

Thermoplastic in the oven
Thermoplastic in the oven

Ahh, the smell of fresh plastic in the oven. I keep all windows and doors open while I’m doing this to make sure my kitchen is properly ventilated. When the plastic starts sagging uniformly, it’s time to start the pull.

 

Final Verdict

If you don’t mind the smell, or have a spare oven lying around, this method works quite well. I wouldn’t suggest this for any production parts, but for roughing out an early concept or just validating a design before you pay to have someone else pull it for you, this is a very easy to do project at home/in the lab. Everything comes down to how good your seal is and how much vacuum pressure you have. My parts came out decent enough for the molds I was working on, but there was definitely loss of detail in some finer features. I recommend any hobbyist / professional designer have this skill in their tool belt. It doesn’t have to be perfect, sometimes, you just need a vacuum formed part today.

 

Projects on the move!

I’m currently in the process of moving all of my projects over to posts in WordPress. Stay tuned for more nerd eye candy.

In the meantime, enjoy this picture of a block of machinable wax I was machining on a Sherline bench top CNC mill. This was the master that I then used to create a silicon mold and cast some clear resin shapes for a project I’ve been working on.

IMG_0033.JPG

And here are some of the molds and castings.

IMG_0213.JPG