Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OrangePI One+ (H6) and GPIO 26pins

Featured Replies

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

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

  • Author

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

  • Author

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

  • Author

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.

  • Author

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

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.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.