1

I am making my baby-steps using raspberrypi. I am stuck in something.

I am building a device that combine arduinà with raspberrypi. There are some sensors connected to arduino and others to Raspa (mainly related to my budget).

Let's say that I use temperature sensor+LED with arduino and camera with raspberrypi. My question is, How can I make the main program so when it's under 0 the led is blinking and if it's above, it shoots a picture every-hour.

The question here is not asking how to write the program, but more where can I write it. Should I write raspberrypi as a main program to ask arduino (via PySerial), or should I use arduino and send commands from arduino to raspberrypi. What is the main program that should be running 24hr in the sensor.

Eg: When using arduino alone, uploading a sketch on arduino makes the program running 24hr. How this logic work when we combine arduino with raspberrypi.

1
  • 1
    This is not really an answerable question, as the "problem" is undefined. You will find many projects combining Raspberry Pi and Arduino. In general the Pi has more processing power, and memory, so is the logical to use the Pi as master. How close are the devices? If adjacent you can use serial, SPI or I²C protocols. Do you require 24 hour operation? Do you need to store data? There are other issues which I would define before trying to develop a solution.
    – Milliways
    Feb 13, 2015 at 6:15

3 Answers 3

2

In general, 'do things where the sensor is' .. so if the camera is on the PI, use the Pi to take and send photos.

If the 'trigger' is on the Adruino, then have that 'ask' the Pi to take the photo ...

1

I would be inclined to use a plain old USB serial connection, and use the Raspberry PI as the master.

By sending the serial temperature data from the Arduino to the PI, you can do the following:

  • Capture photos according to your own logic
  • Manage the captured photos
  • Log data stream to a file on the PI
  • expand into image processing if you find a case for it
  • Program all of this in your favorite language on the PI

The PI will prove a more extensible platform from a software standpoint, so if you are committed to it, you should leverage its strengths and focus most of your development effort there.

0

I've done a lot of projects with both platforms, and "most" sensors now work on the Raspberry Pi and Arduino i.e. DHT temp sensors, GPS modules etc.

One thing to be careful of if you're interfacing the voltage from an Arduino is the protection (or lack there of) on the Raspberry Pi GPIO.

One new product I've been having great luck with is the ExplorerHat Pro. It adds some protection to the GPIO input and gives you a few other nice interfaces including motor drivers.

Explorer HAT from Pimoroni

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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