LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   Best Single Board Computer for Analog output (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/best-single-board-computer-for-analog-output-4175612135/)

Boniato 08-17-2017 09:48 AM

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.

schneidz 08-17-2017 10:06 AM

would 2 raspberry-pis do the trick ?

http://www.linuxquestions.org/questi...9/#post5712498

Boniato 08-17-2017 10:09 AM

Quote:

Originally Posted by schneidz (Post 5749285)
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.

pan64 08-17-2017 10:21 AM

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

onebuck 08-17-2017 02:55 PM

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 (Post 5749281)
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!
:hattip:

Boniato 08-18-2017 05:26 AM

Quote:

Originally Posted by onebuck (Post 5749384)
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!
:hattip:

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.

onebuck 08-18-2017 09:22 AM

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!
:hattip:


All times are GMT -5. The time now is 11:52 PM.