0

I am completely new to Arduinno, so please forgive if the question is stupid.

Here is the problem: I have a project where I want an Arduino (or similar microchip board) to handle some sensors and actuators. But I need very advanced "artificial intelligence" to handle the data provided by those sensors. There are two major obstacles for placing this intelligence on the Arduinno, according to my researches.

  • First, the Arduinno is coded in a language similar to C: I could of course find a way to write the intelligence, but it will be a time-consuming task for the developper
  • Second, I might encounter a problem with memory: I will store heavy matrix of data, do complicated calculation, and this might be too much for an Arduinno
  • Third, I read on stackexchange that there are some ways to compile Python code on Arduinno boards, such as the Arduinno Mega. So I can code this intelligence in Python (which is an easy task), and compile the resulting code on Arduinno. However, I will reach a caveat: some libraries I will use will be entirely compiled, and this will take too much memory on an Arduinno (such as the second issue I mentionned)

So I have another solution, but I am not sure if it is state-fo-the-art, or even a feasible solution: I would like to separate two tasks:

  • Write an Arduinno code to handle the sensors and create numeric data
  • Write a Python code on my computer and compile it as an executable file on my computer
  • Then somehow, I "extract" the processor of my comouter (Intel, by the way) and I plug it on the Arduinno board. The Arduinno sends the data to the processor, and the processor runs permanently the Python file and gives back data

So question:

  • Is it possible overall?
  • Was it ever made?
  • What communication links are good for exchanging data between processor and Arduinno microchip: USB, Serial, Ethernet?
  • How can I handle the input of the processor, so that it collects data from the Arduinno and then uses it in the Python code?
1
  • Get a pi. That should do everything all in one.
    – Majenko
    Commented Dec 23, 2019 at 15:28

4 Answers 4

2

It sounds like you need a lot of compute power. You can either put the sensors and AI on one device (and @majenko's suggestion of a Raspberry Pi would be a direction to pursue) or you need two devices, one to manage the data collection - Arduino, perhaps - and one to do the AI. We don't know enough about your post-processing and AI to make a good recommendation, but, as you already have a PC with Python running on it, an Arduino talking to the PC would be a good start.

You didn't say which Arduino you're considering, but as most people mean "Uno" when the speak of a generic Arduino, I'd just suggest that an Uno is far too under-resourced for the post-processing part of your project, but probably ideal for the data collection. Cross-compiling your Python code for an Uno still doesn't address its processing speed and memory size limitations.

There are, of course, a lot of "Arduino" products, some with considerably more resources, that may approach your needs - I'm thinking of the Arm-based boards, here - but I've no way of evaluating your project needs at that level.

My own first approach would be to use what you have, to start with: an Uno collecting data and sending it to your PC. Once you have something running, you'll understand the needs and issues better and if you still want a stand-alone solution at that point, you'll be much better able to make that choice.

1

I may handle this case like using pyserial library I just log the data to my laptop and then using python to do your Advance AI code part.

  1. Send the sensor data as a combined String via Arduino serial port.
  2. read it using pyserial library
  3. add a data logging mechanism if you need or parallel process the data you gathered serially by cast them to their own data type.

Hope this may help you.

Thank you

4
  • Thank you, I will look out those. A remaining question is: what hardware is needed to run a typical Python script (I don't need the screen of the computer for example, I do need the processor, do I need the GPU?) Commented Dec 23, 2019 at 17:29
  • @totalMongot I think you can try with some ARM type boards like RPis or Odroid XUs. But in the initial setup, you need a GUI However. About direct flashing the python script to Arduino this will help you>>>> arduino.stackexchange.com/questions/49187/…
    – Yana
    Commented Dec 26, 2019 at 2:16
  • Thanks! :) Is it possible to dismantle a computer and take only the core and some USB and serial ports to achieve something similar to the ARM boards, which can communicate with Arduinno? The GUI would be achieved by plugging a computer to the USB port Commented Dec 26, 2019 at 12:20
  • yes write your python code as try except (for safe the flow of your script) and run the python script as a daemon(Similar to starting an application from the startup sequence) so it will always on working on the background. I think this link will help you >>>> instructables.com/id/… "The GUI would be achieved by plugging a computer to the USB port" >> Yeah if there any HMIs or pi display which can able project via USB it's possible.
    – Yana
    Commented Dec 26, 2019 at 15:48
1

For AI use there is the K210 based sipeed maix board. Dual core 400MHz, plus an AI coprocessor.

0

I suggest that you use a different family of processor than the 8-bit AVR chips that are supported by the Arduino IDE (and please fix your spelling errors, all the double-letter words are very distracting). A good example might the the Teensy 3.2 or Teensy 3.6 offered here https://www.pjrc.com/ "Version 3.6 features a 32 bit 180 MHz ARM Cortex-M4 processor with floating point unit" Arduino is programmed in C++, see if your code can be exported in C++ and import it into the IDE for compiling for the selected uC.

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