Raspberry Pi LESSON 15: Analog Input on the Raspberry Pi Using the ADC0834

preview_player
Показать описание
Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!

In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)

In this lesson I will show how to do analog reads with the Raspberry Pi. This will be done using the ADC0834 Analog to Digital Converter Chip.

If you want to grab those cool little straight jumper wires I am using to keep my breadboard builds neat and clean you can snag a box of them here:

If you guys are interested in the oscilloscope I am using, you can pick one up here (affiliate link):

You guys get your hardware ordered so you can follow along at home!

You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:

The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:

I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi. We demonstrate this by using a button switch to control a LED.

You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

#VPYTHON
#RESISTTHEMETAVERSE
#RASPBERRYPI
Рекомендации по теме
Комментарии
Автор

Hi Paul, not sure if you still read the commens from these older videos, but I do have some feedback. This video, unlike the others so far, seems be more of a "do what I say" video instead of "here's why we're doing this". Why did we setup the circuit like that? What are the reasonings behind the actions we perform? This video doesn't feel like it teaches the reasoning behind the actions, more like it's just saying "go here, do this, because I said so." It would have been nice to go over the schematic and give information as to why we wire it up like we do, or briefly go over the library and explain how it works and the logic behind it. Also, the library is set to use the GPIO 17, 18, and 27, so saying that it doesn't need arguments when running ADC0834.setup() is a bit of a misnomer if someone were to wire it up without using those exact GPIO pins in the future, and could cause undue stress if the person doesn't know to look in the library to see why it isn't working. This series has been good about explaining the reasons why we do things, but this video is a bit of a letdown in that regard, sadly.

Leonilian
Автор

Enjoyed this lesson. Seeing those numbers from the pot change is as much fun as seeing the red led come on. It's funny how you get older it's the simple things that satisfy. God Bless and have a great birthday.

opalprestonshirley
Автор

Hi Paul! Just a tip I learned while playing around with various DIP ICs with the tiny little fragile legs mounted onto breadboards; sometimes they can grab on pretty tight and don’t wanna come out. If you don’t have an IC puller, just run a small piece of insulated wire through the breadboard trough underneath the IC, come back up and make a loop and pull straight upward. If you pull slowly and carefully this usually keeps the legs from bending at all for me. Again, great lesson Paul.

ShinesMonkey
Автор

Hi Paul, It could be a little confusing to the new comers when they see that you reversed the V+ and GND jumpers.

donaldhoudek
Автор

Hello Paul! Very good lesson. Thank you for all the hard work putting these lessons together.

markbooco
Автор

Excellent as always, btw there is a young eng. named Mark Rober that just started Crunch Labs and is making monthly kits for kids 8-12 to learn and also does a video on how to assemble the kits and the principles behind it. HIs new lab is over the top!

TheUnofficialMaker
Автор

Nothing to say... Just outstanding lesson.. U r real magic man🙏

pralaymajumdar
Автор

Had a few issues as my software is newer, Raspian / Linux 11 is Bullseye and Python is ver 3.9. Thanks to comments and your tip how to configure Thonny were very helpful.

dphair
Автор

Thanks again for the great lesson!

I have 2 issues:

1) the reading of the potentiometer is not constant. It gives a value, followed by some zero's, then a value again... Is the simple solution to switch ground and 5V on the potentiometer?
2) when I turn the meter to te left, the value increases and the other way around

What do I do wrong?

upperlip
Автор

Ahhhh! I couldn’t do it! I could not make the red rail the ground and the blue one 5V. My OCD over powered my ADD.

warrenscorner
Автор

Thank you for all the great videos! In this video you sort of hand wave over why the ADC0834 is safe at 5v. I've googled this and cannot find a clear answer why this is safe. My main concern is that I often use a debugger and if I set a breakpoint when the gpio input is high it reads 5v (I tested this but disconnected the DIO lead first). I'm wondering if it's considered safe due to a data stream of highs and lows -- where hitting a breakpoint when it's high might fry my PI v4. Any thoughts?

davemessink
Автор

I couldn't get the program to run. I was getting "setup has no attribute". After a lot of tinkering, I ended up removing the last block of code in the library (from "if __name ... to the end of the file) and it worked. Not quite sure what are the side effects of that and the reasoning behind this if statement and the loop function. If you're stuck with the same problem that could help. I would have love to get an explanation of the libraries code. Thanks for the great content Paul, I am having a blast!

LowProFile
Автор

I am legend. What a fun lesson. Ill submit the HW later today

mmulisha
Автор

Why did you not use the + and - of the breadboard?

jameslewellen
Автор

Hi Paul, I just received The Sunfounder kit, which is exceptional value and has all that's required, compared with the $100s I've spent on my Arduino for much less. I'm now eagerly waiting for the jumper wires which are 840 compared with kits I've been buying for same price with about 40 jumpers and poor length and color selection. Thank you.

davidbundy
Автор

Dear sir
I got really confused after watching this video
You have made a great jump and I couldn’t follow
I have been so patient throughout the last 14 videos but suddenly I got lost
Please help me out
Where to start
I even went to the playlists you have made and decided to start over from the arduino videos you made 8 years ago to get everything from the very beginning
I hope that will work
I’m a 45 year old pharmacist and trying to learn something
But I have no clue about electricity or programming
So I want to learn from the very beginning and without any great jumps
So is it going to be good for me to pause the raspberry pi videos now and start fresh again with those older videos??

tamerghaly
Автор

I AM LEGEND! Thanks for showing us the workaround for Raspberry Pi omitting analog inputs, Paul. Is it normal for the RPi to work with 5v inputs?

cbrombaugh
Автор

i got this working. I just dont understand how you know where to put the pins bc they are not designated in the program.

captinkrazy
Автор

Paul - can you explain the ADC interface and how it functions? I was successful however I do not understand the interface and how the PI reads from the ADC0834

PlausibleIdea
Автор

Hi Paul! Although my breadboard has the numbering growing from left to right like shown in your video, positive and negative rows are ordered differently. Should I connect the wires the same way you did, or should I consider that positive and negative are in a different row and stick to that?

alexandrebrittopereira
join shbcf.ru