Saturday 26 August 2017

Control 5v relay through 3.3v GPIO using NPN transistor


I'm not very pratical as I just started learning electronics and I'm planning to make some experiment with Raspberry Pi.


I'm trying to control a 5v relay board that, I think, is made for Arduino, as Raspberry only has 3.3v GPIO.


It's active low, as GPIO.LOW activates the relay, and the 3.3v keep it active too, so I think I'll need exactly 5v to turn it off.


So, basically I think I'll need a transistor, with the base controlled by my GPIO, that will activate a 5v line to Input line of the relay switch.


I have thought about these schematics, but I've been told it will burn my transistor as I need a resistor between 5v and the transistor collector.



My question is certainly basic, but... WHY?


When no current flow through base there will be no problem, when the transistor gets activated isn't my load the relay board? Why do I need other resistors?


Thanks in advance.


enter image description here


This is the relay board I bought, I couldn't find schemas, so I can't provide more.


enter image description here




No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...