Connect with us

Which microcontroller should I use for a project I'm working with?

Discussion in 'Microcontrollers, Programming and IoT' started by Kanecillo, Sep 23, 2021.

Scroll to continue with content
  1. Kanecillo


    Sep 23, 2021
    A family company where I’m volunteering is developing a laboratory station. I need to choose a microcontroller to control the 4 electronic components that this station has, Should I aim for Arduino or Raspberry Pi?

    Below is the description of the electronic components:
    1. 4x Actuators for electrical height adjustment of the transfer station.
    2. 1x EC (electronically commuted) centrifugal module fan, the speed will be adjusted via Pulse width module (this exhaust motor sucks the air from the room)
    3. 1x Stepper motor NEMA 17 or 23: The stepper motor mechanism will be responsible for raising and lowering the polycarbonate transparent protector
    4. 2x LED strip lights for illuminating the work area.
    5. 1x Touchscreen. This one will display a menu with all the different options, such as:
    Turn on/off the lights
    Turn on/off the EC centrifugal fan
    Raise/lower the polycarbonate protector
    Raise/lower the actuators
    The information screen option displays the total time station has been on.
    6. Airflow reading sensor. This one detects the quantity of airflow and sends the order to adjust the FAN power (by increasing the volts) in order to reach the targeted airflow.
    Fan 0-10V. As time passes, the HEPA filter loses its properties, so from 1V, we need to gradually increase volts up to 10V so we reach the 80m/s (targeted flow).

    Once the microcontroller has been chosen, which are the next steps? Perhaps, the design of the wiring diagram and code? Any help on how to approach this would be much appreciated.

  2. Bluejets


    Oct 5, 2014
    When you start writing your code for each operation you will have a better idea of memory size and speed requirements etc.
  3. Harald Kapp

    Harald Kapp Moderator Moderator

    Nov 17, 2011
    There are many ways to approach such a problem.
    I would do it this way, but that doesn't imply that it is the only or the "correct" way:
    • Design the system with all known components, treating the controller as a black box. This will give you a clear idea of the number and types of I/O pins or interfaces (SPI, I²C, parallel, ...) you will need.
    • Know your timing requirements.
      Do you require fast realtime response? Then a bare metal controller like an Arduino is better suited than a controller with a no-realtime OS like the raspberry Pi. That doesn't necessarily exclude the Raspberry Pi, if your timing requirements are not very strict (give or take a millisecond between sensor input and actuator output), even a non-realtome based controller (Raspberry Pi) may be fast enough to comply with your timing requirements.
    • Know your monetary budget:
      prize(Arduino) << prize(Raspberry Pi)
    • Check which interface components (modules) are required to interface the controller and the I/O (sensors, actuators etc.) and which of these are available for your platform (Arduino Raspberry). Availability of interface modules is not a limiting factor if you are willing and able to build your own interface hardware if required.
    • Estimate the amount of code you will need. This is the tricky part. Looking at code snippets from examples for the different components used can be helpful. Usually you will use libraries for each component (sensor, actuator, display, ...) and each library comes with examples which can give you an idea of the code size required for that component.
    You should now be able to select a controller.
    Given the difference in prize between an Arduino and a Raspberry Pi you could start with the Arduino and switch to an Raspberry if necessary (code size, operating speed, whatever makes the switch necessary).

    Do not forget other alternatives. Arduino and Raspberry Pi are common but these are not the only controllers suitable for such purposes. Have a look also at the lower cost Raspberry variants like Raspberry Pi Zero, Raspberry Pico, at STM32 based modules etc. Should you need WiFi connectivity, the ESP32 series of controllers (available as modules, too) may be a good choice.
  4. Kanecillo


    Sep 23, 2021
    Hello @Harald Kapp , really appreciate your answer. Certainly, this project is quite challenging for me, I've worked with Arduino and PLC before so I know the basics but this project requires a higher level of expertise. Since this product will eventually be in the market I'm thinking of using PLC instead, I just need to refresh all the knowledge I acquired on PLC during university and hopefully I'll be able to determine which modules to use and how to tackle this... Any recommendation on where to start from If I decide to use a PLC?
  5. Bluejets


    Oct 5, 2014
    That will need quite a lot of different interface modules on top of plc unit.
    Micros can handle all that you mentioned and more than likely at a much less cost.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day