Axo + 3volts relay


#1

HI!
I'm doing an interactive installation and I want to switch on and off a laser using the gpio pins. I got some 3v relays and connected them to the axoloti but seems that the gpio pins can't provide enough "juice" to activate the coil of the relay. (~100 mA). I tested with my reg powr supply and the relay works perfect even with 2 volts from it.
But axoloti will not do it even sending the maximum value to the gpio pins (3.3v checked with voltmeter).
Also tried powering the Axo from a 1 amp 5v supply and no luck..

Any advice? trick? Alternative?
I know I maybe should be using a FET but I don't know which one..


#2

You can't draw more than 20mA from a GPIO. Hopefully you did not fried your Axoloti.
You should use a transistor to actuate the relay (with a diode in parallel with the relay to avoid problems) :

http://www.electro-tech-online.com/attachments/n-fet-low-side-switch-png.12974/

The 2N7000 is a good choice when operating at 3.3V

http://www.electronics-tutorials.ws/transistor/tran_7.html


#3

yes that's it. you should use a transistor switch.

http://www.electronics-tutorials.ws/transistor/tran_4.html

use the npn design to close the switch when current flows from gpio.

2n2222 should be fine.


#4

or here is a site with examples that use 2n3904 or 2n3906

http://www.rason.org/Projects/transwit/transwit.htm


#5

Don't forget base resistor if you use bipolar transistor. BC547 or any common small signal npn type should be fine.


#6

Thanks guys!.
I will try this and also just to use a more powerful FEt than the 2n7000.
Ideally, with the gpio voltage and the right transistor I could control the intensity of the laser, not just the on/off state.
that was kind of working with the 2n7000 but I wasn't able to get "full output" from the laser.

Any suggestions for amping the line output of the axoloti like 2x/4x?

Btw!. Axoloti still works.. I'm very grateful for it's solidness.. If it was a raspi maybe I wouldn't have been so lucky..


#7

Do you plan to use PWM on high power FET to control the laser (without any relay) ?


The electrical dynamics of the audio outputs is limited to 3V3. The internal 3V3 power source is very well regulated and clean, using the 5V power source won't be that clean. If you need more juice, you'll have to use some little amp.


#8

I'm doing different tests.
the FET alone (Irf530) with pwm doesn't work at all with the laser. (I get the volts out though ) Maybe because lasers need more constant current. With the 2n7000 I can regulate the intensity of the laser directly from pwm out (analog out doesn't seem to work) but I can't reach the maximum intensity of the laser + I might burn that trans because the laser draws up to 500mA
Now I will test driving the 530 with the 2n7000 using the 5v sup and if that doesn't work for me, I will do 2n7000 / 5v / relay.
Fingers crossed..


#9

Ok, now the relay its working as described being driven by the 2n7000. !. Now I will try to use a mosfet instead for efficiency reasons. At the moment I'm not gonna worry about "dimming" the laser. that would be the coolest stage..
Thanks for all your suggestions


#10

I'm not sure that dimming the laser directly by acting on its power source is a good way to proceed, it may depend on the way it works.


You can add a 22k resistor between the gate of the transistor and ground. This way, the gate won't be floating if the GPIO is temporarily set as an input.


#11

with the 2n7000 it dimmed though not to full power but yeah, I don't know how good it's that for the laser anyway.
If I set the gpio as "digital out" and send a boolean to it, It should be 0 volts on false, right?. Anyway, the high resistor to ground it's a good practice


#12

Yes. But your patch is not loaded and run instantly, in the meanwhile, i think that GPIOs dafault to high impedance input mode, thus the gate is floating and can cause unwanted impulses that can damage the device you control. That's why it is good practice :wink:


#13

You definitely know what you talk about.. :wink:
Thanks for the advices!.
All the laser hardware it's working now as I expected, Now I just hope it can withstand a lot of cold..


#14

Yep, i made this mistake once :roll_eyes:


#15

“Learn from the mistakes of others. You can’t live long enough to make them all yourself.” :wink: