Go Down

Topic: interfacing 4 HCSR04 sensors with arduino (Read 2570 times) previous topic - next topic


Hello. i have 4 sensors that i want to use to make a bigger version of this:

Where can i get a 4 sensor template for this kind of set up?

I already have the motors wheels, the arduino uno, batteries, speed controllers (using servo library and they work) and im waiting on the body.

i already made a smaller one to start me into this:

and im testing a 2 sensor template and i will see how i will go.
Any advice? Thank you very much  :smiley-mr-green:


What you need is the NewPing library.  It's designed for multiple sensors and being used in a complex system where it doesn't slow things down.  I include an example sketch that controls 15 sensors, so your 4 sensors is a cinch.

My hardware: Arduino, Teensy 2.0, Teensy 3.2 & custom ATmega328
My libraries: NewPing, LCDBitmap, toneAC, toneAC2, NewTone, TimerFreeTone
My Projects: https://dogblocker.com & https://baconorbeer.com
My beer: Great Lakes Brewing Co. Lake Erie Monster


You sir are a genius i downloaded it ages ago but i had completely forgotten. thank you so much again.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131