abdjeet wrote:Hello.I am working on a project where I have connected pir motion sensor to arduino uno and connected my webcam to raspberry pi.What I want to do is when motion is detected my webcam should be triggered so that it can capture photo and then send it through email.I am little bit aware that this can be achieved using serial communication but still I need help.
Why not connect the PIR to the Pi GPIO? That's the easiest option.
You can use Arduino and serial communication. Both Pi And Arduino have UART serial, but you should use a voltage level translator to match the Pi 3.3V to Arduino 5V.
On Pi the UART may, by default, be configured as a serial terminal. You would have to disable that in raspi-config. A quick search on raspberry UART should get you there.
Just connect Tx, Rx on the Pi to Rx, Tx on the Arduino, set both devices to same baud rate, data bits, parity and stop bits and use serial in/out function to send and receive messages that you will define. It could be single characters.