Analog input cape/wiring scheme

Hi,

I want to use the analog inputs of the BBB but not with a range of 0…1,8 V but with 0…5V (which is more “natural” for most applications). Software side is not a problem, but for hardware side I’m not sure how to deal with AIN, AGND and ADC.

So my question: is there a open-hardware-cape or a reference schematic available where I could have a look into?

Thanks

Heinz

I use a single rail opamp to level convert and protect the analog input.

Hi there

Probably not. With the onchip ADC, all the software( drivers etc ) are
already written for you. Using an external SPI ADC you have to deal with
additional costs, additional circuitry, and additional software, which is
on you to create. Not only that, you will probably still have to level
convert, in order to make sure the input on the ADC does not swing too
high. You also need to isolate the pin.

I'd say an I2C ADC would be a better choice, and it would be except. You
would have to deal with everything i mentioned about an SPI ADC. Except
writing the "driver" software would be much easier to deal with.

Hi there

Probably not. With the onchip ADC, all the software( drivers etc ) are
already written for you. Using an external SPI ADC you have to deal with
additional costs, additional circuitry, and additional software, which is
on you to create.

There is already a SPI interface. Simply hook it up.

Level translating the analog signal is much more complicated. You would have to buffer the 0 to 5 volt signal. Then feed it to a resistor divider with a pot to calibrate. And then buffer it again (use fixed font);

             Opamp

          + |\
  In >-------| \
  0 | >---*------+
  to +---| / | |
  5V | - |/ | +++
         > > > >
         +----------+ | |

From a software developers perspective, I2C is far simpler. One call to
ioctl() to set the mode of the file descriptor, then you simply start
reading from whichever registers you need. Also, since the onboard PMIC,
and EEPROM both use I2C interfaces. The buses already exist, are in use,
the drivers, and software *have* to work. Otherwise the board does not
function at all. Can we simply "plug in" to one of these two I2C buses to
save pins ? I do believe so yes. It's been a while since I've looked into
that. I think one can use i2c-2 for sure, but I'm not sure if one can also
tie into the I2C bus which the PMIC is connected to or not.

SPI conversely is not required for the board to function. So drivers are
not necessarily already loaded, and functioning. SPI also uses at minimum 3
pins. 2 data lines, and a CS pin. I have heard of, and seen 1 "wire" SPI
implementations, but I'm not sure that could be made to work easily in
Linux. Since most software implementations use SPIDev. Which is master mode
only SPI. Not that this matters for using an externally interface device,
such as an ADC.

I still think it's much easier to use the on chip ADC. We're using it here
for a custom cape. Using one opamp, and a voltage divider. Input is 0-10v
dc, and the resistor network limits the voltage to 1.5v max, Which does
limit the resolution *some*, but you most definitely do not want to go over
1.8v on the ADC. As stated in the TRM.

By the way, the whole software interface for the on chip ADC is already in place, and functional. You simply need to load the driver, or have a device tree overlay do that for you. Then you setup the IIO driver to tell it if you would rather operate in single-shot, or continuous mode. Then you simply read from the “buffer file”. If you’re still unconvinced. Google “beaglebone ADC” and learn how simple the software side really is. There are many blogposts out there on the subject. One of which is mine, but seems to be down at this moment.

Thaks for all the ideas what perhaps could be done different. But to come back to my original question: is there an open-hardware-cape or a wiring schematic available somewhere which utilitises the ADC inputs and I could use as starting point for my own layout?