0
\$\begingroup\$

While practicing in Tinkercad, I stumbled on a problem that I'm not educated enough to solve so I have to ask here.

The goal here is to have the LED powered by the power supply, and Arduino powered on USB, and the pushbutton acts on Mosfet's gate that flashes the LED. When I run the simulation, it works as intended but to be honest the massive ground wiring on Mosfet source seems messy, and when I run the sim without touching the pushbutton, the power supply displays 319 mV and 1A draw - where? I can't figure the mistake, but I sort of think it might have something to do with the way I grounded it? Any advice welcome :)

enter image description here

\$\endgroup\$
4
  • 1
    \$\begingroup\$ You are shorting VCC to ground when that MOSFET is on and you don't have any current limiting on the LED. This circuit will likely release magic smoke. \$\endgroup\$ Commented Mar 14, 2021 at 22:49
  • \$\begingroup\$ It is very common to have a large number of connections to Ground. I would connect the Arduino GND and pushbutton ground to the Ground bus on the breadboard, rather than to the MOSFET source - that would be the same electrically, but won't look so messy around the MOSFET. \$\endgroup\$ Commented Mar 14, 2021 at 23:06
  • 1
    \$\begingroup\$ the mosfet does not control the LED ... the mosfet and the LED are separate \$\endgroup\$
    – jsotola
    Commented Mar 14, 2021 at 23:27
  • \$\begingroup\$ This is where my lack of knowledge comes in - I tried to connect this circuit for real,with big 12V LED bulb instead of the small one in the Tinkercad, and while there wasn't no black smoke, the Mosfet (K1363) got very very hot, and also, that pushbutton didn't flash the LED as the Arduino code said (1 sec. on, 1 sec. off), in "off" cycle the LED bulb would just dim around 50% of it's full brightness. I hooked it all on my computer desk with not too much room and alligator clips for every connection, I have no other way haha. So the led didn't turn off fully and fet got hot, not good :D \$\endgroup\$
    – Varonne
    Commented Mar 14, 2021 at 23:59

1 Answer 1

1
\$\begingroup\$

Try something like this instead. This circuit should not release any magic smoke.

I don't usually use TinkerCAD but thought I'd check it out... Code section leaves a lot to be desired. I wasn't able to figure out how to get the pinMode() assignment to allow the internal pull-up so I had to add one to the circuit.

schematic

simulate this circuit – Schematic created using CircuitLab enter image description here

Link to TinkerCAD Circuit

\$\endgroup\$
7
  • \$\begingroup\$ I will try to do it your way, DIO is digital input/output right? The Tinkercad example is not the best way for me to solve it because I want to change this small LED in tinkercad with proper big 12V LED bulb like the cars use, and well, I'm not a good hobbyist because of this lack of basic knowledge - but I fear on messing something when 12V power and Arduino are on the same circuit. Are the resistor values in your circuit example modified for the common 2.1V LED? \$\endgroup\$
    – Varonne
    Commented Mar 15, 2021 at 0:02
  • \$\begingroup\$ No worries, you're here learning new things. Nothing wrong with that. If you use an automotive bulb, you can leave out the resistor since current limiting is part of the bulb. You shouldn't use the power supply to power the button when you go 12V. I'll change the schematic to reflect the new info. And yes, DIO is the Digital Input/Output pins. \$\endgroup\$ Commented Mar 15, 2021 at 0:24
  • \$\begingroup\$ Thanks! So - In my Tinkercad "schematic", putting the pushbutton pin on the Mosfet source would put 12V thru the pushbutton, if the PSU used was set to 12V? Also, does Arduino ground have to be on the Mosfet source? \$\endgroup\$
    – Varonne
    Commented Mar 15, 2021 at 0:31
  • \$\begingroup\$ Yes, you want the grounds tied together so everything has the same reference (GND). Choose a MOSFET that has a low gate threshold. \$\endgroup\$ Commented Mar 15, 2021 at 0:37
  • \$\begingroup\$ Yes, the Arduino ground must be connected to the MOSFET source, but as I said in another comment, I would connect the Arduino Ground, the pushbutton ground, the MOSFET source, and the power supply ground all to the breadboard ground bus, rather than connecting everything directly to the MOSFET source. \$\endgroup\$ Commented Mar 15, 2021 at 0:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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