Follow MaxBotix:
Ask A Question
|     Written By: Tom Bonar     |     Date Posted: 04-30-2014    |
The Arduino micro-controller is one of the most popular development boards for electronics enthusiasts. With the ability to control components such as buzzers, LED’s, servos, motors, and LCD’s, Arduinos have become the go-to selection for users that are looking to start into electronics, firmware coding, or automation. So with all these item types at your finger tips, what good is it to have control over so many components, if there are no sensors to trigger different functions in the Arduinos firmware?

The MaxBotix Inc., MaxSonar sensor line has become a very popular sensor for operation with the Arduino micro-controller. With three simple interfaces, it is easy to connect a MaxSonar to an Arduino.

In this article, I will be providing: links to components needed, wiring diagrams for all outputs, and Arduino sketch files for all compatible MaxSonar sensors. With that being said, let’s get coding!
 

Table of Contents

 

List of Materials Needed

Setting Up the Arduino

Wiring Pictures

 

Arduino Coding Part 1

    Useful Information
    Arduino Comments
    Code the Input & Variables
 

Arduino Coding Part 2

    Code Setup
    Code Section to Read Sensor
 

Arduino Coding Part 3

    Code Debug Section
    Code Void Loop
    Review the Code
 

Code Downloads

    LV-MaxSonar Code Downloads
    XL-MaxSonar Code Downloads
    HR-MaxSonar Code Downloads

Code Downloads

 

LV-MaxSonar Code Downloads

 
Single Sensor Analog Voltage
For a diagram on how wire this to a breadboard, please view the image here.
Multiple Sensors Analog Voltage
For a diagram on how to chain properly using a bread board, please view the image here.
Single Sensor Pulse Width
For a diagram on how wire this to a breadboard, please view the image here.
Multiple Sensors Pulse Width
For a diagram on how to chain properly using a bread board, please view the image here.
 

Top of the Page

 

XL-MaxSonar Code Downloads

 

7.65 Meter Sensors

 
Single Sensor Analog Voltage
For a breadboard wiring diagram, review the MB12XX image here or MB70XX image here.
Multiple Sensors Analog Voltage
For a breadboard wiring diagram with chaining, review the MB12XX image here or MB70XX image here.
Single Sensor Pulse Width
For a breadboard wiring diagram, review the MB12XX image here or MB70XX image here.
Multiple Sensors Pulse Width
For a breadboard wiring diagram with chaining, review the MB12XX image here or MB70XX image here.
 

10 Meter Sensors

 
Single Sensor Analog Voltage
For a breadboard wiring diagram, review the MB12XX image here or MB70XX image here.
Multiple Sensors Analog Voltage
For a breadboard wiring diagram with chaining, review the MB12XX image here or MB70XX image here.
Single Sensor Pulse Width
For a breadboard wiring diagram, review the MB12XX image here or MB70XX image here.
Multiple Sensors Pulse Width
For a breadboard wiring diagram with chaining, review the MB12XX image here or MB70XX image here.
 

Top of the Page

 

HR-MaxSonar Code Downloads

 

5 Meter Sensors

 
Single Sensor Analog Voltage
For a breadboard wiring diagram, review the MB1XX3 image here or MB73XX image here.
Multiple Sensors Analog Voltage
For a breadboard wiring diagram with chaining, review the MB1XX3 image here or MB73XX image here.
Single Sensor Pulse Width
For a breadboard wiring diagram, review the MB1XX3 image here or MB73XX image here.
Multiple Sensors Pulse Width
For a breadboard wiring diagram with chaining, review the MB1XX3 image here or MB73XX image here.
 

10 Meter Sensors

 
Single Sensor Analog Voltage
For a breadboard wiring diagram, review the MB73XX image here.
Multiple Sensors Analog Voltage
For a breadboard wiring diagram with chaining, review the MB73XX image here.
Single Sensor Pulse Width
For a breadboard wiring diagram, review the MB73XX image here.
Multiple Sensors Pulse Width
For a breadboard wiring diagram with chaining, review the MB73XX image here.
 

Top of the Page

 
Author: Kathy Kostal  Date: 08-31-2016
Inc 5000 Maxbotix Logo Inc. Magazine Unveils 35th Annual List of America's Fastest Growing Private Companies–the Inc. 5000. MaxBotix Inc., Ranks No. 1752 on the 2016 Inc. 5000 with Three–Year Sales Growth of 213%.
Click here for full article.
Author: Cody Carlson  Date: 08-02-2016
Raspberry Pi 2 board MaxSonar sensors offer a variety of outputs including TTL serial data. This tutorial guides you through the process of setting up your Raspberry Pi 3 with a MaxBotix sensor. Click here for full article.
Author: Scott Wielenberg  Date: 07-26-2016
Full Horn Housing MaxBotix offers an expanded range of packaging options for many of our sensors. Each option provides unique benefits to certain mounting integrations. This article provides a brief overview of each option.
Click here for full article.
Author: Scott Wielenberg  Date: 07-18-2016
Sensor is Tested When providing support, our technical support team may determine that further testing at our facility is the best way to help resolve the issue that you are facing. At this point, they will start the Return Merchandise Authorization (RMA) process. This article will explain what you can expect as your ultrasonic sensor travels through our RMA process.
Click here for full article.
Author: Scott Wielenberg  Date: 07-11-2016
Typical Wall Pipe Many customers have requested the option to mount an ultrasonic sensor in a pipe. During the testing and development cycle, we discovered a number of considerations and requirements that must be met for the application to be successful. When all of these are met, a user may be able to achieve the desired level of success for measuring the liquid level inside of a pipe.
Click here for full article.
Author: Jenney Grover  Date: 06-28-2016
one of the options for outputs On April 19th, we welcomed our supporters to join us for the Grand Opening of the Build Out. Bob and Nita Gross gave a tour of the build out and their vision for the space. We continue to be in awe of the support from our community, our employees, our distributors, and our customers. Thank you for the many years of support, and we look forward to serving you in the years to come.
Click here for full article.
 
 
 
 
 
Signup for notification of our exciting new products and periodic new letters. We are excited to provide the latest information from MaxBotix Inc.