Skip to content
hombregula edited this page Jul 4, 2015 · 1 revision

Welcome to the arduino_2_pythonconsole_-_excel_communication wiki!

This project is used to establish a serial communication between an Arduino and an Excel workbook, and between an Arduino and a Python console.

With this communication the Excel and the Python console will send signals to the Arduino board to switch On/Off an RGB Led with three colours and to switch On/Off a couple of potentiometers. In the other hand, the Arduino board will read these potentiometers (a rotational potentiometer and a lineal potentiometer) and will send its values to the Excel or to the console.

The Arduino script is the same for the communication between the Excel and between the Python console. The code is in its corresponding folder, 01-Arduino_Script.

The python script is in 03-Python_Script. With the Python console, you have to execute different functions of a class to Turn On/Off the different colour of the RBG Led and to read the potentiometers. If you move a potentiometer, it will be showed in the console the new value of the potentiometer position.

When you call the class “connexion_serial”, it is required to indicate the number of characters that the script have to take every time it reads the buffer.

For the Python communication, it was used the library serial.

For the Excel communication you have to take the workbook which is in 02-Excel_and_VBAcode. To see the code, open the Excel and press Alt+F11.

The Excel has buttons to switch on/off the Led, and to change its colour. There are also buttons to switch On/Off the potentiometers, and if the position of any potentiometer changes, the new value will be plotted in the charts of the Excel.

To establish the serial connection with Excel it is required to install NETCommOCX.

You can see on YouTube how it works: https://www.youtube.com/watch?v=MYDMlqjnaNg

Clone this wiki locally