Blog Post

Intruder Alert! ...Or, Welcome?

888

The mindsensors Grove Sensor Adapter makes it easy to use a variety of unique Grove sensors with the EV3. Our custom block makes it easy to read the sensor from your program. Here is an example of using it with the Grove motion sensor.

The Grove motion sensor is a very cool device with a wide range of applications. You can use it to trigger an intruder alert! Or you could have a robot say "hi" and wave when it sees someone. We'll take the more friendly approach today.

To start off this project our robot is simply a mount for the EV3 with the Grove Sensor Adapter connected to port 1, and the PIR Motion Sensor connected to that. Here is a simple program that will play a sound when it sees someone.

To make things more interesting, we can add a Display block to show our helpful fairy friend on-screen. With just one more block we could also light an LED when someone is detected, using another Grove Sensor Adapter and the LED Socket Kit.

A bit more will let us add an animation to show the character flapping up and down. Here we add a loop that runs alongside the sounds. The loop will draw the image with a y of -3, wait half a second, then do the same with y = 3. Because the Clean Screen input is set to True, the image will appear to bob up and down. At the same time, the sounds will play, then wait an additional three seconds. Once that finishes we use a Loop Interrupt block. Notice how the animation loop is set to run Unlimited? Three seconds after the sounds play, this will stop the loop. You can name loops by clicking the "01" label at the top. Finally, the screen will be reset once the animation finishes.

We hope you enjoyed this idea for a project. There are so many more robots possible with the Grove PIR Motion Sensor and mindsensors.com Grove Sensor Adapter. Look at the main blog page to contact us and submit your own project!

Downloads

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

Comments (2)

Allen M 05.05.2017
OK Seth, it's all your fault.This is the post that got me started buying Grove sensors and now you keep adding more really great posts. I keep going through the list of Grove sensors thinking about which ones to buy next.This is the first one that I wanted to get and I did add an LED Socket kit to mine too. I used a green LED that is normally on signaling that it's ready and armed. Then when someone is detected, the LED goes off and a sound file plays. I couldn't decide which way to go though - at first, I had a smiling face display and it said "Hello" and now I have it display a mouth with teeth and it plays a dog's bark. I think I like the second one better though.I'm doing all of my projects on my NXT though. I have an EV3, but I haven't really used it because I can't use all of my NXT sensors with it. I was thinking about posting mine on the blog, but my projects aren't as complicated as yours are - just simple little tests of the sensors, Buzzer, LED's, Relay, etc.
Seth T 05.05.2017
Your projects don't have to be huge, just anything interesting you want to share with the LEGO robotics community! I actually didn't think this project was the best idea, but it turned out pretty well! Using some graphics and sound made it fun, and gave me an opportunity walk you through a few more interesting programs. Enjoy your Grove output modules!
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: