Analog (2-axis joystick) input for moving servos with Raspberry Pi

Thread Starter

Chris_J

Joined Mar 19, 2015
5
Hi,

I have a first time project which I hope is relatively simple overall but I have a few questions about how to get started.

For context, I'd like to mount a camera on a photography hide (shed) with a pan/tilt options. From within the hide I'd like to be able to control the movement of the camera using a thumb-joystick instead of having to type commands. I'd also like to be able to attach a small screen to the Raspberry Pi to stream the image from the camera so I can see what's going on around the hide.

Here is a similar project I found but with the movement of the camera being controlled remotely: http://projectsmax246.blogspot.co.uk/2013/01/webcam-over-3g-with-raspberry-pi.html

I have a small touchscreen (https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi) that would be great to utilise if possible but here's where I get confused. The screen sits on the GPIO pins With the screen attached, does this mean I can't use any of those pins to connect any other peripherals?

For example, this tutorial (http://www.raspberrypi-spy.co.uk/20...raspberry-pi-using-an-mcp3008/#comment-122448) using a joystick shows the need for the breadboard to attach to some of the pins. Would I be able to use something like that and the screen at the same time?

I expect this is a pretty novice questions but I haven't been learning for long.

Thanks for any suggestions.

Chris
 

djsfantasi

Joined Apr 11, 2010
9,156
Just a thought I had while reading your post. With that touchscreen, couldn't you eliminate the joystick and use the screen as pan and tilt input?
 

Thread Starter

Chris_J

Joined Mar 19, 2015
5
Just a thought I had while reading your post. With that touchscreen, couldn't you eliminate the joystick and use the screen as pan and tilt input?
You know, I hadn't thought of that! With my limited knowledge, I'd guess that was a bit more advanced but on the flip-side, eliminates the need for the joystick as you say.

In terms of what I'm trying to achieve then yes, it would fit the bill.

Thanks for your input - happy to receive more pointers on either solution.

Chris
 

MrChips

Joined Oct 2, 2009
30,707
Yes, I did think of the touch screen but that makes it much more complex.
To control tilt and pan, you need a pot, 555 timer circuit and a servo, times two for tilt and pan.
 

djsfantasi

Joined Apr 11, 2010
9,156
So the Raspberry Pi is only used as a remote screen to view what the camera is seeing? Pan and tilt are controlled by analog exclusively?

I assumed you were reading the joystick position by the RPi and then controlling the servo by the RPi... Nevermind.
 

Thread Starter

Chris_J

Joined Mar 19, 2015
5
I might be wrong but the idea would be that the servos are hooked up to the RPi as well as the screen. The joystick provides the input, read by the RPi which then signals the servos. Whatever the camera sees is broadcast on the screen.
 

djsfantasi

Joined Apr 11, 2010
9,156
No, what you describe is what I thought. To answer your original question, from the product page which you linked to, except for GPIO 24 & 25, all other pins are available. I can't tell from the pictures how mechanically they are accessed, but it seems to me to imply that they still can be used. GPIOs 18, 21, 22 and 23 are prought out to the pushbutton locations on the touchscreen board.
 

Thread Starter

Chris_J

Joined Mar 19, 2015
5
The screen comes with a 26 pin connector which I think I've seen referred to as a 'pass-through' therefore I think it's possible to use other GPIO pins which is great despite not having the full 40 on the RPi B+.

I think it's time to get some components and have a play around.
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
I am not sure if anyone has come up with a simple stand alone version of the type of control you get with such as the Parrot drone, this uses any Android pad and as well as multi axis control by just tilting the pad etc, there are two cameras that relay's the image back via the wi-fi link.
Max.
 

Sensacell

Joined Jun 19, 2012
3,432
You could buy a pololu servo controller that accepts serial data as input, use the ras-pi to generate a serial data stream of pan tilt coordinates.
You could read some analog pots with the ADC on the ras-pi to act as the joystick input. Use an analog camera and analog TV as the display, keep it simple.
 

Thread Starter

Chris_J

Joined Mar 19, 2015
5
Thanks for the advice. After a bit of reading, I think I'm getting an idea of how this would work.

There are several tutorials online about how to get analog signals into the RPI using an ADC (
). From there I guess it's a case of creating a program to use the values to control to the servos.
 
Top