Control solenoid valve via odroid

Post Reply
pettaa123
Posts: 7
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Control solenoid valve via odroid

Unread post by pettaa123 » Wed Nov 06, 2019 7:39 pm

Hi, I'm a programmer and I did a small gui application on an odroid. From this I have to analyse two
analog sensor data (pressure and piezo). I think I can use AIN's for that. My question is: How can I achieve to control
a litte solenoid valve with 0-10V or 0-20 mA? I am thankful for any advice :)

User avatar
tobetter
Posts: 4106
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 46 times
Been thanked: 207 times
Contact:

Re: Control solenoid valve via odroid

Unread post by tobetter » Wed Nov 06, 2019 8:06 pm

I think you can start from these links that explain how you can control GPIO, also please note that the high level of GPIO output on ODROID-XU3/4 is 1.8V.
https://wiki.odroid.com/odroid-xu4/appl ... ent_30pins
https://wiki.odroid.com/odroid-xu4/appl ... o/wiringpi

pettaa123
Posts: 7
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Control solenoid valve via odroid

Unread post by pettaa123 » Wed Nov 06, 2019 10:42 pm

I think I can buy a shifter shield and solder two resistors on the free slots to build a https://en.wikipedia.org/wiki/Voltage_divider. With this I can read a downscaled a 0-10V signal.

Has anyone an idea how to control a solenoid? How can I create a 0-10V signal from GPIO?

pettaa123
Posts: 7
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Control solenoid valve via odroid

Unread post by pettaa123 » Thu Nov 07, 2019 12:35 am

I want to wire my input sensors(piezo and pressure) like in the attachement. Will this work? I have hardely any knowlege on electronics... Any suggestions for controlling output between 0-10V?
Attachments
Bildschirmfoto vom 2019-11-06 16-29-30.png
Bildschirmfoto vom 2019-11-06 16-29-30.png (197 KiB) Viewed 174 times

User avatar
tobetter
Posts: 4106
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1
Location: Paju, South Korea
Has thanked: 46 times
Been thanked: 207 times
Contact:

Re: Control solenoid valve via odroid

Unread post by tobetter » Thu Nov 07, 2019 12:47 am

You can use TR or Relay with input from GPIO in order to drive the solenoid
https://web.cecs.pdx.edu/~eas199/B/howt ... iring.html

pettaa123
Posts: 7
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Control solenoid valve via odroid

Unread post by pettaa123 » Fri Nov 08, 2019 6:58 am

Awesome thanks! I have a solenoid valve which opens proportional to the voltage/current. Is there a library which let me use PWM on any digital Output of the odroid? Is PWM compatible with the shifter shield?

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

Re: Control solenoid valve via odroid

Unread post by odroid » Fri Nov 08, 2019 11:47 am

Unfortunately, there is no PWM output from XU4 GPIO header while ODROID-C1/C2/N2 have a couple of PWM ports. Sorry about that.

Software driven PWM can't be used due to very inaccurate real time control. Consider using an I2C-to-PWM add-on board something like this.
viewtopic.php?f=52&t=25025&p=271868#p271868
https://www.ebay.com/itm/New-PCA9685-16 ... 2283707473

This kind of very cheap level-shifter also works well with XU4 1.8Volt I2C interface.
https://www.ebay.com/itm/Level-Conversi ... 1831971329

pettaa123
Posts: 7
Joined: Mon Oct 28, 2019 9:40 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: Control solenoid valve via odroid

Unread post by pettaa123 » Wed Nov 13, 2019 2:16 am

Thanks! So just for the record: There is no analog out aswell?
Can I readout analog In values also with your wiringPI fork or do I have to use your c code from the example?
https://wiki.odroid.com/odroid-xu4/appl ... e/gpio/adc

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

Re: Control solenoid valve via odroid

Unread post by odroid » Wed Nov 13, 2019 9:01 am

There are two ADC input pins on the XU4 and you can access it via our WiringPi fork.
But there is no DAC output for your proportional solenoid control.

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: algirdasc and 7 guests