Control output volatage of GPIO pins

Post Reply
joe2321
Posts: 2
Joined: Sun Sep 15, 2019 8:04 am
languages_spoken: english
ODROIDs: Currently nothing but I plan to purchase something in the near future.
Has thanked: 1 time
Been thanked: 0
Contact:

Control output volatage of GPIO pins

Unread post by joe2321 » Sun Sep 15, 2019 8:06 am

On any Odroid computer, is there a way to control the output of the voltage, cause lets say if I wanted to build my own drone that is controlled by an Odroid, off course I would want to dynamically control how much voltage is being inserted into the motor fans using code, is this possible?

User avatar
mad_ady
Posts: 6674
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 194 times
Been thanked: 148 times
Contact:

Re: Control output volatage of GPIO pins

Unread post by mad_ady » Sun Sep 15, 2019 7:13 pm

In theory you could use the analog pins and set the voltage to an arbitrary level (between 0 and 1.8V). However they won't provide enough curreng to drive a motor, so you'll need to control some other circuit in-between.
These users thanked the author mad_ady for the post:
joe2321 (Sun Sep 15, 2019 8:22 pm)

joe2321
Posts: 2
Joined: Sun Sep 15, 2019 8:04 am
languages_spoken: english
ODROIDs: Currently nothing but I plan to purchase something in the near future.
Has thanked: 1 time
Been thanked: 0
Contact:

Re: Control output volatage of GPIO pins

Unread post by joe2321 » Sun Sep 15, 2019 8:23 pm

mad_ady wrote:
Sun Sep 15, 2019 7:13 pm
In theory you could use the analog pins and set the voltage to an arbitrary level (between 0 and 1.8V). However they won't provide enough curreng to drive a motor, so you'll need to control some other circuit in-between.
So if I have some other circuit in-between, then is it possible to use code to change the voltage output? Is it also possible to change the amps as well?

User avatar
mad_ady
Posts: 6674
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 194 times
Been thanked: 148 times
Contact:

Re: Control output volatage of GPIO pins

Unread post by mad_ady » Sun Sep 15, 2019 9:53 pm

Voltage yes, but current no. The circuit will draw what it needs: https://wiki.odroid.com/odroid-c2/appli ... e/gpio/adc

User avatar
odroid
Site Admin
Posts: 32355
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 145 times
Been thanked: 325 times
Contact:

Re: Control output volatage of GPIO pins

Unread post by odroid » Mon Sep 16, 2019 9:51 am

I think he might need a few PWM or DAC outputs for motor speed control.

Since the number of PWM/DAC ports are very limited and accuracy is poor too, you need an I2C-PWM board something like this probably.
https://www.adafruit.com/product/815

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: Google [Bot] and 2 guests