Here’s how to make a simple Arduino Mega PIR alarm.
Connect PIR sensor
GND to ground, V+ to pin 53, OUT to pin 51.
Connect speaker
Connect speaker to pin 41 and ground.
GND to ground, V+ to pin 53, OUT to pin 51.
Connect speaker to pin 41 and ground.