Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Beaglebone Python Programming

You're reading from   Learning Beaglebone Python Programming Unleash the potential of BeagleBone using Python

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781784399702
Length 196 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alexander C Hiam Alexander C Hiam
Author Profile Icon Alexander C Hiam
Alexander C Hiam
Arrow right icon
View More author details
Toc

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:

Potentiometers

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:

Potentiometers

This 1.65 V reference...

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 $19.99/month. Cancel anytime
Banner background image