WSAL17852 – 2-CH TRIAC HAT/en
Erscheinungsbild
Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.
Summary
The 2-CH TRIAC HAT is a dual-channel bidirectional triac expansion board for Raspberry Pi. It features an integrated STM32F030 MCU and is controlled via UART or I2C. It supports AC voltages of 100–600 V and currents up to 20 A.
Related products at JW Tech
Technical overview
- Board dimensions: 65 × 56.5 mm; operating voltage: 3.3 V / 5 V
- Communication: UART (1200–921600 baud) or I2C (≤1 Mbps)
- Jumper B selects UART, jumper A selects I2C; a DIP switch on the back also allows switching interfaces
- Register 0x01 controls mode: 1 = voltage adjustment via conduction angle, 0 = on/off switch mode
- Register 0x02 enables channels: 3 = both, 2 = channel 2 only, 1 = channel 1 only, 0 = both disabled
- Conduction angle per channel in registers 0x03/0x04, range 0–179°
- Grid frequency set in register 0x05: 0x32 = 50 Hz, 0x3C = 60 Hz
- Baud rate adjustable via register 0x07 (n×100); default restore by shorting RX/SCL–TX/SDA at power-on
Commands and examples – verify before use:
sudo wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
sudo tar zxvf bcm2835-1.71.tar.gz && cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
sudo apt-get install wiringpi
wget https://files.waveshare.com/wiki/common/wiringpi-latest.deb && sudo dpkg -i wiringpi-latest.deb
gpio -v
sudo git clone https://github.com/WiringPi/WiringPi && cd WiringPi && sudo ./build
sudo su && wget https://github.com/joan2937/lg/archive/master.zip && unzip master.zip && cd lg-master && sudo make install
sudo apt-get update && sudo apt-get install python3-pip && sudo pip3 install RPi.GPIO && sudo apt-get install python3-smbus && sudo apt-get install python3-serial
sudo apt-get install p7zip
wget https://files.waveshare.com/upload/e/ef/2-CH_SCR_HAT_code.7z
7zr x 2-CH_SCR_HAT_code.7z -r -o./2-CH_SCR_HAT_code
sudo chmod 777 -R 2-CH_SCR_HAT_code
cd 2-CH_SCR_HAT_code/RaspberryPi/c && make clean && make && sudo ./main
cd ../python/examples && sudo python main.py
sudo apt-get install python-bottle && cd Web_python && sudo python main.py
sudo apt-get update && sudo apt-get install python3-pip && sudo pip3 install Jetson.GPIO
sudo groupadd -f -r gpio && sudo usermod -a -G gpio your_user_name
sudo cp /opt/nvidia/jetson-gpio/etc/99-gpio.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules && sudo udevadm trigger
Notes and version constraints
- High-voltage hazard: solder points and traces are exposed – do not touch with hands; insulated enclosure recommended
- Thermal limit: output cuts off at 125 °C; keep operating temperature below 80 °C using cooling devices
- Short-circuiting the output can destroy the triac – never short the circuit
- On Bookworm OS only lgpio is available; bcm2835 and wiringPi cannot be installed
- UART demo works only with WIRINGPI and DEV_LIB; I2C additionally supports USE_BCM2835_LIB
- Demo codes reference file 2-CH_SCR_HAT_code.7z – if the download source fails, manual verification is needed
Source and revision record
- 2-CH TRIAC HAT - Waveshare Wiki
- Source revision: 68745
- Captured: 2026-09-01T02:40:59+00:00
- SHA-256:
22a433942ec51bf699e291dd5a83b2195be391b860e5c829970dae2a7b70438a