Uncategorized

3/5/12V relays

Of cause this is assuming the Pi could even drive the opto-isolator, but if this has a series LED and resistor is unlikely.

Powering from 5V is dangerous and is likely to blow up the Pi.

The comments on the Amazon site indicate it us unsuitable for use with the Pi.

As an aside there is absolutely NO POINT is using an opto-isolator with a relay!

Any additional isolation they claim to supply is illusory if there is ANY common connection between the two.

Opto-isolators have a low current transfer ratio – which just makes it harder for the Pi to drive.

There are a number of (poorly-designed) relay boards on the market – they MAY work with an Arduino, but are unsuitable for the Pi. (There are quite a few posts on this site discussing these.)

There ARE modules (without opto-isolators) designed to be driven by 3.3V logic levels which are suitable.

You could drive this from the Pi using a transistor (if you haven’t already blown the Pi).

Milliways

https://raspberrypi.stackexchange.com/users/8697/milliways

I am a retired Telecommunications Engineer.

When I was at university the Electrical Engineering Department had an IBM Mainframe with a massive 1MB of memory. I almost got to use a PDP8 for my Masters project until the funding dried up.

In the early 1970s I started to design my own computer but abandoned it halfway when microprocessors were invented. I built my own (actually several) based on the 2650, and wrote my own DOS, Assembler, Basic Interpreter, Word Processor and Forth Compiler which I sold (with a partner) under the brand MicroByte.

1,437 answers

39 questions

~4.6m people reached

Sydney,  Australia

binnie.id.au/Ian

Member for 5 years, 11 months

2,383 profile views

0

A am using working on a project that requires a camera analyzing some images and activating the appropriate GPIOs to control a relay board. I currently have a touchscreen display, a Raspberry Pi Cam attached to the Raspberry Pi. I am trying to connect a 16 channel relay module to control some motors. Here is the specific relay module I am using: https://www.amazon.com/SainSmart-101-70-103-16-Channel-Relay-Module/dp/B0057OC66U/ref=asc_df_B0057OC66U/?tag=hyprod-20&linkCode=df0&hvadid=311990496852&hvpos=1o1&hvnetw=g&hvrand=16991409045459790175&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9028086&hvtargid=pla-405660916688&psc=1 I looked at videos online about how to connect, however whenever I run it, nothing happens. The relay module has an external 12V power supply, which I connected. And I have connected all the GPIOs that I wanted to use from the Raspberry Pi to the relay board. IN addition, I connected the 5V and 3.3V connections to the 2 5V pins on the relay module (I used the 3.3 because the other 5V is being used to power the touchscreen display). I have checked all the voltages and everything seems fine. Whenever I run the following code, nothing seems to happen:

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.serwarnings(False)

x = [27,28,29,32,31,36,33,38,35,40]

for y in x:
    GPIO.setup(y,GPIO.OUT)
    GPIO.output(y, GPIO.HIGH)
    time.sleep(0.5)
    GPIO.output(y,GPIO.LOW)
GPIO.cleanup()

Connections from Raspberry Pi

Connection to Relay

Overview Connections

migrated from superuser.com 9 hours ago

This question came from our site for computer enthusiasts and power users.

  • What is the point of connecting 3V3 to a 5V input? Why not split the 5V line? You need to add clear photos of your wiring if you want practical help. – joan 9 hours ago
  • I didnt have anything to split the 5V with… – Sajid Khan 5 hours ago
  • Perhaps it uses 5V logic. See if it switches if you connect 5V to one of the relay inputs. – joan 4 hours ago
  • This appears to use opto-isolation. There are many similar modules on the market and frankly they are unsuitable for the Pi. Get a module with logic inputs. – Milliways 4 hours ago

0

The relay module you linked (which has limited documentation) states:-

12V 16-Channel Relay interface board, and each one needs 15-20mA Driver Current

The Pi GPIO can (safely) sink up to 16mA – and if using all relays would overload an Arduino, and probably the Pi.

Of cause this is assuming the Pi could even drive the opto-isolator, but if this has a series LED and resistor is unlikely.

Powering from 5V is dangerous and is likely to blow up the Pi.

The comments on the Amazon site indicate it us unsuitable for use with the Pi.

As an aside there is absolutely NO POINT is using an opto-isolator with a relay! Any additional isolation they claim to supply is illusory if there is ANYcommon connection between the two. Opto-isolators have a low current transfer ratio – which just makes it harder for the Pi to drive.

There are a number of (poorly-designed) relay boards on the market – they MAY work with an Arduino, but are unsuitable for the Pi. (There are quite a few posts on this site discussing these.)

There ARE modules (without opto-isolators) designed to be driven by 3.3V logic levels which are suitable.

You could drive this from the Pi using a transistor (if you haven’t already blown the Pi).

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: