Difference between revisions of "High-Precision AD/DA Board"
m (Text replacement - "https://www.waveshare.com/w/upload/" to "https://files.waveshare.com/upload/") |
|||
(46 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | {{Infobox item| | + | <div class="wiki-pages jet-green-color"> |
+ | {{Infobox item| | ||
|name=[[High-Precision AD/DA Board]] | |name=[[High-Precision AD/DA Board]] | ||
− | |img=[[File:High-Precision-AD-DA-Board_l.jpg|250px|link=http://www.waveshare.com/High-Precision-AD-DA-Board.htm]] | + | |img=[[File:High-Precision-AD-DA-Board_l.jpg|250px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=http://www.waveshare.com/High-Precision-AD-DA-Board.htm}}]] |
|caption=Raspberry Pi AD/DA Expansion | |caption=Raspberry Pi AD/DA Expansion | ||
|platform=Raspberry Pi | |platform=Raspberry Pi | ||
|category=[[:Category:Expansions|Expansions]], [[:Category:Raspberry Pi|Raspberry Pi]] | |category=[[:Category:Expansions|Expansions]], [[:Category:Raspberry Pi|Raspberry Pi]] | ||
|brand=Waveshare | |brand=Waveshare | ||
− | |{{#urlget:amazon|default}}=display | + | |{{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}=display |
|website_cn=[http://www.waveshare.net/shop/High-Precision-AD-DA-Board.htm 官方中文站点] | |website_cn=[http://www.waveshare.net/shop/High-Precision-AD-DA-Board.htm 官方中文站点] | ||
|website_en=[http://www.waveshare.com/High-Precision-AD-DA-Board.htm Website] | |website_en=[http://www.waveshare.com/High-Precision-AD-DA-Board.htm Website] | ||
Line 14: | Line 15: | ||
}} | }} | ||
== Introduction == | == Introduction == | ||
− | Raspberry Pi AD/DA Expansion Board is | + | Raspberry Pi AD/DA Expansion Board is designed for Raspberry Pi and Jetson nano. |
+ | |||
==Features== | ==Features== | ||
− | *Onboard ADS1256, | + | *Onboard ADS1256, 8-ch 24bit high-precision ADC (4ch differential input), 30ksps sampling rate. |
− | *Onboard DAC8552, | + | *Onboard DAC8552, 2-ch 16bit high-precision DAC. |
− | *The pinout is compatible with Waveshare sensor interface standard, easy to connect various analog sensor modules | + | *The pinout is compatible with the Waveshare sensor interface standard, easy to connect various analog sensor modules. |
− | *On-board terminal block encapsulates the input and output interface, which can be connected to analog signals and digital signals, which is convenient for use | + | *On-board terminal block encapsulates the input and output interface, which can be connected to analog signals and digital signals, which is convenient for use on various occasions. |
− | *Features AD/DA detect circuit, easy for signal demonstration | + | *Features AD/DA detect circuit, easy for signal demonstration. |
− | *Provides sample demo of Raspberry Pi and Jetson | + | *Provides sample demo of Raspberry Pi and Jetson Nano. |
==Pinouts== | ==Pinouts== | ||
{|border=1; style="width:700px;" align="center" | {|border=1; style="width:700px;" align="center" | ||
− | |-style="background: | + | |-style="background:green; color:white;" align="center" |
|Pin Function||BCM||WiringPi||Description | |Pin Function||BCM||WiringPi||Description | ||
|-align="center" | |-align="center" | ||
Line 36: | Line 38: | ||
|CS0||P22||P3||ADS1256 chip select, active-low | |CS0||P22||P3||ADS1256 chip select, active-low | ||
|-align="center" | |-align="center" | ||
− | |C1||P23||P4|| | + | |C1||P23||P4||DAC8532 chip select, active-low |
|-align="center" | |-align="center" | ||
|DIN||P10||P12||SPI data input | |DIN||P10||P12||SPI data input | ||
Line 48: | Line 50: | ||
=Raspberry Pi= | =Raspberry Pi= | ||
− | Provides C code and | + | Provides C code and Python demo. |
==Open SPI Interface== | ==Open SPI Interface== | ||
− | *Open Raspberry Pi terminal and enter | + | *Open the Raspberry Pi terminal, and enter the configuration interface with the following commands: |
<pre> | <pre> | ||
sudo raspi-config | sudo raspi-config | ||
− | Choose Interfacing Options -> SPI -> Yes | + | Choose Interfacing Options -> SPI -> Yes to enable the SPI interface |
</pre> | </pre> | ||
[[File:RPI_open_spi.png]] | [[File:RPI_open_spi.png]] | ||
− | Then reboot Raspberry Pi | + | Then reboot Raspberry Pi. |
<pre> | <pre> | ||
sudo reboot | sudo reboot | ||
</pre> | </pre> | ||
− | + | *Check /boot/config.txt, and you can see 'dtparam=spi=on' was written in. | |
+ | [[File:Raspberry Pi Guides for 4.37 e-Paper.jpg]]<br /> | ||
+ | To make sure SPI is not occupied, it is recommended to close other drivers' coverage. You can use ls /dev/spi to check whether SPI is occupied. If the terminal outputs /dev/spidev0.1 and /dev/spidev0.1, SPI is not occupied.<br /> | ||
+ | [[File:Raspberry Pi Guides for 4.37 e-Paper02.jpg]]<br /> | ||
==Install Libraries== | ==Install Libraries== | ||
− | + | {{RPI_C_lib}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
*python | *python | ||
<pre> | <pre> | ||
Line 98: | Line 79: | ||
sudo pip install spidev | sudo pip install spidev | ||
</pre> | </pre> | ||
− | |||
==Download Demo== | ==Download Demo== | ||
− | Run in raspberry pi | + | Run in raspberry pi terminal:<br /> |
<pre> | <pre> | ||
sudo apt-get install p7zip-full | sudo apt-get install p7zip-full | ||
− | wget | + | wget https://files.waveshare.com/upload/5/5e/High-Precision-AD-DA-Board-Code.7z |
7z x High-Precision-AD-DA-Board-Code.7z -r -o./High-Precision-AD-DA-Board-Code | 7z x High-Precision-AD-DA-Board-Code.7z -r -o./High-Precision-AD-DA-Board-Code | ||
cd High-Precision-AD-DA-Board-Code/RaspberryPI/ | cd High-Precision-AD-DA-Board-Code/RaspberryPI/ | ||
Line 112: | Line 92: | ||
cd ADS1256 | cd ADS1256 | ||
</pre> | </pre> | ||
− | Provides four | + | Provides four demos: bcm2835, python2, python3, wiringpi.<br /> |
*Hardware Settings | *Hardware Settings | ||
− | Set the Power Supply to | + | Set the Power Supply to 5V: connect 5V to VCC.<br /> |
− | Set the Reference Input Voltage to | + | Set the Reference Input Voltage to 5V: connect 5V to VREF. <br /> |
Set the Potentiometer output as an Analog Input: connect the pin ADJ and AD0. Make sure the left side Sensor Interface AD0 is disconnected.<br /> | Set the Potentiometer output as an Analog Input: connect the pin ADJ and AD0. Make sure the left side Sensor Interface AD0 is disconnected.<br /> | ||
− | Set the LDR output as an Analog Input: connect the pin LDR and AD1. Make sure the left side Sensor Interface AD1 is disconnected. Connect AINCOM to AGND. When using AD for differential measurements, the common input AINCOM does not need to be tied to the ground. <br /> | + | Set the LDR output as an Analog Input: connect the pin LDR and AD1. Make sure the left-side Sensor Interface AD1 is disconnected. Connect AINCOM to AGND. When using AD for differential measurements, the common input AINCOM does not need to be tied to the ground. <br /> |
[[File:High-Precision-AD-DA_ADset.png]] | [[File:High-Precision-AD-DA_ADset.png]] | ||
− | 1.bcm2835 | + | 1. bcm2835 |
<pre> | <pre> | ||
cd bcm2835/ | cd bcm2835/ | ||
Line 130: | Line 110: | ||
</font> | </font> | ||
− | 2.wiringpi | + | 2. wiringpi |
<pre> | <pre> | ||
cd wiringpi/ | cd wiringpi/ | ||
Line 137: | Line 117: | ||
</pre> | </pre> | ||
− | 3.python2 | + | 3. python2 |
<pre> | <pre> | ||
cd python2/ | cd python2/ | ||
Line 143: | Line 123: | ||
</pre> | </pre> | ||
− | 4.python3 | + | 4. python3 |
<pre> | <pre> | ||
cd python3/ | cd python3/ | ||
Line 149: | Line 129: | ||
</pre> | </pre> | ||
− | *Experiment Phenomenon | + | *Experiment Phenomenon: |
Turn the potentiometer, the AD0 channel voltage will change accordingly.<br /> | Turn the potentiometer, the AD0 channel voltage will change accordingly.<br /> | ||
Block the photoresistor, and the AD1 channel voltage changes accordingly.<br /> | Block the photoresistor, and the AD1 channel voltage changes accordingly.<br /> | ||
Line 158: | Line 138: | ||
cd DAC8532/ | cd DAC8532/ | ||
</pre> | </pre> | ||
− | Provides four demos: | + | Provides four demos: bcm2835, python2, python3, wiringpi.<br /> |
*Hardware setting | *Hardware setting | ||
− | Set the Power Supply to | + | Set the Power Supply to 5V: connect 5V to VCC.<br /> |
− | Set the Reference Input Voltage to | + | Set the Reference Input Voltage to 5V: connect 5V to VREF. <br /> |
Connect DA0 to LEDA and DA1 to LEDB. Then the brightness of the indicator LEDA will change according to the DA0 output voltage. The brightness of the indicator LEDB will vary according to the DA1 output voltage.<br /> | Connect DA0 to LEDA and DA1 to LEDB. Then the brightness of the indicator LEDA will change according to the DA0 output voltage. The brightness of the indicator LEDB will vary according to the DA1 output voltage.<br /> | ||
− | 1.bcm2835 | + | 1. bcm2835 |
<pre> | <pre> | ||
cd bcm2835/ | cd bcm2835/ | ||
Line 175: | Line 155: | ||
</font> | </font> | ||
− | 2.wiringpi | + | 2. wiringpi |
<pre> | <pre> | ||
cd wiringpi/ | cd wiringpi/ | ||
Line 182: | Line 162: | ||
</pre> | </pre> | ||
− | 3.python2 | + | 3. python2 |
<pre> | <pre> | ||
cd python2/ | cd python2/ | ||
Line 188: | Line 168: | ||
</pre> | </pre> | ||
− | 4.python3 | + | 4. python3 |
<pre> | <pre> | ||
cd python3/ | cd python3/ | ||
Line 194: | Line 174: | ||
</pre> | </pre> | ||
− | *Experiment Phenomenon | + | *Experiment Phenomenon: |
− | Breathing light effect in LEDA and LEDB<br /> | + | Breathing light effect in LEDA and LEDB.<br /> |
==AD/DA synthetical demo== | ==AD/DA synthetical demo== | ||
Line 201: | Line 181: | ||
cd AD-DA/ | cd AD-DA/ | ||
</pre> | </pre> | ||
− | Provide | + | Provide demo: bcm2835, python.<br /> |
− | 1.bcm2835 | + | 1. bcm2835 |
<pre> | <pre> | ||
cd bcm2835/ | cd bcm2835/ | ||
Line 213: | Line 193: | ||
</font> | </font> | ||
− | 2.python | + | 2. python |
<pre> | <pre> | ||
cd python/ | cd python/ | ||
Line 220: | Line 200: | ||
*Experiment Phenomenon | *Experiment Phenomenon | ||
− | After rotating the potentiometer, the two LEDs will light up alternately<br / | + | After rotating the potentiometer, the two LEDs will light up alternately.<br /> |
− | |||
− | |||
− | |||
='''Jetson nano Developer Kit'''= | ='''Jetson nano Developer Kit'''= | ||
Jetson nano program uses analog SPI, so SPI rate or sample rate is relatively slower.<br /> | Jetson nano program uses analog SPI, so SPI rate or sample rate is relatively slower.<br /> | ||
==Software setting== | ==Software setting== | ||
− | Install Function Libraries | + | Install Function Libraries: |
− | *Open terminal interface and enter the following commands to install function libraries | + | *Open the terminal interface and enter the following commands to install function libraries. |
<pre> | <pre> | ||
cd python/ | cd python/ | ||
Line 240: | Line 217: | ||
sudo udevadm control --reload-rules && sudo udevadm trigger | sudo udevadm control --reload-rules && sudo udevadm trigger | ||
</pre> | </pre> | ||
− | *Install I2C | + | *Install I2C: |
<pre> | <pre> | ||
sudo apt-get install python-smbus | sudo apt-get install python-smbus | ||
Line 251: | Line 228: | ||
===Download Testing Demo=== | ===Download Testing Demo=== | ||
− | Open linuxterminal and | + | Open linuxterminal and execute:<br /> |
<pre> | <pre> | ||
sudo apt-get install p7zip-full | sudo apt-get install p7zip-full | ||
− | wget | + | wget https://files.waveshare.com/upload/5/5e/High-Precision-AD-DA-Board-Code.7z |
7z x High-Precision-AD-DA-Board-Code.7z -r -o./High-Precision-AD-DA-Board-Code | 7z x High-Precision-AD-DA-Board-Code.7z -r -o./High-Precision-AD-DA-Board-Code | ||
cd High-Precision-AD-DA-Board-Code/Jetsonnano/ | cd High-Precision-AD-DA-Board-Code/Jetsonnano/ | ||
Line 263: | Line 240: | ||
cd ADS1256 | cd ADS1256 | ||
</pre> | </pre> | ||
− | Provides three | + | Provides three demos: c, python2, python3.<br /> |
*Hardware Setting | *Hardware Setting | ||
− | Set the Power Supply to | + | Set the Power Supply to 5V: connect 5V to VCC.<br /> |
− | Set the Reference Input Voltage to | + | Set the Reference Input Voltage to 5V: connect 5V to VREF.<br /> |
Set the Potentiometer output as an Analog Input: connect the pin ADJ and AD0. Make sure the left side Sensor Interface AD0 is disconnected.<br /> | Set the Potentiometer output as an Analog Input: connect the pin ADJ and AD0. Make sure the left side Sensor Interface AD0 is disconnected.<br /> | ||
− | Set the LDR output as an Analog Input: connect the pin LDR and AD1. Make sure the left side Sensor Interface AD1 is disconnected. Connect AINCOM to AGND. When using AD for differential measurements, the common input AINCOM does not need to be tied to ground. <br /> | + | Set the LDR output as an Analog Input: connect the pin LDR and AD1. Make sure the left-side Sensor Interface AD1 is disconnected. Connect AINCOM to AGND. When using AD for differential measurements, the common input AINCOM does not need to be tied to the ground. <br /> |
[[file:High-Precision-AD-DA_ADset.png|900px]]<br /> | [[file:High-Precision-AD-DA_ADset.png|900px]]<br /> | ||
− | 1.C | + | 1. C |
<pre> | <pre> | ||
cd C/ | cd C/ | ||
Line 279: | Line 256: | ||
</pre> | </pre> | ||
− | 2.python2 | + | 2. python2 |
<pre> | <pre> | ||
cd python2/ | cd python2/ | ||
Line 285: | Line 262: | ||
</pre> | </pre> | ||
− | 3.python3 | + | 3. python3 |
<pre> | <pre> | ||
cd python3/ | cd python3/ | ||
Line 291: | Line 268: | ||
</pre> | </pre> | ||
− | *Experiment Phenomenon | + | *Experiment Phenomenon: |
Turn the potentiometer, the AD0 channel voltage will change accordingly.<br /> | Turn the potentiometer, the AD0 channel voltage will change accordingly.<br /> | ||
Block the photoresistor, and the AD1 channel voltage changes accordingly.<br /> | Block the photoresistor, and the AD1 channel voltage changes accordingly.<br /> | ||
− | Since other channels are not connected to the load, he is floating, so it floats around 1.17V<br /> | + | Since other channels are not connected to the load, he is floating, so it floats around 1.17V.<br /> |
==DA Demo== | ==DA Demo== | ||
Line 300: | Line 277: | ||
cd DAC8532/ | cd DAC8532/ | ||
</pre> | </pre> | ||
− | Provides three | + | Provides three demos: c, python2, python3.<br /> |
− | *Hardware Setting | + | *Hardware Setting: |
The operating voltage is set to 5V: connect 5V to VCC.<br /> | The operating voltage is set to 5V: connect 5V to VCC.<br /> | ||
The reference voltage is set to 5V: connect 5V to VREF.<br /> | The reference voltage is set to 5V: connect 5V to VREF.<br /> | ||
Connect DA0 to LEDA and DA1 to LEDB. Then the brightness of the indicator LEDA will change according to the DA0 output voltage. The brightness of the indicator LEDB will vary according to the DA1 output voltage.<br /> | Connect DA0 to LEDA and DA1 to LEDB. Then the brightness of the indicator LEDA will change according to the DA0 output voltage. The brightness of the indicator LEDB will vary according to the DA1 output voltage.<br /> | ||
− | 1.C | + | 1. C |
<pre> | <pre> | ||
cd C/ | cd C/ | ||
Line 314: | Line 291: | ||
</pre> | </pre> | ||
− | 2.python2 | + | 2. python2 |
<pre> | <pre> | ||
cd python2/ | cd python2/ | ||
Line 320: | Line 297: | ||
</pre> | </pre> | ||
− | 3.python3 | + | 3. python3 |
<pre> | <pre> | ||
cd python3/ | cd python3/ | ||
Line 326: | Line 303: | ||
</pre> | </pre> | ||
− | *Experiment Phenomenon | + | *Experiment Phenomenon: |
− | Breathing light effect in LEDA and LEDB<br /> | + | Breathing light effect in LEDA and LEDB.<br /> |
− | ==AD/DA | + | ==AD/DA demo== |
<pre> | <pre> | ||
cd AD-DA/ | cd AD-DA/ | ||
</pre> | </pre> | ||
− | Provides three | + | Provides three demos:c, python2, python3.<br /> |
− | 1.C | + | 1. C |
<pre> | <pre> | ||
cd C/ | cd C/ | ||
Line 342: | Line 319: | ||
</pre> | </pre> | ||
− | 2.python2 | + | 2. python2 |
<pre> | <pre> | ||
cd python2/ | cd python2/ | ||
Line 348: | Line 325: | ||
</pre> | </pre> | ||
− | 3.python3 | + | 3. python3 |
<pre> | <pre> | ||
cd python3/ | cd python3/ | ||
Line 354: | Line 331: | ||
</pre> | </pre> | ||
− | *Experiment Phenomenon | + | *Experiment Phenomenon: |
− | After rotating the potentiometer, the two LEDs will light up alternately<br /> | + | After rotating the potentiometer, the two LEDs will light up alternately.<br /> |
</div> | </div> | ||
='''Resource'''= | ='''Resource'''= | ||
− | *[ | + | ==Documentation== |
− | *[ | + | *[https://files.waveshare.com/upload/b/b7/High-Precision-AD-DA-User-Manual.pdf User Manual] |
− | *[ | + | *[https://files.waveshare.com/upload/2/29/High-Precision-AD-DA-board.pdf Schematic] |
+ | *[https://files.waveshare.com/upload/5/5e/High-Precision-AD-DA-Board-Code.7z Source code] | ||
*[https://github.com/waveshare/High-Precision-AD-DA-Board Github] | *[https://github.com/waveshare/High-Precision-AD-DA-Board Github] | ||
Line 370: | Line 348: | ||
='''FAQ'''= | ='''FAQ'''= | ||
{{FAQ|According to the introduction, the module has a sampling rate of 30ksps, why the AD test cannot reach this rate?<br>| | {{FAQ|According to the introduction, the module has a sampling rate of 30ksps, why the AD test cannot reach this rate?<br>| | ||
− | The sample demo enables 8-channel high-precision ADC by default. In order to ensure stability and accuracy, the program adds a delay when reading and processing data. If a higher rate is required, the delay can be commented out.|||}} | + | The sample demo enables 8-channel high-precision ADC by default. In order to ensure stability and accuracy, the program adds a delay when reading and processing data. If a higher rate is required, the delay can be commented out.<br> |
+ | [[:File:AD1256-bcm2835.zip |High-Precision-AD-DA-Board-1CH]] | ||
+ | |||}} | ||
{{FAQ|Why does the running program show ID read fail?<br>| | {{FAQ|Why does the running program show ID read fail?<br>| | ||
After running the BCM2835 library, you need to restart the Raspberry Pi to run the rest of the libraries normally. Restart the Raspberry Pi and run it again.|||}} | After running the BCM2835 library, you need to restart the Raspberry Pi to run the rest of the libraries normally. Restart the Raspberry Pi and run it again.|||}} | ||
− | {{FAQ| | + | {{FAQ|After running the program, why does it always display 5V<br>| |
− | + | * The unconnected idle channel shows 5.08V; it is a normal phenomenon due to the internal structure of the chip. | |
− | + | *The default floating voltage is 5.08V, which does not affect the use. If you do not need other channels, you can close this channel or connect it to GND | |
|||}} | |||}} | ||
− | + | ='''Support'''= | |
− | + | {{Servicebox1}} | |
− | |||
− | =''Support''= | ||
− | {{ | ||
− | |||
[[Category:Robotics|Robotics]] | [[Category:Robotics|Robotics]] |
Latest revision as of 16:10, 31 August 2023
| ||
Introduction
Raspberry Pi AD/DA Expansion Board is designed for Raspberry Pi and Jetson nano.
Features
- Onboard ADS1256, 8-ch 24bit high-precision ADC (4ch differential input), 30ksps sampling rate.
- Onboard DAC8552, 2-ch 16bit high-precision DAC.
- The pinout is compatible with the Waveshare sensor interface standard, easy to connect various analog sensor modules.
- On-board terminal block encapsulates the input and output interface, which can be connected to analog signals and digital signals, which is convenient for use on various occasions.
- Features AD/DA detect circuit, easy for signal demonstration.
- Provides sample demo of Raspberry Pi and Jetson Nano.
Pinouts
Pin Function | BCM | WiringPi | Description |
DRDY | P17 | P0 | ADS1256 data output,active-low |
RESET | P18 | P1 | ADS1256 reset input |
PDWN | P27 | P2 | ADS1256 Sync/Shutdown power input, active-low |
CS0 | P22 | P3 | ADS1256 chip select, active-low |
C1 | P23 | P4 | DAC8532 chip select, active-low |
DIN | P10 | P12 | SPI data input |
DOUT | P9 | P13 | SPI data output |
SCK | P11 | P14 | SPI clock signal |
Raspberry Pi
Provides C code and Python demo.
Open SPI Interface
- Open the Raspberry Pi terminal, and enter the configuration interface with the following commands:
sudo raspi-config Choose Interfacing Options -> SPI -> Yes to enable the SPI interface
Then reboot Raspberry Pi.
sudo reboot
- Check /boot/config.txt, and you can see 'dtparam=spi=on' was written in.
To make sure SPI is not occupied, it is recommended to close other drivers' coverage. You can use ls /dev/spi to check whether SPI is occupied. If the terminal outputs /dev/spidev0.1 and /dev/spidev0.1, SPI is not occupied.
Install Libraries
- Install BCM2835 libraries:
#Open the Raspberry Pi terminal and run the following command wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz tar zxvf bcm2835-1.71.tar.gz cd bcm2835-1.71/ sudo ./configure && sudo make && sudo make check && sudo make install # For more, you can refer to the official website at: http://www.airspayce.com/mikem/bcm2835/
- Install WiringPi libraries:
#Open the Raspberry Pi terminal and run the following command cd sudo apt-get install wiringpi #For Raspberry Pi systems after May 2019 (earlier than that can be executed without), an upgrade may be required: wget https://project-downloads.drogon.net/wiringpi-latest.deb sudo dpkg -i wiringpi-latest.deb gpio -v # Run gpio -v and version 2.52 will appear, if it doesn't it means there was an installation error # Bullseye branch system using the following command: git clone https://github.com/WiringPi/WiringPi cd WiringPi . /build gpio -v # Run gpio -v and version 2.70 will appear, if it doesn't it means there was an installation error
- python
sudo apt-get update sudo apt-get install ttf-wqy-zenhei sudo apt-get install python-pip sudo pip install RPi.GPIO sudo pip install spidev
Download Demo
Run in raspberry pi terminal:
sudo apt-get install p7zip-full wget https://files.waveshare.com/upload/5/5e/High-Precision-AD-DA-Board-Code.7z 7z x High-Precision-AD-DA-Board-Code.7z -r -o./High-Precision-AD-DA-Board-Code cd High-Precision-AD-DA-Board-Code/RaspberryPI/
AD Demo
cd ADS1256
Provides four demos: bcm2835, python2, python3, wiringpi.
- Hardware Settings
Set the Power Supply to 5V: connect 5V to VCC.
Set the Reference Input Voltage to 5V: connect 5V to VREF.
Set the Potentiometer output as an Analog Input: connect the pin ADJ and AD0. Make sure the left side Sensor Interface AD0 is disconnected.
Set the LDR output as an Analog Input: connect the pin LDR and AD1. Make sure the left-side Sensor Interface AD1 is disconnected. Connect AINCOM to AGND. When using AD for differential measurements, the common input AINCOM does not need to be tied to the ground.
1. bcm2835
cd bcm2835/ make sudo ./ads1256_test
Notice: If you have run BCM2835 libraries, you need to reboot Raspberry Pi so as to run other libraries successfully.
2. wiringpi
cd wiringpi/ make sudo ./ads1256_test
3. python2
cd python2/ sudo python main.py
4. python3
cd python3/ sudo python3 main.py
- Experiment Phenomenon:
Turn the potentiometer, the AD0 channel voltage will change accordingly.
Block the photoresistor, and the AD1 channel voltage changes accordingly.
Since other channels are not connected to the load, the related pins float around 1.17V.
DA Demo
cd DAC8532/
Provides four demos: bcm2835, python2, python3, wiringpi.
- Hardware setting
Set the Power Supply to 5V: connect 5V to VCC.
Set the Reference Input Voltage to 5V: connect 5V to VREF.
Connect DA0 to LEDA and DA1 to LEDB. Then the brightness of the indicator LEDA will change according to the DA0 output voltage. The brightness of the indicator LEDB will vary according to the DA1 output voltage.
1. bcm2835
cd bcm2835/ make sudo ./dac8532_test
Notice: If you have run BCM2835 libraries, you need to reboot Raspberry Pi so as to run other libraries successfully.
2. wiringpi
cd wiringpi/ make sudo ./dac8532_test
3. python2
cd python2/ sudo python main.py
4. python3
cd python3/ sudo python3 main.py
- Experiment Phenomenon:
Breathing light effect in LEDA and LEDB.
AD/DA synthetical demo
cd AD-DA/
Provide demo: bcm2835, python.
1. bcm2835
cd bcm2835/ make sudo ./main
Notice: If you have run BCM2835 libraries, you need to reboot Raspberry Pi so as to run other libraries successfully.
2. python
cd python/ sudo python main.py
- Experiment Phenomenon
After rotating the potentiometer, the two LEDs will light up alternately.
Jetson nano Developer Kit
Jetson nano program uses analog SPI, so SPI rate or sample rate is relatively slower.
Software setting
Install Function Libraries:
- Open the terminal interface and enter the following commands to install function libraries.
cd python/ 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
- Install I2C:
sudo apt-get install python-smbus
- Install image processing libraries
sudo apt-get install python3-pil sudo apt-get install python3-numpy
Download Testing Demo
Open linuxterminal and execute:
sudo apt-get install p7zip-full wget https://files.waveshare.com/upload/5/5e/High-Precision-AD-DA-Board-Code.7z 7z x High-Precision-AD-DA-Board-Code.7z -r -o./High-Precision-AD-DA-Board-Code cd High-Precision-AD-DA-Board-Code/Jetsonnano/
AD Demo
cd ADS1256
Provides three demos: c, python2, python3.
- Hardware Setting
Set the Power Supply to 5V: connect 5V to VCC.
Set the Reference Input Voltage to 5V: connect 5V to VREF.
Set the Potentiometer output as an Analog Input: connect the pin ADJ and AD0. Make sure the left side Sensor Interface AD0 is disconnected.
Set the LDR output as an Analog Input: connect the pin LDR and AD1. Make sure the left-side Sensor Interface AD1 is disconnected. Connect AINCOM to AGND. When using AD for differential measurements, the common input AINCOM does not need to be tied to the ground.
cd C/ make sudo ./main
2. python2
cd python2/ sudo python main.py
3. python3
cd python3/ sudo python3 main.py
- Experiment Phenomenon:
Turn the potentiometer, the AD0 channel voltage will change accordingly.
Block the photoresistor, and the AD1 channel voltage changes accordingly.
Since other channels are not connected to the load, he is floating, so it floats around 1.17V.
DA Demo
cd DAC8532/
Provides three demos: c, python2, python3.
- Hardware Setting:
The operating voltage is set to 5V: connect 5V to VCC.
The reference voltage is set to 5V: connect 5V to VREF.
Connect DA0 to LEDA and DA1 to LEDB. Then the brightness of the indicator LEDA will change according to the DA0 output voltage. The brightness of the indicator LEDB will vary according to the DA1 output voltage.
1. C
cd C/ make sudo ./main
2. python2
cd python2/ sudo python main.py
3. python3
cd python3/ sudo python3 main.py
- Experiment Phenomenon:
Breathing light effect in LEDA and LEDB.
AD/DA demo
cd AD-DA/
Provides three demos:c, python2, python3.
1. C
cd C/ make sudo ./main
2. python2
cd python2/ sudo python main.py
3. python3
cd python3/ sudo python3 main.py
- Experiment Phenomenon:
After rotating the potentiometer, the two LEDs will light up alternately.
Resource
Documentation
Datasheets
Application Notes
- CP2102
- PCF8563
- Writing the Img to the SD card
- Libraries Installation for RPi
- Panasonic_SDFormatter
- Win32DiskImager
- putty
- wiringPi & bcm2835 C LIB
FAQ
The sample demo enables 8-channel high-precision ADC by default. In order to ensure stability and accuracy, the program adds a delay when reading and processing data. If a higher rate is required, the delay can be commented out.
High-Precision-AD-DA-Board-1CH
- The unconnected idle channel shows 5.08V; it is a normal phenomenon due to the internal structure of the chip.
- The default floating voltage is 5.08V, which does not affect the use. If you do not need other channels, you can close this channel or connect it to GND
Support
Technical Support
If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 AM GMT+8 (Monday to Friday)