SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By Woodsplinter
#193071
The project: LED flasher that alternately flashes 2 LED's.

The equipment: Digispark, 2 N-channel mosfets (FQP30N06L), 2 small DC-DC buck voltage regulators, 2 hi-power LED's.

How it should work: Power is supplied from a drone battery via a 30 pin mezzanine connector mounted on a PCB I made along with the other components except for the LED's. Only 5 pins are used. +5V power is supplied to the digispark, and +15 volts to the voltage regulators. Ground is common, although I chose to use a separate pin for each mosfet and the digispark.

Pins 0 and 2 of the digispark are connected to the gates of each mosfet. The drains are connected to the (-) input of the regulators, and the sources are connected to ground.

The regulators are set to output 2.2V to a red LED and 6V to a white one. (Yes, im aware that led's should be driven by current controlled regulators which these are not. Because the LED's are only on for 50 ms, I felt this was OK, as there is no build up of heat.)

A sketch tells the circuit to execute a double flash on pin 0, pause, then the same on pin 2. A very simple alternating double flash.

I built a prototype and it works perfectly. I built another, but moved the components around on the PCB to save space. All the connections are identical but prototype #2 doesn't work properly. The red led comes on immediately with power but it should not until the sketch is executed after a 5 second delay built into the digispark. It does not flash nor does the white led.
I can remove all the components from the PCB and hook them up using a bread board and they work fine. I then put only the digispark, one mosfet, and one regulator (connected to the white led) back on the PCB, and the white led comes on immediately, then begins flashing after 5 seconds.

Because the digispark and voltage regulators all have holes for connections, I connect them to the PCB using pins. The mosfets are soldered in using their leads and do not touch each other in any way, nor do they touch anything else.

I am completely stumped why prototype #1 works and #2 doesn't. The other oddities are also confusing.

NOTE: I have used this configuration in the past using the digispark, 1 mosfet, and 1 regulator driving a 10W LED and it always works perfectly.

Any help would be GREATLY appreciated!
By Woodsplinter
#193117
SOLVED! Turns out a 1K pull-up resistor on the mosfets did the trick. 5, 10 and 20K were tried but didn't work.

Thought I would post this in case it might help somebody in the future.