Volume Potmeter please how ???

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
Redcat
 
Posts: 10
Joined: Fri Jun 30, 2017 12:56 pm

Volume Potmeter please how ???

Post by Redcat »

Hi folks,

Ive been scouring the internet, found various topics on this, but i just cant even get started with it..
I have a Pi3 with the official 7"screen, a hifiberry dac+ and a mausberry shutdowncircuit..

I know i should be able to connect a potmeter to the GPIO pins, and upload/install a script which makes the potmeter control the master volume.
This project is for my car and i cant safely rely on a GUI to control volume, it needs to be a turnable knob.

I would massively appreciate any tips or tricks on this so i hope ive come to the right place?

Theres this page https://volumio.org/forum/gpio-pins-con ... t2219.html but the script download isnt working and theres no response from anyone since its an aged topic..


Please please anyone ;)

PS: Sure, i know somewhere in the big ol' internet there will be a topic with a solution already but i found nothing that i could use yet

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Volume Potmeter please how ???

Post by adafruit_support_bill »

You can't do it with just a potentiometer using the GPIO pins on a Pi, since the Pi does not have any analog input capability. You could use an ADC chip like this one to read an analog value from a pot: https://www.adafruit.com/product/856 Or you could use a rotary encoder: https://www.adafruit.com/product/377

User avatar
Redcat
 
Posts: 10
Joined: Fri Jun 30, 2017 12:56 pm

Re: Volume Potmeter please how ???

Post by Redcat »

See, i knew ive come to the right place!
that link i posted seemed helpful but it wasnt for my project (strange cause the guy that posted on it said it "wasnt hard")

So i guess i should go with that MCP chip then, and ill be going over the tutorial as well, i hope i will get it working like this, if not im sure someone will have all the answers here :)

Thanks so much mate! This has taken the hell out of "how the hell..."

Just a quick question though, can i use a potmeter WITH this chip or is it better to get a rotary encoder?

AND, can i wire this chip onto the GPIO pins?
Im asking about this cause i also have the hifiberry installed :)

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Volume Potmeter please how ???

Post by adafruit_support_bill »

The MCP3008 would allow your Pi to read analog values. You connect the MCP3008 to your GPIO and connect the potentiometer to the input of the MCP3008. We have a tutorial for that here: http://learn.adafruit.com/reading-a-ana ... spberry-pi

If you use a rotary encoder instead of a potentiometer, you can connect it directly to the GPIO pins. There is a link to a library for that here: https://blog.adafruit.com/2013/01/18/ro ... pberry_pi/

User avatar
Redcat
 
Posts: 10
Joined: Fri Jun 30, 2017 12:56 pm

Re: Volume Potmeter please how ???

Post by Redcat »

I ordered the mcp as it costs so little and i have two rotary just bought, a 10k and a 50k

Itll be fun to get the chip working i think..

Thank you so much mate this really helps my project forward since i was completely stuck!

User avatar
Redcat
 
Posts: 10
Joined: Fri Jun 30, 2017 12:56 pm

Re: Volume Potmeter please how ???

Post by Redcat »

A new question :D

I have the chip sitting here and im now working out where to solder which wire on to..
I can work out some of them beeingVVD and VREF to 3.3v so id say there are two, so pick those?
Then theres CLK which i assume goes to the pin that says PCM_CLK right?
But then, where do D-In, D-Out, CS and DGND go?
What i did already figured is based on this layout http://www.raspberrypi-spy.co.uk/2012/0 ... rettyPhoto

Now, i dont want to screw myself by attaching a wire onto the wrong GPIO pin, then theres also the potentiometer im curious about, as it has 6 pins.. well, 3 but its stereo of course..
The Potmeter i got is this logarithmic 10k http://www.tme.eu/html/EN/piher-potenti ... pelny.html

User avatar
Redcat
 
Posts: 10
Joined: Fri Jun 30, 2017 12:56 pm

Re: Volume Potmeter please how ???

Post by Redcat »

I should add, im not using that cobbler, cause i have the hifiberry installed so i need to solder to that..

26 pins on the cobbler, 40 on the pi :) thats where i get lost with these

User avatar
adafruit_support_bill
 
Posts: 88136
Joined: Sat Feb 07, 2009 10:11 am

Re: Volume Potmeter please how ???

Post by adafruit_support_bill »

The cobbler is based on earlier versions of the Pi which had just 16 pins. The 40 pin header on the newer Pis is just an extension of the original header. The first 26 pins are the same, so the wiring diagrams are still valid for what you are doing.

User avatar
Redcat
 
Posts: 10
Joined: Fri Jun 30, 2017 12:56 pm

Re: Volume Potmeter please how ???

Post by Redcat »

alright! i will look into this then, thank you again!

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”