LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 08-17-2017, 10:48 AM   #1
Boniato
LQ Newbie
 
Registered: Aug 2017
Posts: 11

Rep: Reputation: Disabled
Best Single Board Computer for Analog output


Hi All,

I have a Raspberry Pi with some python code that generates 3 different signals with a need to output as an analog signal.
I have just realized that the R-Pi has only one PWM output. The Odroid on the other hand has no PWM output at all. I think Arduinos have two analog outputs, but I can't install Linux on an Arduino so it is not suitable for my needs.

I wonder if anyone has some suggestion as to what could I do to output three analog signals from a Raspberry or an Odroid.
 
Old 08-17-2017, 11:06 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,167

Rep: Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890Reputation: 890
would 2 raspberry-pis do the trick ?

http://www.linuxquestions.org/questi...9/#post5712498
 
Old 08-17-2017, 11:09 AM   #3
Boniato
LQ Newbie
 
Registered: Aug 2017
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
would 2 raspberry-pis do the trick ?
At least three would be needed. I would prefer something more clean that I can do with an unique SBC.
 
Old 08-17-2017, 11:21 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,905

Rep: Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921Reputation: 2921
you can buy an additional board for RPi to have more PWM output (I have 16).
But PWM is not analog output.
And you can find a lot about it on the net, for example: https://circuitdigest.com/microcontr...i-pwm-tutorial
 
Old 08-17-2017, 03:55 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,899
Blog Entries: 27

Rep: Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186
Member response

Hi,

Welcome to LQ!

I suggest that you look at http://www.linuxquestions.org/questi...#faq_lqwelcome too help compose future responses to the forum.
Quote:
Originally Posted by Boniato View Post
Hi All,

I have a Raspberry Pi with some python code that generates 3 different signals with a need to output as an analog signal.
I have just realized that the R-Pi has only one PWM output. The Odroid on the other hand has no PWM output at all. I think Arduinos have two analog outputs, but I can't install Linux on an Arduino so it is not suitable for my needs.

I wonder if anyone has some suggestion as to what could I do to output three analog signals from a Raspberry or an Odroid.
You could look at https://learn.adafruit.com/mcp4725-1...ry-pi/overview
Quote:
Already mastered Analog Inputs with the Pi, and looking for a new challenge? How about: How can I generate an analog output on the Pi?!

There are several ways you can accomplish this, but one of the easiest and most flexible is to use a dedicated IC called a Digital to Analog Convertor (or DAC). A DAC allows you to specify a numeric value (0..255 for an 8-bit DAC, 0..4095 for a 12-bit DAC, etc.), and the IC will output a voltage based on the supply voltage, and relative to that numeric value. For example, using a 12-bit DAC like the MCP4725 we'll be using here, setting the value to 2048 on a 3.3V system will results in ~1.65V output on the DAC.

This guide will show you everything you need to know to be able to generate precise analog outputs using your Pi and the MCP4725 12-Bit I2C DAC, from connecting everything up, to how to use our easy Python library.
Since you did not provide the resolution required for 8 bit or better then you can use a DAC that suits your requirements. I have used Adafruit hardware without issues so you can rely on a good product.

Hope this helps.
Have fun & enjoy!
 
Old 08-18-2017, 06:26 AM   #6
Boniato
LQ Newbie
 
Registered: Aug 2017
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by onebuck View Post
Hi,

Welcome to LQ!

I suggest that you look at http://www.linuxquestions.org/questi...#faq_lqwelcome too help compose future responses to the forum.


You could look at https://learn.adafruit.com/mcp4725-1...ry-pi/overview
Since you did not provide the resolution required for 8 bit or better then you can use a DAC that suits your requirements. I have used Adafruit hardware without issues so you can rely on a good product.

Hope this helps.
Have fun & enjoy!
Hi oneback and thanks for your suggestions.
I have noticed that the adafruit DAC has only one analog output and I need to generate three of them.
 
Old 08-18-2017, 10:22 AM   #7
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: Slackware®
Posts: 12,899
Blog Entries: 27

Rep: Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186Reputation: 2186
Member response

Hi,

You can find many multi-channel DAC but finding one for the Rpi may be limited. What are your sampling frequencies? Range of signal output levels? Simple search for a 12 bit multi-channel DAC gives me; https://www.element14.com/community/...-eeprom-memory You can look at the data sheet; MCP4728 Data Sheet (.pdf)

Code:
The MCP4728 device is a quad, 12-bit voltage output
Digital-to-Analog   Convertor   (DAC)   with   nonvolatile
memory  (EEPROM).  Its  on-board  precision  output
amplifier  allows  it  to  achieve  rail-to-rail  analog  output
swing.
The  DAC  input  codes,  device  configuration  bits,  and
I2C  address  bits  are  programmable  to  the  nonvolatile
memory   (EEPROM)   by   using   I2C   serial   interface
commands.  The  nonvolatile  memory  feature  enables
the  DAC  device  to  hold  the  DAC  input  codes  during
power-off   time,   allowing   the   DAC   outputs   to   be
available  immediately  after  power-up  with  the  saved
settings.  This  feature  is  very  useful  when  the  DAC
device is used as a supporting device for other devices
in the application’s network.
The  MCP4728  device  has  a  high  precision  internal
voltage reference (VREF= 2.048V). The user can select
the  internal  reference  or  external  reference  (VDD)  for
each channel individually.
Each  channel  can  be  operated  in  Normal  mode  or
Power-Down    mode    individually    by    setting    the
configuration register bits. In Power-Down mode, most
of the internal circuits in the powered down channel are
turned off for power savings, and the output amplifier
can be configured to present a known low, medium, or
high resistance output load.
Since the evaluation board above uses I2c then you could possibly interface with the Rpi

Another device that would work with the Rpi would be the https://www.sparkfun.com/products/12918
Quote:
SparkFun I2C DAC Breakout - MCP4725 $4.95/ea

Description: You’ve always wanted to output analog voltages from a microcontroller, the MCP4725 is the DAC that will let you do it! The MCP4725 is an I2C controlled Digital-to-Analog converter (DAC). A DAC allows you to send analog signal, such as a sine wave, from a digital source, such as the I2C interface on the Arduino microcontroller. Digital to analog converters are great for sound generation, musical instruments, and many other creative projects!
This version of the MCP4725 Breakout fixes a few issues with the board including the IC footprint, the I2C pinout, changes the overall board dimensions to better fit your projects, and a few more minor tweaks. This board breaks out each pin you will need to access and use the MCP4725 including GND and Signal OUT pins for connecting to an oscilloscope or any other device you need to hook up to the board. Also on board are SCL, SDA, VCC, and another GND for your basic I2C pinout. Additionally, if you are looking to have more than one MCP4725 on a bus, the pull-up resistors on this board can be disabled just check the Hookup Guide in the Documents section below for instructions and tips on doing this.
Features:
  • 12-bit resolution
  • I2C Interface (Standard, Fast, and High-Speed supported)
  • Small package
  • 2.7V to 5.5V supply
  • Internal EEPROM to store settings
Documents:
By following the hookup guide you can add several devices on the I2c therefore having more DAC for multiple outputs.
Hope this helps.
Have fun And enjoy!
 
  


Reply

Tags
analog, odroid, python, raspberrry pi


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Analogue output professional single board computer Boniato Linux - Embedded & Single-board computer 14 08-03-2017 09:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration