Relay connected with RPi GPIO pins

8 years 5 months ago #2476 by vickeyhort
Hi.

I have connected a two channel relay with my RPi ver 2 in isolated mode using CD4050BE as level shifter. Relay works fine but the state in easyiot server is opposite. When relay status in EasyIOT server is off, relay is on (As relay has LEDS which turns on when relay is on) and vice versa. How to correct the status?

Please Log in or Create an account to join the conversation.

8 years 5 months ago #2480 by EasyIoT

vickeyhort wrote: Hi.

I have connected a two channel relay with my RPi ver 2 in isolated mode using CD4050BE as level shifter. Relay works fine but the state in easyiot server is opposite. When relay status in EasyIOT server is off, relay is on (As relay has LEDS which turns on when relay is on) and vice versa. How to correct the status?


Solution is not out of the box, but it can be done with HW or SW.
If you want HW solution then add inventor between GPIO output and CD4050BE.
If you want SW solution add virtual switch and then in automation write script to control GPIO port with this virtual switch. In program also change output state 0->1 and 1->0.

Please Log in or Create an account to join the conversation.

8 years 5 months ago #2482 by vickeyhort
Thank you for your quick reply. I am looking for software solution, May you give me an example for gpio driver automation?

Please Log in or Create an account to join the conversation.

8 years 5 months ago #2483 by EasyIoT

vickeyhort wrote: Thank you for your quick reply. I am looking for software solution, May you give me an example for gpio driver automation?



Use EventHelper.ModuleChangedHandler to catch virtual switch event and DriverHelper.ProcessCommad to set GPIO.

Look at iot-playground.com/2-uncategorised/32-ea...-automation-part-iii for details.

Please Log in or Create an account to join the conversation.

Time to create page: 0.433 seconds

Forum latest

  • No posts to display.