I want to control an arduino system with raspberry Pi

@Paul_B Yes, I'm using a RTC. I thought of using a Pi because my friend told me that it would maybe easier to connect to the wifi or if I later want to control more little arduino systems at only one place. I realised from the other answers that using wifi to control a Pi to control an arduino isn't worth it and I am not even thinking of having more systems like this in the future (this one isn't for me, I'm making for my grandpa's little farm) so adding just the esp8266 to the arduino would be easier. About replacing the rtc by the internet access, that would be very useful but I would prefer to keep the RTC because the internet could fail sometime. Thank you a lot for your help!!

The friend is apparently not aware of Arduinox and ESP8266. :roll_eyes:

No, "adding" processors makes it difficult. Move to the ESP8266 and if you need more pins, you use a Port Expander.

Really? You mean your internet access could fail sometime when you fail to pay the bill. :grin:

1 Like

@Paul_B Yeah, my friend is more inside the world of raspberry so maybe he is unaware of that.
Are there different types of esp8266? Because the ones I saw, I had to connect them to arduino. It even only had the 8 pins which was intended to connect to arduino. It is something like this https://www.electrofun.pt/espressif/modulo-wifi-esp8266. About the internet, this system is going to be in my grandpa's house and yes he pays the bills :grin: , but it doesn't have a good coverage so sometimes the wifi is kinda weak and it fails sometime, so I didn't want to fully rely on it and since I already have the RTC I'll just let it stay.

They're often sold as 'Arduino modules', but in reality they run stand-alone just as well.
There are indeed many versions of boards/modules with an ESP8266 microcontroller on it . Boards vary in the number of pins broken out, physical size etc. A popular choice is/was NodeMCU (or any of its clones) which is essentially an Arduino-like ESP board.
Btw, I would suggest at this point to skip ESP8266 and go for an ESP32-based board. ESP32(s) is the successor of the 8266 and faster, shinier, fancier etc. Functionally very similar, but as it is in electronics - more feature-rich. It costs roughly the same if you buy directly from East Asia.

1 Like

@koraks yeah but that option would imply me designing a whole new pcb board and order it. With the one(https://www.electrofun.pt/espressif/modulo-wifi-esp8266) I said, I think I only have to connect it to arduino and let the other components connected like they are, being everything in the pcb except for the esp8266.
Is there any module like this (that I only have to connect to arduino) of the esp32?
Maybe it would be more efficient if it was with an esp based board. But is it insanely hard to code it with the arduino and the module I said, justifying designing and ordering a new pcb?
Btw, thank you all a lot for helping me with this mini project!!

Not sure what you were looking at, but in fact, connecting ESP8266s to an Arduino is the last thing you would want to do. The ESP8266 replaces the Arduino, and the Arduino IDE programs it with almost the same sketch code as used for an Arduino - except that you would then add the WiFi code.

So essentially, the procedure to add remote control of your system via WiFi would be to get a suitable ESP board, make any adjustments necessary to your existing code to load it on the ESP, get that working just as it does with an Arduino board , then on a second ESP (because to do serious projects, you do not have just one Arduino or one ESP) you work on the WiFi system to implement a Web page which you can access via the Internet and once having both systems running, you combine the two codes.

I'm not saying this is simple, but of the many ways you could do it, this should be the simplest. You can certainly retain the RTC and it will work just as perfectly with the ESP (and should not require any significant modification of the code) as with the Arduino (hopefully a Nano, not the cumbersome UNO :roll_eyes:). Depending on how many I/O you require which you have not revealed, a single ESP board such as the WeMOS D1 Mini may be sufficient, or you may require a port expander.

My slant on the matter is that it is unlikely that the extra power of the ESP32 is required and that a NodeMCU has no advantage over the cheaper and smaller WeMOS D1 Mini - it has the same number of usable I/O.

1 Like

Okay, I understand your point now. I'll order both (since they are kinda cheap and may always be useful) and I'll start trying them, understanding all the differences and gaining experience with both. Your method here seems the most viable so it is probably how I'm gonna do in the future. Thank you a lot once again for using some of your free time to help me and my mini project, I'm really grateful!! :grinning:

the History of the ESP8266 starts with the ESP8266-01, an 8 pin board.
it was a WiFi module, allowing an Aruino to have a WiFi option like we have today with all sorts of RF modules. but what Expressif did was use a micro-controller.

in the beginning, it was not able to be programmed with the Arduino, but rather it's programming language was LUA.
In that first year, all sorts of people wrote tutorials on how to talk to this marvelous, low cost chip. and you still see dozens of those tutorials around today.

but it was not too long before someone was able to program the chip directly with the Arudino and unleash the speed and huge memory of that device.

it you look at it as a tool, it has it's place.
if you have a project that has board made, sensors are working perfect and all the kinks worked out, and only want to add wifi. it might be worth considering putting in the time to just add it like we do an RF module.

if you are starting, then that path would be silly to follow.

the big Brother, the ESP32 has more ADC pins and higher resolution, but a horrible ADC chip
the ESP32 has about 30 I/O pins. so it has more in every way.

it costs more than twice as much. so, in many ways, it is like the Arduino MEGA.
if you want more pins on-board and don't want external expanders, the ESP32 is a good choice.

if you want more ADC pins on-board, it is a good choice.

My complaint is that the vast majority of the ESP32 boards are different from each other. they move pins around, they hide pins, bring others out, they have different bits on board like battery charger, etc.

I have purchased 2 ESP32 boards, from the same supplier a few months apart and gotten 2 different boards.