Book Image

Learning Beaglebone Python Programming

Book Image

Learning Beaglebone Python Programming

Overview of this book

Table of Contents (19 chapters)

ADC


The BeagleBone has 7 available inputs to its analog-to-digital converter (refer to Appendix A, The BeagleBone Black Pinout to see which pins support analog inputs). The ADC can approximate voltages at each of these pins between 0 V and 1.8 V. As mentioned in Chapter 1, Before We Begin, putting voltages greater than 1.8 V on any of the ADC's input pins will damage your BeagleBone. That doesn't mean we can't measure higher voltages with it, we just need some external circuitry to do so.

Voltage divider

The simplest method for measuring voltages greater than 1.8 V is to use a voltage divider, which is simply composed of two resistors in a series between your voltage source and 0 V, with the output being the node between them:

The output voltage is calculated by the formula R2 / (R1 + R2) * VIN. So if VIN is 3.3 V and both resistors are 10 kΩ, then VOUT will be 1.65 V, and if VIN is 5 V, R1 is 10 kΩ, and R2 is 5 kΩ, then VOUT will be 1.67 V. So with those two examples, we could easily monitor...