Need help for Security System with Arduino UNO, RFID Reader, PIR Sensor, buzzer, and leds

Hi, I wanted to create a security system in which there is an RFID reader that when you swipe the card the green LED goes off, the red one lights up, and when it detects movement it makes the buzzer sound at 1Khz intermittently every second

tone(buzzer, 1000); // Send 1KHz sound signal...
  delay(1000); // ...for 1 sec
  noTone(buzzer); // Stop sound...
  delay(1000); // ...for 1sec

and to return to the previous mode (green led on, red led off and even if there is movement it does not sound) the RFID card must be swiped.
therefore in practice to turn the security system off or on pass the RFID card.

Concerning the 16x2 I2C LCD screen When you swipe the RFID card it gives you "UID: AA AA AA AA
Access Granted"
or "UID: AA AA AA AA
Access Denied"


Could anyone help me with the code?

No. You have to make an attempt, if you want help. Post an entire sketch.

You can drop your request here:

Proceed like this:
Use example code for the display. When it works, add example code for one more device, and make it work......
There are plenty of projects done for all of Your devices but no one exactly like Your project.
Learning and doing it Yourself puts You in a very good position when/if something malfunctions. Else, You have a real problem.

Hi @marcozan,

welcome to the arduino-forum.
When I was reading your description I was asking myself
Is this a rephrased assigment for school / university or not?
Could be but must not be.

Anyway: Your project has a certain complexity because it uses 6 components.
This requires more than just 20 lines of code.

Your question is pretty general.

This question does not specifiy what you see as "help"
This sentence can be interpreted as

  • "please can somebody write the whole code for me?"

  • "can somebody write down a full blown tutorial about all 6 components that I am using?"

  • "can somebody post links to tutorials where I can learn from?"

and a lot of more different ways.

Yor are working on an informatic project. And what is needed most in an informatic project is guess what? information.

So a short answer to your question

Is: Yes we (the other users) can.
The more specific you ask the better the help will be.
user @Railroader has given an example how to start.

To expand a little more on his suggestion
There are example-codes that demonstrate how to get a LC-Display to show characters.
Take such an example-code and try to make it work. Whatever might not work

if you describe:

  • the steps you have taken
  • post the complete demosketch that you used
  • describe what you observed what your arduino / your LCD is doing / is not doing
    and finally add a specific question

you will be helped 101% sure.

best regards Stefan

1 Like

Here you go:
A short, but good, LCD example link.
A short, but good, PIR example link.
A short, but good, LED example link.
How to make your buzzer sing link.
Some sage advice on RFID, plus a folder-full of examples.

Except for the RFID and transistor, you can practice with the devices in your project on the Wokwi platform.

Looking forward to your progress.

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