Relay integration
#3
jl_678 is correct, it is quite simple, but if you do it wrong, it will destroy your PineA64.

... the most important thing to remember about triggering a relay with a GPIO pin is to have a protection diode across the coil of the relay.  Inductive loads (via back EMF, which can be thousands of volts, believe it or not) will destroy your Pine board if you don't account for it... with a protection diode.

I recommend purchasing a good relay driver board... they have convenient screw terminals and the protection diode is usually provided on the board. 

Also, I recommend driving the relay board with a ULN2803 driver. Basically, the GPIO drives the ULN2803 and the ULN2803 drives the relay coil.  This buffers the GPIO on the PineA64, and it protects the current output limits of the GPIO bus, and it allows you to drive a wider range of relay boards up to 500ma coils.  The ULN2803 can drive up to six relay boards. Sometimes the ULN2803 is included on the driver board too... makes them more expensive, but its worth it in the end.

Also, remember that the pineA64 is a 3v3 system. You will want to power the ULN2803 with 3v3 NOT 5v. Make sure that you never touch more than 3v3 to any GPIO pin on the PineA64 board. On the other hand, the ULN2803 will take up to 30v on its outputs... so you can use 12v relays and drive them with the PineA64. Be sure you understand the data sheet of the ULN2803 before you start.

The best thing to do first though, is learn to blink an LED... how to use Python is important, and you'll need to download the software; see below.

I recommend you download and use the RPi.GPIO-PineA64 codes from github.  You will also need to install:

sudo apt-get install python-dev
sudo apt-get install python3-dev

... and if you're using the ubuntu image, you will also need to install

sudo apt-get install gcc

------

If you have questions, please join us on the irc chat;  I'm there most days... or post here too, and we'll try to help you.  Again, there are examples on-line, and I'm even willing to post some for you if you give things a shot and need further help... if you figure it out yourself, you'll  learn more, and you'll feel better about it too.

best of luck to you and your project
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
  Reply


Messages In This Thread
Relay integration - by vigor - 08-15-2016, 06:08 PM
RE: Relay integration - by jl_678 - 08-17-2016, 03:48 PM
RE: Relay integration - by MarkHaysHarris777 - 08-17-2016, 04:22 PM
RE: Relay integration - by vigor - 08-21-2016, 09:37 PM
RE: Relay integration - by pfeerick - 08-22-2016, 03:27 AM
RE: Relay integration - by MarkHaysHarris777 - 08-22-2016, 07:40 PM
RE: Relay integration - by vigor - 08-22-2016, 08:41 PM
RE: Relay integration - by MarkHaysHarris777 - 08-22-2016, 09:21 PM
RE: Relay integration - by Boring - 08-22-2016, 10:11 PM
RE: Relay integration - by MarkHaysHarris777 - 08-22-2016, 10:20 PM
RE: Relay integration - by Boring - 08-23-2016, 12:35 AM
RE: Relay integration - by pfeerick - 08-23-2016, 06:11 AM
RE: Relay integration - by MarkHaysHarris777 - 08-23-2016, 12:50 AM
RE: Relay integration - by MarkHaysHarris777 - 08-23-2016, 06:57 AM
RE: Relay integration - by vigor - 08-25-2016, 01:17 AM
RE: Relay integration - by MarkHaysHarris777 - 08-25-2016, 01:42 AM
RE: Relay integration - by pfeerick - 08-25-2016, 06:53 AM
RE: Relay integration - by MarkHaysHarris777 - 08-25-2016, 11:07 AM
RE: Relay integration - by vigor - 08-25-2016, 03:30 PM
RE: Relay integration - by MarkHaysHarris777 - 08-25-2016, 08:35 PM
RE: Relay integration - by pfeerick - 08-25-2016, 09:48 PM
RE: Relay integration - by MarkHaysHarris777 - 08-25-2016, 09:58 PM
RE: Relay integration - by vigor - 09-04-2016, 03:25 PM
RE: Relay integration - by pfeerick - 09-05-2016, 12:27 AM
RE: Relay integration - by MarkHaysHarris777 - 09-04-2016, 09:00 PM
RE: Relay integration - by MarkHaysHarris777 - 09-05-2016, 11:33 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)