Serial Communication

Why Serial:

    • Serial communication is a fast way of transmitting data across two different boards.

    • We used Serial communication in our project for sending various values between the MegaPi and the Raspberry Pi.

    • It is a very important concept because it allows for all sorts of interactions between the two boards that could not be accomplished with only one board.

How Serial is Being Used:

    • Being able to send values back and forth from the MegaPi to the Raspberry Pi or vice versa, we were able to control our motors using the Raspberry Pi by sending over the motor values to the MegaPi and having it (the MegaPi) run the motors using the values it received.

    • We also used Serial communication as a form of timing. This was done by using a simple loop to wait until a message was received, then the program could continue.

Serial Communication and Motor Control:

  • The main reason we decided to use Serial communication was because the Raspberry Pi could not directly control the motors, they were only controlled by the MegaPi, but using Serial to send motor values to the MegaPi, the Raspberry Pi can practically control motor speeds directly.

  • This played an integral role in our project because line following relied heavily on precision and control, so being able to give commands directly from the Pi, which was running the line following algorithm, made it possible for this goal to be achieved.

Raspberry Pi MegaPi