Posts: 1
Joined: Sat Nov 18, 2017 1:00 pm

Using pi for pwm remotely

Sat Nov 18, 2017 1:31 pm

Hi, i hope this is the right forum,
I want to make an electric skateboard,
for the remote control i was hoping to use raspberry pi, i know the you can use pwm with pi, but my question is how can i use a potentiometer (on the remote) to get a pwm signal (or any indication to use as a power amount) for the pi to use.

Posts: 150
Joined: Sat Apr 04, 2015 4:24 pm

Re: Using pi for pwm remotely

Sat Nov 18, 2017 4:39 pm

you would need to find a programming language and build a script doing what your wanting.
to use the potentiometer with the Pi you would need to use an analog to digital converter so you can feed the digital signal to the Pi
though this would be wired and performed through the GPIO inputs not remotely, you could host code on your Pi which is accessed from your phone, using your phone as the remote(perhaps a slide bar) and that would be performed remotely.

for the ouput youd need to look into digital to analog controllers or a motor control HAT for your raspberry

python is a good language, if it was my project id be looking at using Python, id google "raspberry python variable speed motor" and attempt to get that running first, then you could change the input to be what you wanted.

if you was to use something like a tkinter slider to adjust the motors you could test it all on the bench with a mouse and keyboard then after access the same code from your phone using VNC or putty or some other remote access software.

User avatar
Posts: 8493
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Using pi for pwm remotely

Sat Nov 18, 2017 6:58 pm

Maybe look at the gpiozero Python library module.

There is a recipe here that demonstrates how to control a pwm output with a potentiometer. ... entiometer

If you need to physically separate the two forms of connection, combine that with the ability to control gpio features on a remote RPi: ... _gpio.html

Return to “Beginners”