Blog Post

Cheer With Me! A Grove Sensor Adapter project

286

The NXT sound sensor enabled some fun projects. Unfortunately it has retired, and the sound sensor has not made a return with the EV3. However, the mindsensors Grove Sensor Adapter has you covered! The Grove sound sensor attaches just as easily as any other Grove sensors, here's an example.

The Grove Sensor Adapter is mounted to the side of the EV3 and connected to sensor port 1. The Grove sound sensor is mounted to EV3 as well, and connected to the other end of the Grove Sensor Adapter. What does this project do? Take a look!

When it detects a clap, the program will cheer along with you! Let's take a look at the simple program.

First it repeatedly reads the Grove sensor until it gets a valid reading. If the sensor is not connected, it will keep checking until it is. Then it compares it too 800, which we found is a good level for indicating a clap. A clap will show the clapping emoji and a cheering sound.

If you want to get a bit more out of it, you can count the number of claps and act accordingly. The example program is available at the end of this article, but we'll take a quick look at the program.

This program is a bit more complicated because it has to distinguish between a repeated clap and a new clap sequence. As before, it waits for a clap. When there is a clap, it adds one to the clap count variable. To make sure it doesn't count the same clap as multiple, it waits for the clap to end. At the end it displays the number on screen.

The last aspect of this program is the timer. Whenever there is a clap, the timer is reset. If the timer ever gets past one second, it determines that you have stopped clapping and sets clap count to zero. This is when you could take action, such as playing a number of notes or moving your robot in a certain way.

Make some noise for the Grove sound sensor! Clapping emoji

Downloads and Links

  • EV3 Block
    EV3 Block
  • EV3 Program
    EV3 Program
  • Grove Sensor Adapter product page
    Product Page
  • Grove Sensor Kit product page
    Grove Sensor Kit

Comments (4)

Allen M 05.05.2017
Hi Seth, another great post! I do have my NXT Sound sensor and was just planning on buying Grove sensors that I didn't have, but I might just change my mind. By the way, you accidentally provided the wrong link for for the EV3 program. When I clicked on it, I got another copy of the EV3 Gas sensor program. Could you fix that? Or, I could just copy the screen images.
Seth T 05.05.2017
Thank you! You're absolutely right, that link should be fixed. P.S.: I tried adding back in the newlines to your comment, but it seems like our system puts everything on one line when displaying it here (it got rid of my emoji, too!). It does show multiple lines in the back end, though. I replaced them with spaces, hope you don't mind.
Allen M 05.12.2017
Hi Seth, thanks for getting the link for downloading the program for the Sound sensor fixed. I just downloaded it. Until I get a chance to buy some more Grove sensors, maybe I can modify the program to work with the NXT Sound sensor. I have the EV3 block for it.
Seth T 05.15.2017
If you do try that, keep in mind the NXT Sound sensor likely has different units and a different range, so you might have to adjust the constant "800" in the comparison blocks. Looks like our friend Builderdude35 has a helpful little guide, too! https://youtu.be/55A5OT71bAc
Please Login to add your comments

Featured Posts

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the...

Read more

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the...

Read more

Poll

  • What do you use to program your FRC Robot?
    Total: