This code was used for the light-bulb demonstration for World Metrology Day 2024.
Three 34401A DMMs are used to measure either AC voltage or AC current for an LED bulb and a Halogen bulb and a web server is used to display the values in real time.
Python (with the py
-Launcher option enabled) and Git.
Run the following commands in a terminal to set up the Python environment
> git clone https://github.com/MSLNZ/pr-wmd-2024.git
> cd pr-wmd-2024
> py -m venv .venv
> .venv\Scripts\activate
> pip install -r requirements.txt
-
Update the
records
dictionary inequipment.py
for the three DMMs that are used, in particular, edit theCOM#
address value. -
Run the following command to start acquiring data and to start the web server
> run.bat
acquire.py
Runs in a loop to send voltage and current values to the web server.equipment.py
Provides communication to a 34401A DMM to either measure voltage or current.webapp.py
Runs a web server to display the voltage and current values in real time.