Introduction
pytest-analog is a python library / pytest plugin for simple experimentation with electronics and embedded systems.
It is also a great tool for low cost test automation of low power IOT devices.
The library provides an easy to use wrapping layer to perform mulitple measurement and testing workflows utilizing two multifunctional instruments:
Analog Discovery 2, 3
Supported Workflows:
Power measurements:
The ADALM1K two SMU channels (A, B), can power up your project and measure its power consumption simulatenously. the ADALM1K channels cuurent operation ranges from -200 to +200 mA. The voltage range operation is from 0 to 5 V
The Analog Discovery Supplies channels (V+, V-) you can supply both positive and negative voltages with the range of (0.5 V to 5 V , -0.5 V to -5 V) . In the Analog Discovery 3, each supply raile can supply up to 800 mA
Due to ADALM1K (2-quadrant) operation, its two SMU channels (A, B) could be used to source and sink currents ± 200 mA. This could particulaly be useful for testing batteries charge and discharge profiles and DC characterstics of a circuit
Analog Inputs / Outputs:
When configured in high impedance modes, ADALM1K analog channels (A, B) could be used to probe analog signals
The Analog Discovery Supplies channels (V+, V-) you can supply both positive and negative voltages with the range of (0.5 V to 5 V , -0.5 V to -5 V) . In the Analog Discovery 3, each supply raile can supply up to 800 mA
Due to ADALM1K (2-quadrant) operation, its two SMU channels (A, B) could be used to source and sink currents ± 200 mA. This could particularly be useful for testing batteries charge and discharge profiles and DC characteristics of a circuit
Example Setup with Raspberry Pi 5:
To demonstrate a practical application of the pytest-analog plugin, I built a small test setup with the Raspberry Pi 5 acting as a low cost computer.
Below is the list of used hardware and software components for reproducibility:
Hardware
- Raspberry Pi 5 Model as the test station mini PC
- ADALM M1K Board as a mini power supply / source measure unit (SMU)
- Analog Discovery 3 as a USB Oscilloscope, Waveform Generator, Logic Analyzer, and Variable Power Supply
Software
1.Raspbian OS: 12 (bookworm) 64 bit lightweight Linux distribution for ARM architecture
2. Python: 3.11.2 Python interpreter which is shipped as part of Raspbian OS
3. libsmu: 1.0.4 library and python bindings for ADALM1K SMU
4. WaveForms: 3.23.4 GUI application for measurements with Analog Discovery devices
5. Adept: 2.27.9 Runtime library for communication with Analog Discovery devices
6. pytest-analog: 0.2.0 python library / pytest plugin for test automation with the above hardwae
0 comments:
Post a Comment