Relay Board example without TKinter? And what PINs needed?

Need some help with your shiny new breakout board, or something not working right? Let us help you here!
Post Reply
Tetrikus
n00b
Posts: 2
Joined: Tue Sep 11, 2018 9:35 am

Relay Board example without TKinter? And what PINs needed?

Post by Tetrikus » Tue Sep 11, 2018 9:50 am

Hi all
I want to use the ModMyPi Universal Relay Board in my application. In the wiki, I do only find an example with the TKinter GUI. I want to use it in my own python script and I am currently looking for some code examples. Is there anything around? Or do I really just have to set the connected GPIOs high/low and that's it?

Also I don't find any information about what minimum PINS are needed for the relay board to work. I will not connect a 40-pin header to it but only the pins it needs. Is there any information about what are the minimum pins required?

Will it work if I connect these PINs? (Or is it better to use 5V VCC?)
3,3V — PIN 1
GND — PIN 6
GPIO 8 — PIN 24
GPIO 9 — PIN 21
GPIO 10 — PIN 19
GPIO 11 — PIN 23

Thanks for any support!

User avatar
Dave
ModMyPi
Posts: 2693
Joined: Wed Jul 22, 2015 11:36 am
Contact:

Re: Relay Board example without TKinter? And what PINs needed?

Post by Dave » Tue Sep 11, 2018 11:21 am

You will need to use the 5v to power the relay board.

Simply assign a GPIO pin to each of the relays, using the tactile buttons on the relay board. Then it really is as simple as setting the GPIO high/low to turn the relay on/off!

There's no need to manually wire this board up, if using an extra long header you can use any of the GPIO pins that haven't been assigned to a relay.
Forum Administrator & Technical Support

Tetrikus
n00b
Posts: 2
Joined: Tue Sep 11, 2018 9:35 am

Re: Relay Board example without TKinter? And what PINs needed?

Post by Tetrikus » Tue Sep 11, 2018 11:24 am

Awesome, thanks for your reply! I have to manually wire it because the relay board is not directly on top of the PI and the 40-pin header is completely in use already (physically) - which doesn't mean, that there are a few GPIOs left. But your answer helps a lot, thank you! :)

Post Reply