|
| 1 | +# Motor and Sensor Control on Arduino Raspberry Pi and ESP |
| 2 | +## tps_GiorgioCitterio_UmbertoColombo_2022_2023 |
| 3 | +<a href="https://github.com/GiorgioCitterio/Motor-and-Sensor-Control-on-Arduino-Raspberry-Pi-and-ESP/blob/main/README.md">README 🇮🇹</a> |
| 4 | + |
| 5 | + |
| 6 | +--- |
| 7 | +### Table of Contents |
| 8 | +- Activity 1: <a href="#serard">Serial Communication on Arduino</a> |
| 9 | +- Activity 2: <a href="#serpy">Serial Communication with Python and Arduino</a> |
| 10 | +- Activity 3: <a href="#isoosi">Communication with ISO/OSI Model Packet</a> |
| 11 | +- Activity 4: <a href="#guisensatt">Sensor/Actuator Control via GUI (Python)</a> |
| 12 | +- Activity 5: <a href="#sensjson">Storing Sensor Data in a JSON File</a> |
| 13 | +- Activity 7: <a href="#websens">Making Sensor Data Available on the Web</a> |
| 14 | +- Activity 8: <a href="#webatt">Motor Control via Web Browser</a> |
| 15 | +- Activity 9: <a href="#initrasp">Installation and Importing Programs on Raspberry Pi</a> |
| 16 | +- Activity 10: <a href="#rf24">Sending Packets via RF24 Radio Module</a> |
| 17 | +- Activity 11: <a href="#sensattrasp">Controlling Motor and Sensor from Raspberry Pi</a> |
| 18 | +- Activity 12: <a href="#mqtt">Using MQTT for IoT Device Communication</a> |
| 19 | +- Activity 13: <a href="#mqttesp">Using MQTT with ESP8266</a> |
| 20 | +- Activity 14: <a href="#alexa">Controlling Sensor and Actuator with Alexa</a> |
| 21 | +- Activity 15: <a href="#ble">Using BLE for Environment Control</a> |
| 22 | +--- |
| 23 | + |
| 24 | +For library installation on [Linux systems](lib.md). |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +# Activity 1: <a name="serard"></a> |
| 29 | + |
| 30 | +**Activity Report 1**: [Serial Communication on Arduino](01_TrasmissioneSerialeArduino/01_TrasmissioneSerialeArduino_Relazione.pdf). |
| 31 | + |
| 32 | +Exploration of serial communication on Arduino. |
| 33 | + |
| 34 | +--- |
| 35 | + |
| 36 | +# Activity 2: <a name="serpy"></a> |
| 37 | + |
| 38 | +**Activity Report 2**: [Serial Communication with Python and Arduino](02_Python-2-Seriale/02_Python_2_Seriale_Relazione.pdf). |
| 39 | + |
| 40 | +Communication between a Python application running on Windows and a sensor (potentiometer) and an actuator (L293D motor) connected to an Arduino. |
| 41 | + |
| 42 | +To communicate with the serial port using Python, the *serial* library is used, which can be installed on Windows with the following command: |
| 43 | +``` |
| 44 | +py -m pip install pyserial |
| 45 | +``` |
| 46 | + |
| 47 | +Official documentation for the [serial library](https://pyserial.readthedocs.io/en/latest/pyserial.html). |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +# Activity 3: <a name="isoosi"></a> |
| 52 | + |
| 53 | +**Activity Report 3**: [Communication with ISO/OSI Model Packet](03_Python-3-Pacchetto_livello_3_7_del%20modello_ISO-OSI_su_seriale/03_Python_3_Pacchetto_livello_3_7_modello_ISOOSI_su_seriale_Relazione.pdf). |
| 54 | + |
| 55 | +Reorganizing the message format exchanged between sensors/actuators and the Python application to work with an RF24 module, which has a payload of 32 bytes. |
| 56 | + |
| 57 | +The *struct* library in Python is used to create these packets. |
| 58 | + |
| 59 | +Official documentation for the [struct library |
| 60 | + |
| 61 | +](https://docs.python.org/3/library/struct.html). |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +# Activity 4: <a name="guisensatt"></a> |
| 66 | + |
| 67 | +**Activity Report 4**: [Sensor/Actuator Control via GUI (Python)](04_Python-4-GUI/04_Python_4_GUI_Relazione.pdf). |
| 68 | + |
| 69 | +Controlling a sensor and actuator through a GUI using Python. Three different programs for the actuator and three for the sensor. |
| 70 | + |
| 71 | +The GUI (Graphical User Interface) is created using the *tkinter* library, which can be installed for most users with the following command: |
| 72 | +``` |
| 73 | +py -m pip install tkinter |
| 74 | +``` |
| 75 | + |
| 76 | +Official documentation for the [tkinter library](https://docs.python.org/3/library/tk.html). |
| 77 | + |
| 78 | +In the latest version of the sensor program, the *matplotlib* library is used to create a graph. It can be installed (on Windows) with the following command: |
| 79 | +``` |
| 80 | +py -m pip install matplotlib |
| 81 | +``` |
| 82 | + |
| 83 | +Official documentation for the [matplotlib library](https://matplotlib.org/). |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +# Activity 5: <a name="sensjson"></a> |
| 88 | + |
| 89 | +**Activity Report 5**: [Storing Sensor Data in a JSON File](05_Python-5-JSON/05_Python_5_JSON_Relazione.pdf). |
| 90 | + |
| 91 | +Storing sensor data received in a JSON file for later use in client/server data exchange. |
| 92 | + |
| 93 | +To write to a JSON file from Python, the *json* library, which is already available in Python, is used. |
| 94 | + |
| 95 | +Official documentation for the [json library](https://docs.python.org/3/library/json.html). |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +# Activity 7: <a name="websens"></a> |
| 100 | + |
| 101 | +**Activity Report 7**: [Making Sensor Data Available on the Web](07_Python-7-Flask/07_Python_7_Flask_Relazione.pdf). |
| 102 | + |
| 103 | +Making sensor data stored in a JSON file available on the web using Flask and tunneling. |
| 104 | + |
| 105 | +To create the web server, the *Flask* library is used, which can be installed (on Windows) with the following command: |
| 106 | +``` |
| 107 | +py -m pip install Flask |
| 108 | +``` |
| 109 | + |
| 110 | +Official documentation for the [Flask library](https://flask.palletsprojects.com/en/2.2.x/). |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +# Activity 8: <a name="webatt"></a> |
| 115 | + |
| 116 | +**Activity Report 8**: [Motor Control via Web Browser](08_Python-8-Form/08_Python_8_Form_Relazione.pdf). |
| 117 | + |
| 118 | +Sending data from a web browser to a Flask application to control the motor. |
| 119 | + |
| 120 | +--- |
| 121 | + |
1 | 122 |
|
0 commit comments