Serial Interface Using Python Software

A. Robson Benjamin is associate professor of Physics at American College, Madurai, Tamil Nadu. His interests include design and development of USB based data acquisition and automation of electronic gadgets

8344
 

Testing procedure

To test the project, follow the steps given below:

Step 1. Install all required software including Python2.5, Win32 Python, pyserial-2.2, matplotlib-0.91 and numpy-1.0.4 on your Windows 7 operating system.

Step 2. Power on the board (GND, 5V, 12V) and connect it to the computer through serial COM port. If physical 9-pin serial COM port is not available, use a serial-to-USB converter.

Step 3. The physical or enumerated COM port number that appears in Device Manager should be written in max5154.py script (self.fd = serial.Serial(‘//./COM18’, 115200, stopbits=1, parity=serial.PARITY_NONE))

Step 4. Place efypython and max5154 Python programs in python25 folder (under C drive), where the microcontroller is already programmed.

Step 5. Open PythonWin IDE.

Step 6. Open efypython program from pythonWin IDE. It should be in Python25 folder. Run the program using Run from Menu bar.

Step 7. If Python script is running, wait for a minute. The program will start showing the current and voltage values on the screen. Once measurement is over, the graph is displayed automatically. You will get the output screen as shown in Fig. 7.

I-V characteristic curve of BC107 transistor
Fig. 7: I-V characteristic curve of BC107 transistor

The data acquisition system using Python interface can be used as a starting point for interfacing any gadget with suitable modifications. The interactive nature of Python software makes it more user friendly as compared to other visual languages.

Download PCB and component layout PDFs: click here

Download source code


 

4 COMMENTS

    • This project was designed for PIC18F4620 microcontroller. However, you can use an equivalent PIC microcontroller. You can also use other microcontrollers for the same application but for that, the circuit, the code, and libraries will be different.

SHARE YOUR THOUGHTS & COMMENTS

Please enter your comment!
Please enter your name here