how to make joystick control electricty?

I would like to use a joy stick to control electricity up to 3 volts.

We are doing an experiment called galvanotaxis to control protozoa

They are attracted to negative voltage i would like to see id we can control their movements.

Normally in a very basic setup you have 2 poles Ether connected to a (platinum wire or lead from a pencil) at the opposite of each other as power increases they swim towards the negative.

up and down and left and right would be fine but 8 degree axis would be amazing!

does anyone have an example on how to do the controls for this?

Thank you :slight_smile:

Tommy

you can use a joystick to control a servo or stepper motors there are a few tutorials around with joystick controllers

TommyGunn:
I would like to use a joy stick to control electricity up to 3 volts.

We are doing an experiment called galvanotaxis to control protozoa

They are attracted to negative voltage i would like to see id we can control their movements.

Normally in a very basic setup you have 2 poles Ether connected to a (platinum wire or lead from a pencil) at the opposite of each other as power increases they swim towards the negative.

up and down and left and right would be fine but 8 degree axis would be amazing!

does anyone have an example on how to do the controls for this?

Thank you :slight_smile:

Tommy

Hello and welcome to the forum.
If you want to control the voltage using a joystick you can run electricity from the Arduino to the joystick potentiometer and measure the output electricity by that you'll know the joystick location.
The schematic should look like this:


Afterwards, you can get the input on the Arduino by reading the voltage from pins A0 or A1
and then you can simply use the function: analogWrite(<pinNumber>, analogRead(A0) * 0.1494)
and then the output pin will provide electricity acording to the joystick position when it's on the highest position it'll provide 3V and on the lowest 0V

Joysticks are often simply potentiometers.
Put three volts across one of the potentiometers, and the wiper connection will vary between zero volts and three volts.

No need for an Arduino.

Ignore what @dindibo4 said about analogWrite, it's rubbish, without extra hardware.
analogWrite produces only 0 volts or close to the supply voltage at a low frequency.

dindibo4:
and then the output pin will provide electricity acording to the joystick position when it's on the highest position it'll provide 3V and on the lowest 0V

No, that's not how analogWrite works. It would put out a PWM signal alternating between 0V and 5V with an average value of 3V. That wouldn't work for what the OP wants at all.

Delta_G:
No, that's not how analogWrite works. It would put out a PWM signal alternating between 0V and 5V with an average value of 3V. That wouldn't work for what the OP wants at all.

Depending on the applications he uses that for, it might work.
For example, dimming an LED controlling servo...

dindibo4:
Depending on the applications he uses that for, it might work.
For example, dimming an LED controlling servo...

Did you even read the original post?

Not an RC servo, obviously.

dindibo4:
Depending on the applications he uses that for, it might work.
For example, dimming an LED controlling servo...

You need to work on your reading skills. Go look at the OP. This isn't about LEDs. And no, this isn't the type of PWM that you would use for a servo. The OP was quite specific about the application.