I am trying to create a switch using a n-mosfet (IRF1310NPbF) in order to control a CCTV camera working with 12V (0.115A). I did the cable connection after reading/watching several tutorials and first tested using two 12V (100mA each) PC fans. All worked just fine until the moment I tried to connect the camera. Once I connect the camera the circuit is powered and both loads (fan & camera) are turned on.
There should be probably something wrong with the cable connections, although I cannot really understand, why it is all fine when using one or both pc fans until the camera is connected.
Any help or idea is more than welcome! Please let me know if you need some more details.
Yes, sure. I meant that when I connect the camera to the circuit (as depicted in the attached file), it seems that the mosfet conducts allowing the current to flow. I measured the voltage between arduino and gate and it found it just a few mVolts (when the Vgs is 2-4V). That's why I believe that the mosfet simply conducts (from its own) once a second load is connected to it. I increased the pulldown resistor to 80kΩ but got the same results.
I will have to read about the electrolytic capacitor you suggested, thanks!
Did you connect the ground of the Arduino to the source of the MOSFET and the negative terminal of the power supply? Double check all connections.
Why is VGS 2-4V? How is the output of the Arduino configured? What's VGS without the Arduino connected? What happens when you connect the gate directly to ground? (Without the Arduino connected.)
Chances are that the MOSFET is just broken.
You could try adding a capacitor, but I doubt that's the problem ...
A few things to keep in mind (that probably don't contribute to the problem, but might still be important):
The IRF1310NPbF is not a logic level MOSFET, i.e. it was not really designed to operate with a gate voltage of only 5V. It works just fine for small loads at low switching frequencies, but it's not really good practice.
Your gate resistor and pull-down resistor are currently in a voltage divider configuration, so the voltage on the gate will be slightly lower than 5V. It's better to connect the pull-down resistor to the Arduino pin (i.e. in series with the gate resistor, instead of directly to the gate).
Yeah....true. Good point from pieter and larry. Try a IRL540 mosfet instead.
Also....... see what happens if you connect the source pin of the mosfet to it's own GND pin on the arduino. In other words..... wire the source pin of the mosfet directly to one of the GND pins of the arduino (not the breadboard). This is in consideration of the breadboard's 'GND' voltage that could become increased by the current due to the camera. So, could try taking the SOURCE pin to an actual arduino GND instead.
Hi,
Looking at your diagram you have what looks like a resistor from the FET gate to ground. I think you mentioned 80K. This resistor is typically not needed. The only reason one might use it is to keep the fets off if the Arduino is disconnected. However I doubt this is the problem.
As a note, the resistor from the Uno to the gate is not critical. I would pick around 5k -10k. Its only reason for being there is to protect the Uno if the fet burns up. (Technically it also slows the fet from switching super fast but this is not a concern here, unless you plan to PWM the fans.)
You mentioned the measurement from the Uno Pin 2 to the gate was only a few millivolts but you didn't mention the Gate to source (GND) voltage.
I would try a simple test:
Take the green wire from the Uno pin 2 and move it to the Uno ground (not the push board ground).
The Fet should never go on regardless of where you connect the camera. If this does keep the fet off, it means the Uno is not controlling the gate properly.
thanks for your comments. While I was trying different staff to localise the problem, I realised that the problem is (probably) not in the cable connection scheme I follow, rather it is related to the BNC cable which I use to transfer the data from the camera. This BNC cable is connected to a video grabber which is connected to a laptop via USB cable. So even if the camera is connected (just with a DC cable), the mosfet works fine (i.e. turns on and off the camera). But when I connect the data cable to the video grabber, the mosfet conducts.
Now, I am not sure why this is happening and if it is related to the circuit. I can imagine that it might have to do with the hardware of the video grabber (Basetech BR116) since the problem appears without installing any drivers whatsoever. I simply plug-in the grabber and mosfet conducts. Is it possible that a small voltage flows back to the camera and makes the mosfet turn on?
The initial question has changed a bit, but the problem stays more or less the same.
Thanks in advance for your comments/ideas!
T.
PS: In the screenshot of the circuit you see two fans. Just imagine a camera instead of the fans.
The data cable is grounded, so it connects the ground of the computer (and Arduino) to the ground of the camera, bypassing the MOSFET.
The MOSFET itself still doesn't conduct. All current for the camera goes from the power supply ground, to the Arduino, to the laptop, to the BNC cable to the camera's ground.
You could try a high side switch instead (relay or P-channel MOSFET) or you could isolate the Arduino ground from the BNC ground. For example, use a USB charger or a power bank for the Arduino, instead of connecting it to the same laptop (or any device that has its ground DC coupled to the same earth/neutral lines).
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Not the fritzy one.
Also a picture of your project so we can see you component layout.
Problem solved! I was suspicious that there was something wrong with the coaxial cable (BNC) and actually tried different configurations (laptop in battery, arduino with power cable etc.) but didn't work. After reading Peter's post, I connected Arduino on a different computer via USB cable and mosfet worked just fine! So, as Peter wrote, the coaxial cable was grounding the camera - and therefore bypassing the mosfet - which resulted on an closed circuit.
Since I would like to use (of course) one laptop, I will try next to use a p-mosfet as suggested and check whether this solve the problem
Many thanks to Peter and the rest for your comments!
PieterP:
The data cable is grounded, so it connects the ground of the computer (and Arduino) to the ground of the camera, bypassing the MOSFET.
Hi Pieter. Could you please explain what you mean by "the data cable is grounded"?
Are you referring to a bnc cable? In any case, it's unclear what you mean by 'the data cable is grounded'. Or does this mean the centre conductor of the bnc cable is somehow shorted to the shield of the bnc cable?
So the issue is a faulty bnc cable, right? So the fix is to repair the bnc cable?
I mean that it contains a ground conductor, so it connects the ground of the camera (that is switched by the MOSFET) to the ground of the computer. The ground of the computer is connected to the ground of the power supply, so the camera is always powered on, regardless of the state of the FET.
PieterP:
I mean that it contains a ground conductor, so it connects the ground of the camera (that is switched by the MOSFET) to the ground of the computer. The ground of the computer is connected to the ground of the power supply, so the camera is always powered on, regardless of the state of the FET.
Pieter
Thanks Pieter. So the BNC cable is being used as a power cable, but --- for some reason --- the shield of the BNC cable is connected to computer ground?
So the fix will be simply to remove whatever is shorting that BNC cable to computer ground, right?
Does the diagram that I added give the right account of the situation? The ground that I drew (which is basically connected to both arduino GND and computer GND) needs to be removed by getting rid of whatever is grounding that BNC cable, right?
It's not shorted to the computer's ground, it's just connected. Which is absolutely normal: you need a data signal wire, and a ground reference. The problem arises when you want to interrupt the ground to turn off the camera. You would have to interrupt the BNC ground as well. If the ground of the computer is not connected to the ground of the power supply, there's no problem.
Thanks Pieter. So my diagram doesn't represent the situation. It sounds more like the camera has 'POWER wires' for connecting the camera in parallel with the fans. So those wires from the camera would be its own wires (eg RED and BLACK). And then the video data cable is the BNC cable, which is something separate.... totally unrelated to the power wires. Except, the shield of the video data cable is electrically (internally) connected to the BLACK power wire. So connecting the bnc video cable to the video input of the computer results in grounding the black wire......... because the shield of the bnc mates with the computer ground..... which appears to also be linked to power supply ground.
Misunderstanding and confusion was due to an incomplete description of the system (from original post).