0

I am new to RasPi, I need help on how to have arduino communicate with Pi. So basically I want arduino to send message("TAKE A PICTURE") to Pi3. On receiving the message the Pi3 should take Picture using a noircam. The communication could be either though GPIO pins or USB connection. Thanks in advance

3

It depend on what your programming skills are. I'll go with python and pyserial and picamera. It'll work both for usb and gpio serial.

Basic code will be create a python script that start at reboot using crontab. That script will wait for a serial input from the serial port and read whatever comes. If the message is "TAKE A PICTURE" then, run code to take a picture using picamera.

In arduino, you'll need to create a sketch that send the message at certain event. It could be time based, user input, or sensor input.

You can get rid of the arduino anyways and handle everything from the pi. If you want to take the picture when some event happend, like reading from a sensor is a certain value, you can read those from the pi itself.

  • Thanks for your response. My project is actually about visible light communication; How it works Use arduino UNo as a transmitter and another arduino Uno as a receiver When the light communication between transmitter and receiver is disturbed a buzzer will go off. Then the arduino on the receiving end sends a message to pi to take a a picture of whatever is causing the visible light communication disturbance – Kayvee Sep 25 '17 at 13:23
  • Thanks for your response. My project is actually about visible light communication; How it works Use arduino UNo as a transmitter and another arduino Uno as a receiver When the light communication between transmitter and receiver is disturbed a buzzer will go off. Then the arduino on the receiving end sends a message to pi to take a a picture of whatever is causing the visible light communication disturbance I am done with the code for the visible light communication between the two arduinos and the codes of sending from arduino to Pi, my only problem is putting them together – Kayvee Sep 25 '17 at 13:31
  • In that case, the easiest way to do it's that the receiver is the pi itself, or use a serial interface to talk from the Arduino receiver to the pi. In the pi, read the serial (ie using python and pyserial) and then use picamera to take the picture. – Luis Diaz Sep 25 '17 at 13:34
  • alright. The part where you say I can use a pi as a receiver intrigues me. Can you please share side where I can learn to do that please. – Kayvee Sep 26 '17 at 16:27
  • What are you using for receiving the light? If you're using an analog sensor, you'll need a ADC (analog to digital converter) since the pi doesn't have an on board ADC (only digital). The way that I'd do it, is with a python script that mimics the arduino receiver data and then add the camera stuff. – Luis Diaz Sep 27 '17 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.