It is too much complicated question in present day. Raspberry Pi and Arduino compatible microcontrollers are quite different things. Raspberry Pi is a professional grade single board computer. So we can use programming langugage quite similar to programming a desktop computer or server. When we say Arduino Compatible, then we mean the microcontrollers, SoC which has some way to use with Arduino IDE, like ESP32. Arduino/microcontrollers are best for monitoring the physical values like temperature, pressure, humidity, wind, NO2, control servo, actuators, relay. Usually, they are easier to find for Arduino and cheap. These are analog inputs and outputs as well as PWM functions. Raspberry Pi not for these works. Microcontrollers (like Arduino, ESP32) are also inferior for camera, graphics.
In our article on CircuitPython vs C/C++ vs Lua for the Microcontrollers article we probably could clarify present situation with the microcontrollers. We can configure them to run micro python, circuit python etc. But whenever you will incline towards Node.js to include complex web API, like IBM Wastson Visual Recognition with ESP32, you will realize that Arduino “langugage” has limitations, indeed C++ is not perfect for the work and CircuitPython, Node.js on present microcontrollers has limitations.
BeagleBone has analog inputs and outputs as well as PWM to drive motors etc. However, Beaglebone or Raspberry Pi draw significant power, making them desktop not portable, and generally you will have the burden of whole operating system – you simply can not unplug to stop but have to shutdown, bootstrap to start.
These days few microcontroller vendors have gotten better at building IDEs. But either they are less available or has less user. If you want to program Python, node.js or C++ on a powerful tiny computer, BeagleBone Black Wireless is a good option. Cypress PSoC 6 is a great thing.
We talked about FPGA (Field-Programmable Gate Array) of Arduino MKR series. Looking at them, the future of microcontroller appears to be highly complex.
As to come to conclusion, sadly cost becomes big deciding factor. Raspberry Pi actually good for the complex projects whereas Arduino compatible microcontrollers are good for the I/O, PWM and low battery consumption. The kind of hybrid of the two class although has board but not became popular. Probably like the others you’ll also end up buying different microcontrollers. ESP32 appeared to us as cheap, cost effective powerhouse. Do not leave it till you reach it’s hardware limitation. Do not step to Raspberry Pi for simple projects to make coding work easy.
Tjbot, as example would be great if could run by microcontroller. But we need standard langugage and g