Guidance on home motioning system

Just after some advice on the best way i should go about this…

I want to monitor and record the following devices that will be connected to an arduino;

Log these everytime an event happens;

  • PIR’s motion
  • Door bell press
  • Front gate opened
  • mail placed in letterbox

Log these every 5 minutes;

  • Temperature sensors
  • wind/rain gauages

Thinking of using arduino with ethernet and just logging the events directly to a mysql database, my reasoning behind logging directly to mysql is that i can then use the data in any form, either for webpage status, easy to add more sensors, analytics or for custom alerts as i can run a script against a MYSQL database easily!

Has anyone else done anything similar? what was your setup and what is your advice ?


Well the first question is how are you going to connect the Arduino to your gate, letterbox, PIR sensors, and weather sensors. Chances are, these are all going to be several dozen feet away from each other, correct? Do you want to run wires through walls/underground or do you want to go wireless?

As for writing to MySQL, check out this thread:,37718.0.html

I did a small subset of your project - monitoring temp and logging it to mysql. Here's a thread with some more detail:,69165.0.html

Most sensors are already there, from previous alarm. The letterbox/gate one is a future project, still debating whether to go wireless + solar for that, running wires is normally not an issue for me and I always prefer hardwired over wireless.

Thx for the mysql links, just wondering if it is a good thing for the PIR sensors though.

If you've got some random PIR hardware that you don't have a datasheet for, you get to reverse engineer the interface. It may be as simple as a pin that goes HIGH when motion is detected, or you might spend the next month decoding a proprietary protocol using an oscilliscope or logic analyzer. Probably easier to buy a new one that comes with documentation.

The doorbell press should be easy, get a relay with a coil that matches your doorbell transformer (typically 16VAC in the US), then connect an Arduino digital pin in INPUT_PULLUP mode and one of the Arduino's GND pins to the NO relay contacts.

As for the weather stuff, look into Dallas One-Wire devices. They're popular and there's even an Arduino library for those.

Have already got the PIR sesnsors working with an arduino, PIR's are off the shelf ones with N/C contacts.

Just need to order a arduino ethernet shield.