Page 1 of 1

Headphone jack as input

Posted: Thu Apr 14, 2016 10:05 pm
by Willpiam
Hello everyone my name is William and I've started a new rip project.
I'm trying to make a camera. Yes it's been done before but I figured it would be an intresting project to try. Once I have it working I'll be trying to get it as compact as posable maybe even using one of those fancy new raspberry Pi zeros.
Anyway the project requires some form of input for Python to know when to take a picture. I was doing some thinking and came up with the idea of using a headphone wire with a play/pause butten to do this job. I was wondering if anyone knows if this is even posable and if it's been done before. thanks in advance, William

Re: Headphone jack as input

Posted: Thu Apr 14, 2016 10:14 pm
by mikronauts
Not possible to use the headphone jack.

Use one of the GPIO pins, wired as follows:

3.3V -----/\/\/\/\/---------> GPIO <--------(switch)----/\/\/\/\/\/------- GND

The resistor connected between 3.3V and the GPIO should be 10k ohms

The resistor between GND and the far side of the switch should be 470 ohms

Edit: removed second switch
Willpiam wrote:Hello everyone my name is William and I've started a new rip project.
I'm trying to make a camera. Yes it's been done before but I figured it would be an intresting project to try. Once I have it working I'll be trying to get it as compact as posable maybe even using one of those fancy new raspberry Pi zeros.
Anyway the project requires some form of input for Python to know when to take a picture. I was doing some thinking and came up with the idea of using a headphone wire with a play/pause butten to do this job. I was wondering if anyone knows if this is even posable and if it's been done before. thanks in advance, William

Re: Headphone jack as input

Posted: Thu Apr 14, 2016 10:16 pm
by Willpiam
Okay. Does it simply not have the right hard wear to acknowledge a butten press from the jack?

Re: Headphone jack as input

Posted: Thu Apr 14, 2016 10:30 pm
by MarkHaysHarris777
Willpiam wrote:Okay. Does it simply not have the right hard wear to acknowledge a butten press from the jack?
William, hi, what PI do you have?

On the 2B and the 3B the 'headphone' jack is not a mic|headphone (with mic button), its a stereo output in combination with a composite video output!

The GPIO block is what you want to learn to program; as mentioned before.

Re: Headphone jack as input

Posted: Thu Apr 14, 2016 11:51 pm
by klricks
Willpiam wrote:Okay. Does it simply not have the right hard wear to acknowledge a butten press from the jack?
Although many headphones can work, the 'headphone jack' on the RPi is not really a headphone jack. It's an AV output similar to the AV output on a camcorder/ digital camera. The RPi audio is 'line out' and is intended to be connected to amplified computer speakers or the red /white audio inputs on a TV or stereo equipment.

Re: Headphone jack as input

Posted: Fri Apr 15, 2016 12:32 am
by Willpiam
The model I have is just the B as far as I know. Eather way it looks like the answer is the same use the gpio pins. looks like I have a trip to the electronics shop in the near future. :D anyway thanks everyone for your awnsers it'll be a neat project.