Jump to content

Recommended Posts

Posted

Hello, I have read a lot of posts, but I can't control the gpio pins on my orange one+ (Armbian buster-Linux 5.4.28-sunxi64). Currently I open/close the gate and other doors of my home through my Rpi 2 gpio and a 8 relay module, I would like to replace this with the opi, but I can't find the way.  Could you help me? Thanks,

 

Marco

Posted
7 hours ago, Marcomarco said:

Hello, I have read a lot of posts, but I can't control the gpio pins on my orange one+ (Armbian buster-Linux 5.4.28-sunxi64). Currently I open/close the gate and other doors of my home through my Rpi 2 gpio and a 8 relay module, I would like to replace this with the opi, but I can't find the way.  Could you help me? Thanks,

 

Marco

https://linux-sunxi.org/GPIO#Accessing_the_GPIO_pins_through_character_device_with_mainline_kernel

Posted

Thank you Igor for the reply, but I'm not solving the problem.  The relay doesn't open or close the contact,  the pin is PD21 number 117 (d-1)*32+21

 

root@orangepioneplus:/home/pi# ls /sys/class/gpio
export  gpio117  gpiochip0  gpiochip352  unexport
root@orangepioneplus:/home/pi# ls /sys/class/gpio/gpio117/
active_low  device  direction  power  subsystem  uevent  value
root@orangepioneplus:/home/pi# echo out >/sys/class/gpio/gpio117/direction
root@orangepioneplus:/home/pi# cat /sys/class/gpio/gpio117/direction
out
root@orangepioneplus:/home/pi# echo 0 >/sys/class/gpio/gpio117/value
root@orangepioneplus:/home/pi# cat /sys/class/gpio/gpio117/value
0
root@orangepioneplus:/home/pi# echo 1 >/sys/class/gpio/gpio117/value
root@orangepioneplus:/home/pi# cat /sys/class/gpio/gpio117/value
1
root@orangepioneplus:/home/pi#
 

Everything seems to work but the relay doesn't open/close the contact. I checked the relay and it worked perfectly through my Rpi 2 gpio

Posted
7 minutes ago, Marcomarco said:

Everything seems to work but the relay doesn't open/close the contact.

How did you wired the relay ?

Do you use a MOSFET to drive it ?

 

Posted
1 hour ago, Marcomarco said:

I used the same wires on Rpi2 and on the opi 1+. I attached a picture

I can't see clearly what are the pins on this relay board, neither if it is using a MOSFET or not, which is important since GPIO are 3V only ...

 

Posted

Thank you for your reply martinayotte. I don't know my Opi 1+, I used the pin 2 for Vcc 5v, the pin 6 for GND and the pin 8 PD21 for the comand. This is a simple relay module 5v bought 2/3 years ago that I use for tests.

Tomorrow I'll try with a different relay module.

IMG_20200412_001345.jpg

Opi oneplus gpio.jpg

Posted
1 hour ago, Marcomarco said:

I'm very happy, the relay works perfectly. I used for the power the pin 1 (VCC 3.3v) and the relay opens/closes the contact.

What change did you do ?

Changing VCC pins ?

This maybe means that this board react strangely if powered from 5V ...

Posted

Yes, I changed the VCC pin from 5v (no.2) to 3.3v (no.1). I always use this relay in 5v in the raspberrypi and it works proprely, we can read the stamp on the relay 05vdc so I think that the right power is 5v.

In the orange pi is different:

15 hours ago, martinayotte said:

GPIO are 3V only ...

I didn't know that, I changed the pin and everything works. Thanks

Posted

Most of theses relays are designed to work with 5v power supply and thus have an input  theshold between 0 and 1 somewhere in the middle voltage (2 - 3v). As a GPIO pin of an orange pi works between 0 and 3.3v. Sometime the switching to 1 does"nt wok as the input level is not high enough.

Powering the relay with 3.3v allows to solve the issue as the input  threshold moves down around 1.5v. The drawback is that the mechanical energy to swith the rely is lower and the electrical contact could be affected.

Some of these blue relays have 2 power inputs. The 5v to power the mechanical part and the 3.3v to power the optical isolator at the input. This is the best solution to correctly switch.

 

If you need some info on the GPIO for the Orange Pi One plus , I wrote an article on the subject.

https://f1atb.fr/index.php/2020/06/16/gpio-on-orange-pi-one-plus/

 

Regards

Ham radio F1ATB

André

 

 

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines