3 Replies Latest reply on Nov 28, 2014 9:18 AM by Tage

    Problems with a relay


      hi guys im want to switch a relay FRS1B-S, its a 5 volt relay

      to swicht the relay i use a bc 550 npn transistor.

      and i use the minibreakout board


      my design is the same like this onerelay2.png, except i changed the bc 547 to the bc 550


      but if i set gpio 40 (J19 pin 10) to high it does not switch, although I mesure 1.8 volt on it.

      root@ubilinux:/sys/class/gpio# echo 40 > export

      root@ubilinux:/sys/class/gpio# cd gpio40

      root@ubilinux:/sys/class/gpio/gpio40# echo out > direction

      root@ubilinux:/sys/class/gpio/gpio40# echo 1 > value

      if plug the cable from gpio 40 to J19 pin 2 which is also 1.8 volt and the transistor switch the relay. i have a drain from 500uA

      on gpio40 is only a drain of 22 uA


      can someone give me advice


      bye stefan

        • 1. Re: Problems with a relay

          Hi shb,


          Try using this following diagram to connect your relay:


          Relay Connection.png


          That should work. Note I used a 2N3904 transistor but it could be the transistor you prefer. The diode is just for protection. If that doesn't work, try to blink a LED to make sure the control signal from the Breakout Board is working and the transistor is working too. The following post could be useful for the LED test: Your First Blink- Edison Breakout Board + Arduino IDE.




          • 2. Re: Problems with a relay

            thank you very much,

            it works very well mit a led but not with the relay, same issue if i plug the cabel directly to 1.8v pin the relay closes and if i connect it with gpio40 nothing appens.

            i tried the relay parallel with the relay nothing happens, if remove the relay the led will shine. if i connect the base with 1.8v the led shines and the relay closes


            any ideas?


            bye stefan

            • 3. Re: Problems with a relay

              what is the relay coil resistance? you need to calculate how much collector current is needed, then apply 1/10th of that current to the base. 2N3904 has quite low gain and at the current level you have, the base-emitter voltage will be about 0.9V, so if you need 5mA and the pin voltage actually is 1.8V, you should use (1.8V-0.9V)/5mA = 180ohm base resistor. the problem is that you GPIO probably sags so you do not have 1.8V. so you have to check the actual pin voltage at 5mA and select the resistor value accordingly.

              npn transistors are not well suited for use with 1.8V logic. darlington transistors are even worse. you need to get n-channel MOSFETs that have Rdson specified at 1.8V. these are readily available in SOT23 package and cost almost nothing. look for 20V n-channel MOSFETs in SOT23 package and check the datasheet for the Rdson value and make sure it is specified at 1.8V. ( forget the gate threshold value, it has no meaning.) Look for MOSFETs that has continuous drain current max rating of 1A or higher. There are many devices that can drive 4A or more. the higher current devices have more capacitance so they will cause a current spike in the GPIO pin when switching. this causes noise on the 1.8V rail, so you may want to add a 1k resistor between the GPIO pin and the gate if the MOSFET is large, to reduce the noise. A MOSFET is voltage driven, so it only draws a current briefly when GPIO pin changes.

              Some part number examples below, from one vendor. use ECIA Authorized - The Search of Authorized Distribution  and type in the partnumber to search availability and cost.

              DMG3414U, DMG3420U,DMG6968U.

              DMN2065UW (SOT323)

              ZXMN2B03E6 (SOT23-6).

              Package sizes get smaller and smaller, and SOT23 is today considered a huge size. you can find the same type of MOSFET in much smaller package sizes (1/10th the size of SOT23 in some cases) but for prototyping use SOT23 is nice as you can solder it without needing a microscope.

              1 of 1 people found this helpful