1

I want to create a small LED strip driver/controller with 2 channels (Cold/Warm white) using Arduino Pro Mini (5V/16MHz). I have connected the parts per the following diagram schematics I have pins 5 and 6 setup as output, control them via analogWrite, and it all works great on Arduino UNO.

The problem comes with Arduino mini pro. When one channel is set to 255 and the other is 0, the LED strip does light only in one color, which is OK and when I swap the PWM channel's values, the other light color starts to shine. So far so good. When I set both to 0, the strip keeps on shining at about 30% (I don't have a scope, so I can't tell what the pwm signal is doing). Varying the channels' pwm in the range 0-255 does affect the light somehow but it never goes down to a complete off.

Looking at the arduino uno and pro mini I can't see anything obvious that should make them act differently from the hardware perspective so I'm guessing there's a problem in the libraries or perhaps my arduino pro mini (a clone) is somehow messed up.

Has anyone observed this kind of behavior in Arduino pro mini and has a solution for it?

Edit: Added some measurements per @Abel's request. I measured both DC and AC with and without the LED strip connected.

Connecting the LED strip really does mess things up, but WHY? UNO can handle it, but the pro mini can't! I thought mini was basically just shrunk down arduino uno (both have the same SMD version of MEGA328P), but apparently there are some differences. DC/AC readings

8
  • check your led strip specs. you may have to change the pwm frequency. – Abel Jan 3 at 18:40
  • @Abel, does the pwm frequency differ between the UNO and the pro mini? Like I said in my question, the same code works just fine in an UNO board but doesn't on pro mini. I used pins 5 and 6 in both cases. – Aleš Kovářík Jan 3 at 19:40
  • @Juraj - the problem is with pro mini - a link to the particular board is in my question - click on the "clone" word. – Aleš Kovářík Jan 3 at 19:42
  • theres a lot that can be wrong. without led strip specs I can't determine. 1) frequency may be throwing off something in your strips own voltage regulation (you are basically swinging the "ground" side around). 2) pro mini logic voltage may be lower (people mix 3.3v and 5v all the time). add in your pull to ground on the logic, and your power mosfets may not be reacting properly. (shouldnt need to pull output logic) – Abel Jan 3 at 20:14
  • @Abel the strip is this: aliexpress.com/item/33005175470.html (5050 CCT, 12V). With my first try I didn't use the MOSFETS. I used TIP120 Darlington transistor which did not have the 10k pull down and that's when I first observed the strange behavior. I didn't try it with the Arduino UNO back then and decided to switch to the MOSFETS. As for the variant of Arduino mini. I'm pretty sure I have the 5V (I checked voltage on pins and signage on the crystal). I tried to change the board type to 3.3V in the Arduino IDE - apart form the timing on the serial line, nothing changed. – Aleš Kovářík Jan 4 at 10:12
1

Thanks to comments I received from several people here I quadruple checked the wiring and eventualy found the problem. My recent Arduino Uno tests were done on a breadboard, but I had the Pro Mini prototype soldered on the prototyping board which has the holes connected in columns on the copper side. I made the cuts in all the necessary places ... but one! That one omission caused a short between pin 6 and the drain from the other channel's mosfet. The problem with these boards is that the parts are on one side and while flipping the board to the copper side, it is too easy to get lost in all the columns and miss something. The morales of this story are: "Never be too certain about your wiring/soldering" and "Arduino is pretty resistent to my attempts to fry it :)".

0

Nice clean design! Let's determine for sure what voltage it is outputting to the MOSFETs. Write a very simple sketch that cycles a pin every few seconds and measure the voltage. You should get ground and VCC. If it is less than 4.5 volts (guard band included) your FETs will give you problems as they will not be properly enhanced. Here is why: The IRF520 is a Power Mosfet with 9.2A collector current and 100V breakdown voltage. The mosfet has a low gate threshold voltage of 4V and hence commonly used with microcontrollers like Arduino for switching high current loads. You may have to get a different MOSFET with a lower gate threshold. Note there is some variation in the devices so they will not all but the same but will meet the specification. The 10K pull down resistors is a great addition and guarantees your state during reset until it is set up.

0

Get a good digital O'scope. They are incredibly cheap these days, and pay for themselves pretty rapidly in reduced frustration and time spinning one's wheels. I recently got a Hanmatek DOS1102 dual-channel 110MHz, and I haven't used my old analog Tek2236 since

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.