PAC1934 Energy Metering Using Linux® Step 6

Last modified by Microchip on 2023/11/09 09:00

Run PAC1934 Sample Applications

Running the Python Demo Application

Navigate to the Python directory:

# cd ~~/python

Run the Python demo application by executing the command below:

# python demo.py

You should see the output shown in the following screenshot after executing the command above. You should also observe the OLED W Click display the PAC1934 demo logo during initialization.

Initializing demo terminal message

picture of PAC1934

After initialization, your terminal should look like the accompanying screenshot.

terminal after initialization

  • The Python demo uses VT Commands to manipulate the cursor position on the terminal
  • If you encounter an issue where the terminal output looks jumbled, try maximizing the terminal window and/or the VirtualBox window on your host machine
Press the USER button on the SOM1-EK to change the PAC1934 channel displayed on the OLED W Click.
To end the demo, press Ctrl+C.

Running the C Demo Application

Run the C demo application by executing the command below:

# /root/pac193x_sample_application

You should see the output shown in the following screenshot after executing the command above. You should also observe the OLED W Click display the PAC1934 demo logo during initialization.

Initializing demo terminal message

picture of PAC1934

After initialization of the C demo application, your terminal should look like the accompanying screenshot.

terminal after initialization

  • The C demo also uses VT Commands to manipulate the cursor position on the terminal
  • If you encounter an issue where the terminal output looks jumbled, try maximizing the terminal window and/or the VirtualBox window on your host machine

The OLED W Click display should look like the picture below:

OLED W Click

Press the USER button to change the PAC1934 channel displayed on the OLED W Click.
To end the demo, press Ctrl+C.

Conclusions

This tutorial provided you with training for configuring a PAC1934 Integrated Circuit (IC) to continuously monitor key meter parameters using the PAC1934 Linux® driver in an embedded Linux host. As a next step, you may customize the project to reconfigure the resistor values and display different measurements. The PAC1934 IC is capable of handling up to 32V Vbus voltage and +/- 100 mV differential voltage range. You can also investigate the Application Programming Interfaces (APIs) available in the project source files to add functionality from the sample applications to your own application.

Learn More