Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Getting started with the Maxbotix sonar sensor – quick start guide

Maxsonar-Ez1 Lrg-1
The MaxSonar EZ1 provides very short to long-range detection and ranging, in an incredibly small package. It can detect objects from 0-inches to 254-inches (6.45-meters) and provides sonar range information from 6-inches out to 254-inches with 1-inch resolution. (Objects from 0 inches to 6-inches range as 6-inches.) The interface output formats included are pulse width output (PWM), analog voltage output (Vcc/512 volts per inch), and serial digital output (9600 baud). A good sensor for when a Sharp IR distance sensor won’t cut it.

Pt 1997
If you’re a pro cut straight to the data sheet – if not, here’s a quick start guide on using the Maxbotix sonar sensor

Things you’ll need:
An Arduino
A half size breadboard
A piezo buzzer
Wires
MaxSonar sensor

All of these are available in the Adafruit store.

Solder it up!
Pt 2002
Solder 3 wires to the Maxbotix sonar sensor. Ground, power and analog. That’s all we’ll need for this simple test, and for the most part if you’re just using this sensor with an Arduino it’s all you’ll likely use.

Wire it up!
Pt 2001
For this example we’re going to use a half size bread board, some wires and a piezo buzzer with the MaxSonar and Arduino.

Run some code!
The MaxSonar EZ1 outputs analog voltage with a scaling factor of (Vcc/512) per inch. A supply of 5V yields ~9.8mV per inch. On the other hand, the Arduino’s analog-to-digital converter (ADC) has a range of 1024, which means each bit is ~4. 9mV. For that reason, to convert the number returned by the ADC to inches, we have to divide by 2.

// using the maxsonar quick start http://www.adafruit.com
// http://www.adafruit.com/index.php?main_page=product_info&cPath=35&products_id=172

int sonarPin = 0; //pin connected to analog out on maxsonar sensor
int piezoPin = 9; 
int inchesAway; 

void setup() {
  pinMode(piezoPin, OUTPUT);

}

void loop() {
  inchesAway = analogRead(sonarPin) /2;
 
  if (inchesAway < 24) { // if something is 24 inches away then make a 1khz sound
    digitalWrite(piezoPin, HIGH);
    delayMicroseconds(500);
    digitalWrite(piezoPin, LOW);
    delayMicroseconds(500);
  }
}

Xposted to Instructables



Adafruit has had paid day off for voting for our team for years, if you need help getting that going for your organization, let us know – we can share how and why we did this as well as the good results. Here are some resources for voting by mail, voting in person, and some NY resources for our NY based teams as well. If there are additional resources to add, please let us know – adafruit.com/vote

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on code.org, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 24,000+ makers on Adafruit’s Discord channels and be part of the community! http://adafru.it/discord

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more https://www.instagram.com/adafruit/

CircuitPython – The easiest way to program microcontrollers – CircuitPython.org


Maker Business — To make it through a tough business cycle, layoffs should be a last resort

Wearables — Rub’n’buff

Electronics — Multimeter Bandwidth – AC Signal

Python for Microcontrollers — Python on Microcontrollers Newsletter: CircuitPython 6 Release Candidate, new hardware & more! #Python #Adafruit #CircuitPython #ElectronicHalloween @micropython @ThePSF

Adafruit IoT Monthly — Matrix Portal, Solar Lawn Sprinkler and more!

Microsoft MakeCode — micro:bit version 2 Announced!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 10/21/2020 Featuring #Adafruit Voice Bonnet for Raspberry Pi – Two Speakers + Two Mics! @adafruit #newproducts

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



2 Comments

  1. hah, I have one of these but never noticed the cross and the jesus-fish printed on the back.

  2. You should link this blog entry from the sensor page on your store if possible. Or, if you did I missed it entirely…

Sorry, the comment form is closed at this time.