-2

I created a simple circuit that turns on and off two 12VDC LED with signals from my Arduino Leonardo R3, which is powered by a 5V USB cable from my PC. The LEDs are attached to a dedicated 12V power supply.This works well with a MOSFET-N IRLZ34N that is triggered to let the current pass by sending the max 5 voltage I have from the Arduino.

I found myself with this wiring. enter image description here

QUESTION-1: When I turn on LED-1 with Arduino-HIGH (that is 5V), then the LED-2 comes up with a faint glow. This opposes to my expectations. How do I get rid of this. Vice-versa is true, when turning on LED-2 (and LED-1 is off).

As some implicitly suggested, I added current-limiting resistors, since their might be a variance of amperage supply (and/or in onsumption in voltage). From your experiences, is that too high or too low of a resistance value?

I think this drawing is comprehensible. Thanks again to all having a look at this earlier. I certainly didn't mean to be disrespectful. It's is rather my tinkering attitude in this field where I'm not a professional.

FYI. I do not have an oszilloscope (or however that thing is called to measure volatile charging or discharging). I can only measure steady current/voltage and resistance.

feder
  • 135
  • 5
  • 2
    Please give us a proper schematic, with your transistors and LEDs marked. – Joe Hass May 08 '14 at 13:47
  • 1
    There are many things wrong with the implementation and your understanding of it. 1. AnalogWrite generates a PWM signal of duty cycle varying from 0 to 100% (0 to 255), **not** an analog voltage, except on DAC0 and DAC1 pins of the **Arduino Due**. 2. MOSFET gates should not be driven just to Vgs(th), but much higher so long as it is less than Vgs(max) (i.e. 16 Volts for these). 3. They aren't called "poti", either "pot" or "potentiometer" will do. 4. You need pull-down resistors between the gate and the source of each MOSFET, say 10k to 100k each. That should sort out the faint glow problem. – Anindo Ghosh May 08 '14 at 13:54
  • Sorry, I'm not trained to do that. I'm a software engineer, not a professional in electronics (as you easily can guess). Also, I saw many questions answered with this Fritzing software. If you are a professional, you certainly can easily imagine this simple circuit. Hints are sufficient. I can figure out the rest. Thanks. – feder May 08 '14 at 13:55
  • 2
    @feder: learning to draw simple schematics ([pencil and paper will do](http://electronics.stackexchange.com/a/1075/2191)) will both help you to understand circuits and will enable you to help others to help you. Note that Fritzing can produce schematics from your diagram with no effort on your part - so refusing to do so is counter-productive. – RedGrittyBrick May 08 '14 at 14:06
  • 4
    The board the 12vdc is connected to seems to show the power flowing all the way along the rails, but the board with the LED's attached seems to assume the rails have a break, otherwise it looks a lot like your bottom LED is connected directly across 12v? – John U May 08 '14 at 14:09
  • We need to see a schematic. No, I'm not going to try to follow that wiring diagram to understand the circuit. This question needs to be closed in its current form as *unclear what you are asking*, at least until a proper schematic is supplied. – Olin Lathrop May 08 '14 at 14:21
  • @AnindoGhosh Thanks for that constructive answer. I appreciate. 1. If I don't have a DAC, how would you send 5v from the Arduino Leonardo to the MOSFET-source pin? Btw and as expected, I get a brighter LED going up to 255. 2. I read up. I understand. But there is only 5v on the Arduino (need amplifiers?). 3. ok. 4. Neither 10k, nor 100k between gate and source got rid of the glow. P.S. I try to print the schema later this day to make my objectiv clear. Basically I just wanted to copy the following but with 2 LEDS. http://bildr.org/2012/03/rfp30n06le-arduino/ thanks for your comments!!! – feder May 08 '14 at 14:58
  • to all: Yes, I will provide a schematic. new thread? – feder May 08 '14 at 14:58
  • 1
    The main thing your Fritzing diagram fails to show is a ground connection between the Arduino and the breadboards. How are you powering the Arduino, and does it share a ground with the 12V power supply? If not, you'll need to make an explicit connection. And no, do **not** start a new thread; fix this one instead. – Dave Tweed May 08 '14 at 15:07
  • @DaveTweed Will do. – feder May 08 '14 at 15:23
  • @feder By default, the PWM sent out by AnalogWrite() will be of maximum amplitude equal to the Arduino's operating voltage, which is 5 Volts for the Leo. Nothing needs to be done. Also, 5 Volts at the gate will suffice. 100k gate resistors will work fine, just connect the grounds of the 12 Volt and the Arduino circuits. – Anindo Ghosh May 08 '14 at 15:40
  • 1
    I hate Fritzing drawings, but it appears that two pins of the lower FET are shorted - they are both connected to the bottom rail of the board. Also, you need to connect the Arduino ground to the 12 volt ground. – Peter Bennett May 08 '14 at 15:43
  • @PeterBennett Thanks. I did that. Will upload the schema in few minutes. – feder May 08 '14 at 15:53
  • 2
    @feder Schematics are a kind of a graphical language. Please read [these Rules and Guidelines for Drawing Schematics](http://electronics.stackexchange.com/questions/28251/rules-and-guidelines-for-drawing-good-schematics). It will help you in a long run. – Nick Alexeev May 08 '14 at 17:18
  • 1
    Can you point out the current limiting resistors for the LEDs in your circuit diagram? – jippie May 08 '14 at 17:32

2 Answers2

1

This topic is quite old now, but I would connect resistors (say 10K) between gate and ground. it looks like the FETs are not completely turning OFF.. Just my 2c

0

You have now provided (barely) a schematic, so I will try to answer the question. However, this schematic is still a mess. Remember that a schematic is for communicating a circuit, not some busywork we assign that you have to do to check off some item. Ditch the stupid fritzing software if that's what's causing these messes, although I suspect it is probably possible to make understandable schematics with it. Unfortunately the temptation will still be there to create those really annoying wiring diagrams, so it's still probably best to use some other software that forces you to think about the schematic only.

In any case, here are the things I see wrong with your circuits:

  1. The power is never connected to the processor. In the top schematic, there are only two leads going to it. One is (apparently) ground, and the other is (presumably) a PWM output. The processor won't run like that.

  2. The "-" pin of the 12 V power plug is connected to the processor, but its function is not labeled. This looks like it's intended to be ground, but we can't tell.

  3. There is no current limiting resistor in series with the LED. If the processor were properly powered and the gate driven high enough, the LED would be quickly destroyed, depending on the current capablity of the 12 V supply.

  4. You mention pots in your description, but show none in either schematic. We therefore can't tell what you are tweaking and what effects it might have on the circuit.

  5. The schematic would be a lot more readable if it followed proper practises. In particular, power at top, ground at bottom, and logical flow left to right would help a great deal. As it is now, I have to stand on my head to decipher the schematic instead of just looking at it to see the circuit.

These various circuit errors and inconsistancies make it impossible to talk about these circuits further. Remember that we are volunteers here, so minimizing hassle of and showing some respect to those you seek a favor from is in your own best interest.

Added:

You have now supplied a more readable schematic. Things are a lot clearer now, but this also brings up a new question. You say these LEDs are "12 V". There is no such thing as a LED that works on anywhere near 12 V. You could have some kind of lamp assembly that includes the LED and a resistor or maybe some kind of power supply, but your schematic shows bare LEDs, so this is confusing. It matters because if you really have bare LEDs then you need the current limiting resistors. If you have a integrated unit that requires 12 V to operate correctly, then you need to not have the current limiting resistors.

In any case, it makes no sense that one LED should come on dimly when the other is driven. This could be caused by a bad ground connection between the FETs and the processor. Drive one LED on and the other off, and check the gate voltage of the FET that is supposed to be off. Check it right at the fet, and also from the gate back to the ground at the processor. It should be a few mV at most in both cases. Also check what the drain voltages are of the FETs when both are off, one is on, and both are on.

Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915
  • 1
    You can always comment on the quality of the diagram, but even after reading your entire rambling, I did not find an answer to the question. – Dave Van den Eynde May 12 '14 at 07:16
  • @Dave: I pointed out several serious problems with the circuit. See my points 1, 3, and 4. Until these are addressed, there is no point trying to address the reported symptom because we don't really know what exactly is wired how. – Olin Lathrop May 12 '14 at 11:01
  • @OlinLathrop #1 Arduino is powered and wired correctly in my perspective. Pwr, gnd, and pins. #3 I added current limiting resistors. I estimated them by taking +/-5% variance. If that is wrong. Let me know. #4 Forget about the pots. I broke it down to the most simple circuit. – feder May 12 '14 at 14:30