I want to control an arduino system with raspberry Pi

Hi,
I've been working on a watering system using arduino. It is already programmed and ready to work, but one guy suggested me to connect it to a raspberry pi so I could monitorize and make some changes in the arduino's code (such as the time it starts watering, the moisture level, etc.) via wifi.
I've never used any raspberry pi, but I want to try it. So I have some questions to start it:
1- What raspberry pi model and other components should I buy?
2- Is it even possible to change the code of the arduino via wifi by the raspberry pi?
3- Is there an app or website I can use to control the raspberry pi to do those things or do I have to start the website/app by 0?
I would be very helpful of anyone could answer me any of these questions.
I'm new to this forum so if I'm in the wrong topic or anything tell me I'll change.
Thank you for your atention!

Why keep the Arduino if you're going to hook up a much more powerful controller to it? Might as well migrate all the code to the Raspberry then. Or alternatively an ESP32S, which seems to be just about perfect for the task and can be programmed more or less like an Arduino.

1 Like

You wrote the code, so this is within your control. But you don't change the code, you write code that changes and uses parameters (usually stored in EEPROM).

1 Like

Because I've done everything in the arduino already so I wanted to use it, but maybe it is better if I migrate all the code as you say. I can give it a try. Thank you

Okay thank you!

Yeah, I get that. But think of it this way - on the one hand, you can always re-use your Arduino for future projects. On the other hand, if you're going to keep using the Arduino and interface it with a Raspberry (or ESP8266/32 or some other WiFi-enabled board/module), then you'll also have the challenge of interfacing two controller boards together. Usually it's simpler and more reliable to just stick to one controller that does it all.
Not saying that the Raspberry-added-to-an-Arduino route wouldn't work...it can work perfectly well. But it's a roundabout way of doing it.

1 Like

Okay I get it. I'll take it into consideration. Thank you so much!

Disclaimer… this is my product,
What you want is completely possible in an 8-bit AVR processor.

But electrically is basically an 8-bit Arduino on steroids.

www.SL4P.net

I’ll probably be moving it to a PiZeroW in the coming year (with a number of enhancements).

1 Like

You do not change code in a finished system. You write the interface to alter the parameters stored in EEPROM/ flash.

When you refer to watering times, how are you actually keeping time? Presumably with a RTC?

In regard to using a Pi, what exactly did you propose to do with it? Did you want to use it as the human interface, with a video monitor, mouse and optional keyboard?

If OTOH you merely imagined to use it as an Internet interface, it is quite unnecessary. An ESP8266 module (cheap) will do that as well as run the watering system. You can use port expanders if you need more I/O, it is as has been explained, unnecessarily complicating things to have to interface two processors.

And once you provide Internet access, you can use that instead of a RTC for scheduling times.

1 Like

I have 12 ESP32's doing various tasks around the property. The ESP's connect to a MQTT Broker which is being run on a RPi. Also, running on the RPi is a Python program that interfaces the ESP32's to my web site. Through my web site I can manipulate the operations of the ESP32's.

I have a ESP32 in my backyard doing the weather station thing.

It would be a waste of resources to put a RPi in the backyard protected from the weather and running 24/7 on battery/solar.

1 Like

Yours is a very nice product, but it looks like a 4G connection to me, whereas OP seems to intend to use WiFi. As several of us have remarked by now, a simple and very cheap ESP module will do just fine for him, and at less than 5% of the total cost of your solution.

1 Like

There are legitimate reasons to do this. Non real-time operating systems such as Linux are pretty awful at timing in the tens of ms range, and below that is just not possible.

I'm not sure if that's the case here, but I guess we'll find out.

1 Like

Sure, but again: it doesn't have to be a Raspberry. Something like an ESP is more cost effective and offers excellent timing, just as good (or better) as an Arduino.

1 Like

Agreed, it was intended to show that a lot can be done with a single AVR core.

Thanks for the tick.

2 Likes

Certainly, no doubt about that!

1 Like

Okay that's true, it might be harder to use both. Then I guess I will just use the arduino with the esp 8266 or just the raspberry. I think I will do the first one even if it is less powerful because I already have everything on arduino and I never used a raspberry so I would have to learn the basics first. Thank you for your help!

Okay that's probably what I'm gonna use. Thank you for the help!

@lastchancename Your product seems very interesting. I'll take a look at that. Although, I never used anything besides arduino or more complex than arduino, so your product may be a little bit to complex for me for now. I'll look at it even though. Thank you for the suggestion! Good luck with your product!!

1 Like

@Idahowalker I think my situation is a little bit different. I will only use one system doing one task with the esp8266, so maybe using a raspberry pi wouldn't be worth it here. I will look into it. Thank you!

@nicolajna What I want to do is something simple that doesn't need to be much powerful. What I realised from other answers is that maybe the arduino and the esp8266 is enough here, even because I never used a raspberry-pi. But thank you for your help!