# How can I upload python code to a module that can talk to many arduino boards?

**URL:** <https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983>\
**Category:** General Guidance\
**Created:** [October 24, 2026, 8:35am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983 "2026-10-24T08:35:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 8:35am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/1 "2026-10-24T08:35:33Z")

</div>

Im making a project thatll use many boards to communicate to many parts. Im doing this because I have like 15 IR break beam sensors and like 8 dc motors to control.  
Thankfully I have 3 boards (uno r4 wifi, uno r3, elegoo r3). I have seen that you can control these boards via serial ports, and with them you can use python. I cannot find though what module I can use where it runs the python code, and can send serial signals (even one port would be sufficent with clever port usage).  
Also, I would not want to buy another board, since Im already so deep in my budget.

Any help would be appriciated!

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 8:39am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/2 "2026-10-24T08:39:14Z")

</div>

> [@derpyspy](#):
>
> Im doing this because I have like 15 IR break beam sensors and like 8 dc motors to control.

You only need one Arduino for that. Can you tell us why do you plan to use so many?

Also how do you need to control these motors? Do you need to change the speed and direction of each motor, or only switch them on/off?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 8:40am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/3 "2026-10-24T08:40:52Z")

</div>

> [@derpyspy](#):
>
> I have 3 boards (uno r4 wifi, uno r3, elegoo r3). I have seen that you can control these boards via serial ports, and with them you can use python.

R4 may be able to run python, code, I'm not sure. R3 cannot.

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 8:40am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/4 "2026-10-24T08:40:55Z")

</div>

Its a big project with lots of moving parts

I have a dual motor driver for each pair of motors, since I need to control their speed.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 8:42am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/5 "2026-10-24T08:42:11Z")

</div>

> [@derpyspy](#):
>
> Its a big project with lots of moving parts

Ok, but why make it more difficult but using many Arduino when only one is needed?

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [October 24, 2026, 8:43am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/6 "2026-10-24T08:43:49Z")

</div>

> [@derpyspy](#):
>
> I have seen that you can control these boards via serial ports, and with them you can use python.

Serial ports and python are independent of each other. Your R3 boards will definitely not run python code, they run machine code; I also don't think that the R4 can run python code (never heard of it but that dos not mean it can't do it).

If you want to use Python as the programming language you should look for boards that support CircuitPython or MicroPython.

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 8:44am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/7 "2026-10-24T08:44:54Z")

</div>

its just the amount of ports, each motor needs 2-3 ports, and with 8 seperate motors. And maybe I can fit all IR BB sensors in one row of analog inputs. But overall, I think it would be useful for me to have it afterwards for more projects.

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 8:47am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/8 "2026-10-24T08:47:10Z")

</div>

I meant the python code can send strings to serial ports, and those boards can read the strings and do stuff based on the string.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 8:51am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/9 "2026-10-24T08:51:34Z")

</div>

Believing that if you need more I/o pins must mean having to use multiple Arduino is a common beginner misconception.

Using multiple Arduino in a project for a beginner is a recipe for failure. Beginners underestimate the additional difficulty of getting separate code on separate Arduino to communicate and cooperate correctly. You are much more likely to succeed with a single code running on a single Arduino.

To get more pins, there several ways, such as using shift registers, multiplexers and I/o extenders.

If you can describe your project, the forum can suggest suitable solutions.

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 8:54am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/10 "2026-10-24T08:54:16Z")

</div>

Okay yeah I have no idea what those are, what parts do I have to describe?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 9:00am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/11 "2026-10-24T09:00:00Z")

</div>

I mean you have to describe your project. What is it doing? Why are 8 motors and 15 sensors needed?

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 9:06am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/12 "2026-10-24T09:06:24Z")

</div>

Well the project is basically three parts.  
The first part is a slot machine that uses 5 motors to spin 5 disks. When one disk is stopped, the rest speed up. When all 5 are stopped, it gives a number out based on what face you got.

The second part is a plinko machine. The machine will drop the amount of balls that you got as your number in the first part. At each hole at the bottom, will be a break beam sensor to detect a ball passing through. Another motor is then used to get the balls back to the top.

The third part is the reward system. Based on what you got in the plinko section, It will dispense that amount of candy using an archimedes screw. It will also use another break beam sensor to detect if the correct amount or more was dispensed.

Is that enough?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 9:15am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/13 "2026-10-24T09:15:37Z")

</div>

Ok. Some additional detail but more is needed.

You mentioned only 7 motors so far, I think. 5 for the spinning disks. I guess you need to control the speed of these disks. But do you need to control the direction, or will they always spin in the same direction? The other two, for the plinko ball return and the dispensing screw, don't seem to need either speed or direction control, just on/off, is that correct?

For the beam break sensors, you mentioned one for the dispensing mechanism. The remaining 14 are for the plinko game?

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 9:17am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/14 "2026-10-24T09:17:55Z")

</div>

> [@derpyspy](#):
>
> The machine will drop the amount of balls that you got as your number in the first part.

How will this part work? How will the Arduino know what numbers were shown by the disks, and how will it dispense the balls?

Some diagrams would be helpful!

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [October 24, 2026, 9:20am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/15 "2026-10-24T09:20:12Z")

</div>

> [@derpyspy](#):
>
> I meant the python code can send strings to serial ports, and those boards can read the strings and do stuff based on the string.

Sorry for my misunderstanding and thanks for your clarification. Where does the "upload" in your title come into play?

> [@derpyspy](#):
>
> cannot find though what module I can use

What do you mean by module?

* * *

There are a few articles on this forum

1. [Serial Input Basics - updated](https://forum.arduino.cc/t/serial-input-basics-updated/382007)  
There seems to be a matching post by robin2 for python but I could not quickly find it.
2. [Two ways communication between Python3 and Arduino](https://forum.arduino.cc/t/two-ways-communication-between-python3-and-arduino/1219738)

I've also seen a library somewhere for this, not sure anymore who wrote it so I can't look for it.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 9:20am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/16 "2026-10-24T09:20:34Z")

</div>

It sounds like a very quirky and interesting project, by the way! 😄

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 9:20am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/17 "2026-10-24T09:20:35Z")

</div>

I was more or less estimating. The last motor is if the one dispensing motor cant dispense fast enough without destroying the candy, and I rembered the sensor count wrong, I ordered 15 but Im using only like 12-13.

its true though that I can just wire the two motors directly.

The idea for now, Is that behind each face is a different colored film, and in the middle sits a rgb color detector.

Since I am absolute ass at this stuff atm, I don't even know how to make a diagram (for context I do not have a degree in anything, fully self taught)

---

<div class="post-metadata">

**Author:** ![derpyspy](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/derpyspy/32/1282708_2.png) [@derpyspy](https://forum.arduino.cc/u/derpyspy)\
**Post date:** [October 24, 2026, 9:22am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/18 "2026-10-24T09:22:06Z")

</div>

I wasnt sure what it was, since my only good look at the thing was in a random Michael reeves video, and I forgot which one. Its very likely Im describing a thing that doesnt exist.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 9:27am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/19 "2026-10-24T09:27:27Z")

</div>

> [@derpyspy](#):
>
> I can just wire the two motors directly

If you mean directly to Arduino pins, absolutely not. You will still need those motor drivers. But if you don't need to control the direction, then a single H-bridge motor driver can control 2 motors. If you don't need speed control for all your motors, then you don't need as many PWM pins, you can use ordinary digital output pins for the others. Uno R3 has only 6 PWM pins. More can be added, but if less than 6 are needed, that will make things simpler.

---

<div class="post-metadata">

**Author:** ![PaulRB](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paulrb/32/216330_2.png) [@PaulRB](https://forum.arduino.cc/u/PaulRB)\
**Post date:** [October 24, 2026, 9:33am UTC](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983/20 "2026-10-24T09:33:02Z")

</div>

> [@derpyspy](#):
>
> rgb color detector.

5 of these? Please post a link to the specs of these sensors.

> [@derpyspy](#):
>
> I have a dual motor driver for each pair of motors

And to these motors drivers please.

[Next page](https://forum.arduino.cc/t/how-can-i-upload-python-code-to-a-module-that-can-talk-to-many-arduino-boards/1464983.md?page=2)
