Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Beaglebone Python Programming

You're reading from  Learning Beaglebone Python Programming

Product type Book
Published in Jul 2015
Publisher
ISBN-13 9781784399702
Pages 196 pages
Edition 1st Edition
Languages

Potentiometers


Another option for user input is to use the ADC to read the position of a potentiometer. Let's revisit some of the things you learned in Chapter 4, PWM and ADC Subsystems, to make our program a bit more interesting.

For this circuit, you will need:

  • Breadboard

  • 2x potentiometers

  • 1x 5 mm LED

  • 1x CdS photocell (also known as photoresistor / light-dependant resistor / LDR)

  • 2x 10 kΩ resistor

  • 1x 4.7 kΩ resistor

  • 1x 68 Ω resistor

  • 1x 2N3904 NPN transistor

  • 1x LM358 (or similar rail-to-rail op-amp)

  • Jumper wires

Put it all together on your breadboard, as shown in the figure:

This circuit might look a lot more complicated than what we've done so far, but really it's just a combination of a few of the earlier circuits. The only difference is the configuration of the op-amp.

Here it is being used to buffer the output of a 2:1 voltage divider across the 3.3 V rail, which creates a 1.65 V reference voltage. Let's take a look at the following diagram:

This 1.65 V reference is then being used by the two potentiometers...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}