0
madurani

Orange Pi Zero Plus and relay functionality issue:

Recommended Posts

Hello,

 

I have problem with "Orange Pi Zero Plus" and functionality of Relay module (electrical circuit= normally closed).

Relay module is attached on pin/port number "0".

When I set up pin number "0" from "OFF" to "OUT" state with command:

gpio export 0 out

state is changed from OFF to OUT and parameter in column "V"  is "0". It should mean that relay stays turned of.

+------+-----+----------+------+---+
| GPIO | wPi |   Name   | Mode | V |
+------+-----+----------+------+---+
|   12 |   0 |    SDA.0 |  OUT | 0 | 

Problem is, that relay immediately after execution of mentioned command enables(turns on) output electrical circuit. Relay module is behaving like it was turned on, however it is not supposed to be (since 0= turned off). 

 

I can change this inconvenient situation with command for turning on (1=turned on) and output is then turned off.  These commands work, but they work in reversed way and in result everything works reversed. 

   gpio write 0 1

 

gpio write 0 0 >>> should turn off output circuit, for me it turns circuit ON

gpio write 0 1 >>> should turn on output circuit, for me it turns circuit OFF

I hope this was clear, it is hard to describe what is happening. 

Can anyone please advise me on what is going wrong and how to fix my issue?

Thank you

 

Share this post


Link to post
Share on other sites

Have you tried using sysfs directly? 

Have you recheck the port used? The formal is (Position of letter in alphabet - 1) * 32 + Pin number

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
0