INTRODUCTION
DAC series modules are a range of products that can be controlled through I2C or PWM signals to generate voltage or current output signals. They possess the capability to produce a variety of analog voltage or current signals, including 0-5V, 0-10V, 0-2.5V, 0-VCC, and 0-25mA.
An analog quantity refers to the continuous variation of voltage magnitude (or current magnitude) within a specific range. Due to its stability, long transmission distance, and ease of use, it has found widespread application in the field of industrial automation control, including:
Motor speed control
Sound intensity control
Temperature regulation
Adjustment of light brightness
Valve angle modulation
etc.
This series of DAC products not only offers a variety of output signal ranges, but also provides three selectable resolutions: 8-bit, 12-bit, and 15-bit. It allows for the choice of either single-channel or dual-channel configurations, and multiple modules can be cascaded to form a multi-channel output. When coupled with Arduino controllers, Raspberry Pi, STM32, and similar controllers, it finds application in various automation control scenarios, including:
Laboratory testing equipment
Automatic motor speed control
Indoor and outdoor lighting control
Automated volume adjustment
Backlight control for displays
etc.
The following table presents the functional parameters of each DAC product for reference in the selection process.
DFR1037 GP8501 (2-Channel PWM to 0-2.5V/VCC DAC Module)
FUNCTIONS
This is a 2-channel analog voltage output DAC module with PWM communication, 8-bit resolution, and 0.1% output voltage linearity error. It is well-suited for control projects operating within the 3.3V range, such as ESP32, Raspberry Pi, STM32, and other microcontrollers that require analog signal output.
PWM signal drive allows the module to be controlled by MCU digital ports, providing a simple and convenient usage. The design with two channels also enables effective cost reduction for the project.
FEATURES
- Support 3.3-V-5V power supply.
- Output voltage linearity error of 0.1%.
- Two channels of voltage output, either 0-2.5V or 0-VCC, enabling connection and control of standard analog voltage devices.
- Gravity interface, PWM communication, Arduino control, suitable for program automation control.
- PWM signals can be utilized to drive the module, enabling it to be controlled simply by the digital port of the MCU.
DIMENSION
FUNCTIONAL DIAGRAM
Name | Description | Remarks |
---|---|---|
PWM Interface | VCC | Positive terminal of the power supply (3.3V-5V) |
GND | Negative terminal of the power supply | |
D0 | PWM Input Port 0 | |
D1 | PWM Input Port 1 | |
0-2.5V/0-VCC Switching Switch | 0-VCC | Switch output voltage to 0V-VCC |
0-2.5V | Switch output voltage to 0V-2.5V | |
Voltage Signal Output Port | VOUT0 | Positive terminal of output voltage signal 0 |
VOUT1 | Positive terminal of output voltage signal 1 | |
GND | Negative terminal of the output voltage signal |
SPECIFICATIONS
- Chip Type: GP8501
- Operating Voltage: 3.3V-5V
- Output Voltage: 0-2.5V or 0-VCC
- Number of Channels: 2 channels
- Communication Method: PWM
- Resolution: 8-bit
- Value Range: 0 - 255 corresponding to 0-2.5V or 0-VCC
- Output voltage linearity error: 0.1%
TUTORIAL
In this example, We will demonstrate the varying voltage values output by two channels in two different states.
Input signal value range: 0-255
In the state of 0-2.5V:
- Channel 0 inputs 176, resulting in an output of 1.725V.
- Channel 1 inputs 103, resulting in an output of 1.009V.
In the state of 0-VCC:
- Channel 0 inputs 176, resulting in an output of 3.29V.
- Channel 1 inputs 103, resulting in an output of 1.926V.
SOFTWARE REQUIREMENTS
Download Arduino IDE: Click to download Arduino IDE
Download Arduino libraries: Click to download https://github.com/DFRobot/DFRobot_GP8XXX
Click the link to view:How to install the library?;
Note: All modules in this series utilize the same library.
HARDWARE CONNECTION
SAMPLE CODE
#include <DFRobot_GP8XXX.h>
//#define SINGLE_CHANNEL
#ifdef SINGLE_CHANNEL
//Single-channel output IO port
int pwmPin0 = 9;
DFRobot_GP8501 GP8501(pwmPin0);
#else
//Dual-channel output IO port
int pwmPin0 = 9;
int pwmPin1 = 10;
DFRobot_GP8501 GP8501(pwmPin0,pwmPin1);
#endif
void setup() {
GP8501.begin();
/**
* @brief. Configuring different channel outputs for DAC values
* @param data pwm
* @n. Optional parameters (0-255) correspond to voltage ranges of (0-2.5V) or (0-VCC), and the specific voltage range is determined by the fluctuation switch selected based on the module voltage.
* @param channel. Output channel
* @n 0:Channel 0 (effective when configuring PWM0 output.)
* @n 1:Channel 1 (effective when configuring PWM1 output.)
* @n 2:All Channels (effective when configuring Dual-channel output.)
*/
GP8501.setDACOutVoltage(176,0);//At 0-2.5V voltage range, Channel 0 outputs 1.725V, whereas at 0-VCC voltage range, Channel 0 outputs 3.29V.
GP8501.setDACOutVoltage(103,1);//At 0-2.5V voltage range, Channel 1 outputs 1.009V, whereas at 0-VCC voltage range, Channel 1 outputs 1.926V.
}
void loop() {
}
RESULT
After downloading the program, the measured output voltage of channel 0 under the 0-2.5V state is 1.725V, and the output voltage of channel 1 is 1.009V. Under the 0-VCC state, the actual output voltage of channel 0 is 3.29V, and the output voltage of channel 1 is 1.926V.
More Documents
DFR1037 Documents:
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.