Difference between revisions of "High-Precision AD/DA Board"

From Waveshare Wiki
Jump to: navigation, search
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Infobox item|colorscheme=blue
+
<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 suited for Raspberry Pi and Jetson nano
+
Raspberry Pi AD/DA Expansion Board is designed for Raspberry Pi and Jetson nano.
 +
 
 
==Features==
 
==Features==
*Onboard ADS1256, 8ch 24bit high-precision ADC (4ch differential input), 30ksps sampling rate
+
*Onboard ADS1256, 8ch 24bit high-precision ADC (4ch differential input), 30ksps sampling rate.
*Onboard DAC8552, 2ch 16bit high-precision DAC
+
*Onboard DAC8552, 2ch 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 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 in various occasions
+
*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 nano  
+
*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:#0000ff; color:white;" align="center"
+
|-style="background:green; color:white;" align="center"
 
|Pin Function||BCM||WiringPi||Description
 
|Pin Function||BCM||WiringPi||Description
 
|-align="center"
 
|-align="center"
Line 103: Line 105:
 
<pre>
 
<pre>
 
sudo apt-get install p7zip-full
 
sudo apt-get install p7zip-full
wget http://www.waveshare.net/w/upload/5/5e/High-Precision-AD-DA-Board-Code.7z
+
wget https://www.waveshare.com/w/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 161: Line 163:
  
 
*Hardware setting
 
*Hardware setting
Set the Power Supply to 5V:connect 5V to VCC<br />
+
Set the Power Supply to 5V:connect 5V to VCC.<br />
Set the Reference Input Voltage to 5V:connect 5V to VREF <br />
+
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 />
  
Line 201: Line 203:
 
cd AD-DA/
 
cd AD-DA/
 
</pre>
 
</pre>
Provide demo:bcm2835、python<br />
+
Provide demo:bcm2835, python<br />
  
 
1.bcm2835
 
1.bcm2835
Line 213: Line 215:
 
</font>
 
</font>
  
2.python
+
2. python
 
<pre>
 
<pre>
 
cd python/
 
cd python/
Line 220: Line 222:
  
 
*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 class="tabbertab" title="JetsonNano" id="myjetson">
 
  
 
='''Jetson nano Developer Kit'''=
 
='''Jetson nano Developer Kit'''=
Line 254: Line 253:
 
<pre>
 
<pre>
 
sudo apt-get install p7zip-full
 
sudo apt-get install p7zip-full
wget http://www.waveshare.net/w/upload/5/5e/High-Precision-AD-DA-Board-Code.7z
+
wget https://www.waveshare.com/w/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 329: Line 328:
 
Breathing light effect in LEDA and LEDB<br />
 
Breathing light effect in LEDA and LEDB<br />
  
==AD/DA synthetical demo==
+
==AD/DA demo==
 
<pre>
 
<pre>
 
cd AD-DA/
 
cd AD-DA/
 
</pre>
 
</pre>
Provides three demos:c、python2、python3<br />
+
Provides three demos:c, python2, python3<br />
  
1.C
+
1. C
 
<pre>
 
<pre>
 
cd C/
 
cd C/
Line 355: Line 354:
  
 
*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==
 
*[[:File:High-Precision-AD-DA-User-Manual.pdf|User Manual]]
 
*[[:File:High-Precision-AD-DA-User-Manual.pdf|User Manual]]
 
*[[:File:High-Precision-AD-DA-board.pdf | Schematic]]
 
*[[:File:High-Precision-AD-DA-board.pdf | Schematic]]
Line 379: Line 379:
 
Input Voltage Range (Min) (V): -2.5, 0
 
Input Voltage Range (Min) (V): -2.5, 0
 
|||}}
 
|||}}
 
<div class="tabbertab" title="Support" id="mysupport">
 
 
=''Support''=
 
 
{{Service00}}
 
{{Service00}}
 
 
[[Category:Robotics|Robotics]]
 
[[Category:Robotics|Robotics]]

Latest revision as of 10:12, 8 August 2022

High-Precision AD/DA Board
High-Precision-AD-DA-Board l.jpg

Raspberry Pi AD/DA Expansion
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

Raspberry Pi AD/DA Expansion Board is designed for Raspberry Pi and Jetson nano.

Features

  • Onboard ADS1256, 8ch 24bit high-precision ADC (4ch differential input), 30ksps sampling rate.
  • Onboard DAC8552, 2ch 16bit high-precision DAC.
  • The pinout is compatible with 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 DAC8532chip 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 Raspberry Pi terminal and enter the following command enters the configuration interface
sudo raspi-config
Choose Interfacing Options -> SPI -> Yes open SPIinterface

RPI open spi.png

Then reboot Raspberry Pi

sudo reboot

Please make sure that SPI is not occupied by other devices, you can check it by /boot/config.txt

Install Libraries

  • BCM2835
#Open Raspberry Pi terminal and run the following demands
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.68.tar.gz
tar zxvf bcm2835-1.68.tar.gz 
cd bcm2835-1.68/
sudo ./configure && sudo make && sudo make check && sudo make install
#For more information, please refer to the official website:http://www.airspayce.com/mikem/bcm2835/
  • Wiring Pi
#open Raspberry Pi terminal,run the following demand
sudo apt-get install wiringpi
#For Raspberry Pi systems after May 2019 (For earlier version, it is not necessary to execute), 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 does not appear, the installation is wrong.
#Bullseye branch system run the following demands
git clone https://github.com/WiringPi/WiringPi
cd WiringPi
./build
gpio -v
# Run gpio -v and version 2.60 will appear. If it does not appear, the installation is wrong.
  • 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://www.waveshare.com/w/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.
High-Precision-AD-DA ADset.png

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 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://www.waveshare.com/w/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 ground.

High-Precision-AD-DA ADset.png
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

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

FAQ

 Answer:
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.


 Answer:
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.


 Answer:

Input Voltage Range (Max) (V): 2.5, 5
Input Voltage Range (Min) (V): -2.5, 0


Support

If you require technical support, please go to the Support page and open a ticket.