S
S
Sergey Topolov2020-06-02 01:59:31
Arduino
Sergey Topolov, 2020-06-02 01:59:31

How do I calculate the transistor switch for a microcontroller?

I don't know anything about electronics at all. Realized that I need a transistor or something else to drive the relay. Because no more than 3.3v can be removed from the legs of the MK, and the control input of the relay wants, if not 5, then certainly more than 3.3v. Checked. Clicks on 5. Doesn't click on 3x.

In general, I will add the software myself. With the LED on Wi-Fi through the browser, I switch the norms - though the MK is stitched on JS, although there are modules for executing native code. More or less clear how to do it.

And to calculate the scheme is not mine. Till. Maybe you need something besides the resistor. Who knows - help.

5ed58804a72ed736414274.png

------------------------

Here I raised the storm. in fact, there are the same modules for 3.3 on ali. I just ordered a set.
wait. until I emulate and do something else. thanks for trying to help.

-------------

UPDATE: it still works out of the box,

powered completely through the MK. I connected the relay to the power pins in the lower right corner - Vin & Gnd

again - there may be some restrictions, and if you connect a large input load to the same outputs, it will not work.
5ed6e89537df4058833868.png

Answer the question

In order to leave comments, you need to log in

6 answer(s)
V
VT100, 2020-06-02
@VT100

Looking closely at the render (in the absence of a link to) KY-019, you can see that the relay board already has everything you need to control it from arduino. And a transistor switch with the necessary input resistor and a diode to dampen the self-induction of the winding when turned off.

A
Aks L, 2020-06-02
@AksVan

Good day! Transistor p-p-p (kt 814, Soviet, import analogues - Internet) base - output signal of the controller, collector - to the leg minus the relay, through a 20-30 ohm resistor, emitter - the general power supply of the controller. Plus the relay to the power supply of the controller (the voltage of the relay, it should be the same as the controller
If you gave a link to the program that you displayed the problem so coolly, then of course I would help you in better quality ..

E
evgeniy_lm, 2020-06-02
@evgeniy_lm

Why is there a transistor?

program - photoshop
separately looking for pictures. but this is generally drawing beauty for the tinkercad service. it's mostly 3d

such schemes are made in fritzing

S
Sergey Topolov, 2020-06-02
@topus009

I have a kt818v
resistor, I’ll look for a
program - Photoshop
separately looked for pictures. but this is generally drawing beauty for the tinkercad service. basically there is 3d
but there are also circuits with arduins and wiring is tied and you can even attach the C code and run it. I have a different MK and firmware. so not an option. thanks I'll try.

A
Alexey, 2020-06-02
@AlexeyKolodchenko

Here is the answer to your question. www.bizkit.ru/2019/03/13/12919
briefly - NPN transistor - 2N2222 or similar, 4.7 kΩ resistor (yf your circuit yellow wire) to limit the base current. It is advisable to put a 47 kΩ pull-up resistor, but this is not a prerequisite.

P
PeeX, 2020-06-02
@PeeX

Some kind of mosfet can be used, there are also those that can be connected directly to the MK, for example, some kind of IRL ... Or in general FCP16N60N instead of a relay (it should open from 2 to 4)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question