GCSE engineering

Hey,
I am doing my GCSE engineering coursework and I am trying to write an Arduino code so that when a PIR sensor is activated a speaker plays, I am not able to do it as I don't know how to code
If you could happen that would help me a lot
Thanks

Have you at least looked at the examples in the IDE ?

They will show you how to read an input and control an output based on the state of the input

What hardware are you using for your project ?

Do you have an Arduino, a PIR and a speaker? If so which ones? What sort of thing should the speaker play?

Google "Arduino PIR" and you'll finds lots of examples of a PIR making something happen, usually switching lights on. Find one of those and get it working. Then think about changing it to make sounds.

Steve

slipstick:
Do you have an Arduino, a PIR and a speaker? If so which ones? What sort of thing should the speaker play?

Google "Arduino PIR" and you'll finds lots of examples of a PIR making something happen, usually switching lights on. Find one of those and get it working. Then think about changing it to make sounds.

Steve

Hey,
I've got an Arduino Uno. I've looked at infrared sensors working with lights but I don't know how to convert it to speakers as I haven't coded before. For now a high pitched sound is what I'm looking for.
Thanks

So when you get your Uno working with a PIR and lights post the code that you're using. Then we can help with adding the other part.

To switch a light on you will probably be using a digitalWrite(). For a high pitched sound you basically just need a piezo buzzer and replace the digitalWrite() with a tone() function.

It's not exactly difficult and you did say you were "trying to write an Arduino code" not just get someone else to do all the work for you. I don't need a GCSE, I've got enough of the old O-levels to keep me happy.

Steve

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.