0% found this document useful (0 votes)
3 views12 pages

Garage Distance Sensor

The document introduces the SparkFun Qwiic Ultrasonic Distance Sensor, a device designed to enhance garage parking by preventing collisions. It outlines the necessary hardware and software setup, including required libraries for Arduino. The document also provides a brief guide on connecting the components and uploading code to read measurements using a Serial Monitor.

Uploaded by

serfary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views12 pages

Garage Distance Sensor

The document introduces the SparkFun Qwiic Ultrasonic Distance Sensor, a device designed to enhance garage parking by preventing collisions. It outlines the necessary hardware and software setup, including required libraries for Arduino. The document also provides a brief guide on connecting the components and uploading code to read measurements using a Serial Monitor.

Uploaded by

serfary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Garage Distance Sensor

Introduction
Looking for a Qwiic and easy way to set up perfect parking? Look no
further than the SparkFun Qwiic Ultrasonic Distance Sensor! This nifty
device takes your garage parking game to the next level, offering a
high-tech solution to prevent those dreaded wall bumps!

SparkFun Ultrasonic Distance Sensor - TCT40 (Qwiic)


SEN-24805
$11.50
If you are looking for the full Hookup Guide for the SparkFun Ultrasonic
Distance Sensor - TCT40 (Qwiic), click the button bellow. This guide
only covers a simple project to get you started quickly, while the full
Hookup Guide goes over every detail of the sensor.

View the Full Hookup Guide

Hardware Needed
To follow this experiment, you will need the following materials. While
this is a simple project we wanted to make sure that you have
everything you need to get started before we get to the code. For this
simple project we chose the RedBoard Qwiic but you could choose
from many of our development boards such as the Qwiic Pro Micro as
well.
SparkFun Ultrasonic Distance Sensor - TCT40 (Qwiic)
SEN-24805
$11.50
SparkFun RedBoard Qwiic
DEV-15123
$21.95
SparkFun Qwiic Twist - RGB Rotary Encoder Breakout
DEV-15083
$25.50
SparkFun Qwiic OLED - (1.3in., 128x64)
LCD-23453
$19.95
Qwiic Cable - 100mm
PRT-14427
$1.50
Qwiic Cable - 100mm
PRT-14427
$1.50
Flexible Qwiic Cable - 500mm
PRT-17257
$2.75
USB Micro-B Cable - 6 Foot
CAB-10215
$6.50
Note: This tutorial calls for two 100mm Qwiic Cables (which is why it's
listed twice), but any Qwiic cable can be used instead of the 100mm
version. Please be sure to have the correct amount in your cart before
purchasing.

Software Setup
Note: If this is your first time using Arduino, please review our tutorial
on installing the Arduino IDE. If you have not previously installed an
Arduino library, please check out our installation guide.

Installing the Required Libraries


• Install the SparkFun Qwiic Ultrasonic Arduino Library: Open
the Arduino IDE and navigate to Sketch > Include Library >
Manage Libraries. In the Library Manager, search
for "SparkFun Qwiic Ultrasonic Arduino Library" and install
the latest version from SparkFun, or by downloading it from
the GitHub Repository.

• Install the SparkFun Qwiic OLED Arduino Library: Open the


Arduino IDE and navigate to Sketch > Include Library >
Manage Libraries. In the Library Manager, search
for "SparkFun Qwiic OLED Arduino Library" and install the
latest version from SparkFun, or by downloading it from
the GitHub Repository.

• Install the SparkFun Qwiic Twist Arduino Library: Open the


Arduino IDE and navigate to Sketch > Include Library >
Manage Libraries. In the Library Manager, search
for "SparkFun Qwiic Twist Arduino Library" and install the
latest version from SparkFun, or by downloading it from
the GitHub Repository.

Read Measurements with a Serial


Monitor
Now that we've installed the Arduino library, it's time to upload our first
sketch to make sure everything is working properly and you are able to
read basic measurements with your Serial Monitor in the Arduino IDE.
For this example you will need the following items SparkFun RedBoard
Qwiic, a SparkFun Ultrasonic Distance Sensor, a SparkFun Qwiic
OLED - (1.3in., 128x64), a SparkFun Qwiic Twist, two 100mm Qwiic
Cables, a 500mm Qwiic Cable , and a USB Micro-B Cable.
Using the Qwiic system, assembling the hardware is simple and
straightforward. Start by connecting the SparkFun RedBoard Qwiic to
the SparkFun Qwiic OLED (1.3in., 128x64) using one of the 100mm
Qwiic cables. Next, connect the SparkFun Qwiic Twist to the OLED
using the second 100mm Qwiic cable. Finally, plug one end of the
500mm Qwiic cable into the remaining port on the Qwiic Twist, and
connect the other end to the SparkFun Ultrasonic Distance Sensor.
Remember to insert all Qwiic cables in the correct orientation. To
power up the system, connect the RedBoard to your computer using
the USB Micro-B cable. With these connections in place, you're all set
to start your project!

SparkFun Distance Sensor Hooked up to RedBoard

You can copy and paste the code below into a shiny new Arduino
sketch:

You might also like