Current/Voltage/Power Monitor HAT for Raspberry Pi
Jump to navigation
Jump to search
Contents
Introduction
This is current and power monitor HAT designed for Raspberry Pi. Support 4-channel, it is easy to monitor current, voltage, and power consumption, voltage across the sampling resistor via the I2C or SMBus interface.
Model: RPA20901S
Features
- Standard Raspberry Pi 40PIN GPIO extension header, suitable for all Raspberry Pi boards
- Support 4-channel detection, can communicate through I2C/SMBus interface
- Onboard 0.1Ω 1% sampling resistor, allows measuring bi-directional current up to 3.2A
- Embedded 12-bit ADC, supports multiple successive converting, 0~26V voltage measuring range
- The output measurement power can be directly calculated through the additional multiplication register
- I2C control pins for connecting with other main boards easily
Specification
- Operating voltage: 3.3V/5V
- Control interface: I2C/SMBus
- Sampling resistor: 0.1Ω 1%
- Voltage range: 0~26V
- Current range: ±3.2A
- Resolution: 0.8mA (±3.2A range) OR 0.1mA (±400mA range)
- Dimensions: 65mm × 30mm
- Mounting hole size: 3.0mm
Usage
Use with Raspberry Pi
1. Open the I2C interface 1) Execute in the terminal:
udo raspi-config Select Interfacing Options -> I2C -> yes to start the i2C kernel driver
- Step 1. Install the necessary library
1) Install BCM2835, open the Raspberry Pi terminal, and run the following command
HTTP wget : //www.airspayce.com/mikem/bcm2835/bcm2835-1.60.tar.gz zxvf bcm2835 tar - 1.60 . tar . GZ bcm2835 cd - 1.60 / sudo ./ the configure sudo make && sudo make check && sudo make install
2) Update wiringPi to version 2.52
sudo apt - get install wiringpi HTTPS wget : //project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg - i wiringpi - latest . deb gpio - v #You will see gpio version: 2.52, indicating successful installation
3) Install Python library
#python2 sudo apt - get update sudo apt - get install python - pip sudo pip install RPi . GPIO #python3 sudo apt - get update sudo apt - get install python3 - pip sudo pip install RPi . GPIO
- Step 2. Download the sample program
sudo apt - get install p7zip - full HTTP wget : //www.waveshare.net/w/upload/b/b7/PoE_HAT_B_code.7z 7z x PoE_HAT_B_code . 7z - r - o ./ PoE_HAT_B_code
- Step3. Run the test routine
1) C
cd PoE_HAT_B_code / c / make clean make sudo ./ main
2) Python
cd PoE_HAT_B_code / python / sudo python main . py
- Set the fan start temperature
#C Nano examples the sudo / main . C # POE_HAT_Display() The last parameter of the function sets the fan opening temperature #python Nano examples sudo / main . Py # POE.POE_HAT_Display() Function parameter to set the fan opening temperature
- Set boot up
1) Before setting the startup, compile the routine first.
Nano sudo / etc / rc . local
2) Set boot up. Add sudo /home/pi/Fan_HAT/c/main & before exit 0. Note that you must add "&" to run in the background, otherwise the system may not start.
fi sudo / home / pi / PoE_HAT_B_code / c / main & exit 0