小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

實(shí)驗(yàn)室:使用晶體管通過Arduino控制高電流負(fù)載 - ITP物理計(jì)算

 青樓滿座wu0pn9 2018-08-08

                                 實(shí)驗(yàn)室:使用晶體管通過Arduino控制高電流負(fù)載

最初由Matt Richardson
2014年7月1日撰寫最后修改于2016年9月2日,作者:Benedetta Piantella Simeonidis

介紹

內(nèi)容[ 顯示 ]

在本教程中,您將學(xué)習(xí)如何控制高電流直流負(fù)載,例如直流電機(jī)或微控制器的白熾燈。微控制器只能從其輸出引腳輸出非常少量的電流。這些引腳用于發(fā)送控制信號(hào),而不是用作電源。從微控制器控制另一個(gè)直流設(shè)備的最常用方法是使用晶體管。晶體管允許您控制來自低電流源的高電流電路的流量。

你需要知道什么

為了充分利用本實(shí)驗(yàn),您應(yīng)事先熟悉以下概念。如果您不是,請(qǐng)查看以下鏈接:

  • 安全警告:  本教程介紹如何控制高電流負(fù)載。與早期教程相比,這會(huì)帶來更高的電力傷害危險(xiǎn)。在插入任何東西之前,請(qǐng)小心并仔細(xì)檢查接線,并且在電路通電時(shí)切勿更換接線。

你需要的東西

對(duì)于本實(shí)驗(yàn),您需要:
線路板 hookup_wire Arduino的 電位器
無焊面包板 22-AWG連接線 Arduino微控制器模塊 10Kohm電位器
diodes_400x 直流電源 晶體管 dc_motor
功率二極管(僅限直流電機(jī)版本) DC power supply TIP120 transistor DC Motor
OR  燈具支架
Incandescent lamp and socket

Connect the Breadboard

Connect the breadboard to the Arduino, running 5V and ground to the side rails:
LabTemplate_bb

Add a potentiometer

Connect a potentiometer to analog in pin 0 of the module:

LabHighCurrentArduinoPot_schem LabHighCurrentArduinoPot_bb
Schematic view Arduino with Potentiometer

Connect a transistor to the microcontroller

The transistor allows you to control a circuit that’s carrying higher current and voltage from the microcontroller. It acts as an electronic switch. The one you’re using for this lab is an NPN-type transistor called a TIP120. The datasheet for it can be found here. It’s designed for switching high-current loads. It has three connections, the base, the collector, and the emitter. The base is connected to the microcontroller’s output. The high-current load (i.e. the motor or light) is attached to its power source, and then to the collector of the transistor. The emitter of the transistor is connected to ground.

tip120_pinout
Pinout of a TIP-120 transistor from left to right: base,collector, emitter Schematic symbol of a TIP-120 transistor

Note: Using MOSFETS instead

You can also use an IRF510 or IRF520 MOSFET transistor for this. They have the same pin configuration as the TIP120, and perform similarly. They can handle more amperage and voltage, but are more sensitive to static electricity damage. MOSFETs are grouped into N-Channel and P-Channel, which are equivalent to NPN and PNP bipolar transistors. Here’s a quick translation table for the pin names on both:

Bipolar Transistor MOSFET
Base Gate
Collector Drain
Emitter Source

Connect the base to an output pin of the microcontroller, and the emitter to ground like so:

LabHighCurrentArduinoTransistor_schem LabHighCurrentArduinoTransistor_bb

Safety Warning: You can generally connect the base to a microcontroller’s pin directly without a current limiting resistor because the current from the pin is low enough. But it’s necessary if you’re controlling a transistor circuit without a microcontroller.

Connect a motor and power supply

Attach a DC motor to the collector of the transistor. Most motors will require more amperage than the microcontroller can supply, so you will need to add a separate power supply as well. If your motor runs on around 9V, you could use a 9V battery. A 5V motor might run on 4 AA batteries. a 12V battery may need a 12V wall wart, or a 12V battery. The ground of the motor power supply should connect to the ground of the microcontroller, on the breadboard.

LabHighCurrentArduinoMotorNoDiode_schem LabHighCurrentArduinoMotorNoDiode_bb

Next, add a diode in parallel with the collector and emitter of the transistor, pointing away from ground. The diode to protects the transistor from back voltage generated when the motor shuts off, or if the motor is turned in the reverse direction.

LabHighCurrentArduinoMotor_1_diode_schem LabHighCurrentArduinoMotor_1_diode_bb
The circuit with protection diode across the transistor The TIP120 can be replaced with a MOSFET if you prefer.

You may also find that adding a diode across the motor helps with back voltage protection as well, particularly when you’re running multiple transistor-motor circuits. If you plan to add a diode across the motor, here’s the circuit:

LabHighCurrentArduinoMotor_schem LabHighCurrentArduinoMotor_bb
A diode across the motor helps with back voltage protection as well 

Be sure to add the diode to your circuit correctly. The silver band on the diode denotes the cathode which is the tip of the arrow in the schematic, like so:

二極管

This circuit assumes you’re using a 12V motor. If your motor requires a different voltage, make sure to use a power supply that’s appropriate. Connect the ground of the motor’s supply to the ground of your microcontroller circuit, though, or the circuit won’t work properly.

Connect a lamp instead

You could also attach a lamp using a transistor. Like the motor, the lamp circuit below assumes a 12V lamp. Change your power supply accordingly if you’re using a different lamp. In the lamp circuit, the protection diode is not needed, since there’s no way for the polarity to get reversed in this circuit:

LabHighCurrentArduinoLamp_schem LabHighCurrentArduinoLamp_bb
Schematic view When the motor is replaced with a lamp there is no need for the protection diode

Program the microcontroller

Write a quick program to test the circuit. Your program should make the transistor pin an output in the setup method. Then in the loop, it should turn the motor on and off every second, just like the blink sketch does.

const int transistorPin = 9;    // connected to the base of the transistor
 void setup() {
   // set  the transistor pin as output:
   pinMode(transistorPin, OUTPUT);
 }
 void loop() {
   digitalWrite(transistorPin, HIGH);
   delay(1000);
   digitalWrite(transistorPin, LOW);
   delay(1000);
 }

Now that you see it working, try changing the speed of the motor or the intensity of the lamp using the potentiometer.

為此,請(qǐng)使用電位計(jì)讀取電壓  analogRead()。然后將結(jié)果映射到0到25??5的范圍,并將其保存在新變量中。使用該變量設(shè)置電機(jī)的速度或燈的亮度  analogWrite()。

const int transistorPin = 9;    // connected to the base of the transistor
 void setup() {
   // set  the transistor pin as output:
   pinMode(transistorPin, OUTPUT);
 }
 void loop() {
   // read the potentiometer:
   int sensorValue = analogRead(A0);
   // map the sensor value to a range from 0 - 255:
   int outputValue = map(sensorValue, 0, 1023, 0, 255);
   // use that to control the transistor:
   analogWrite(transistorPin, outputValue);
 }

對(duì)于電機(jī)用戶:這樣控制的電機(jī)只能向一個(gè)方向轉(zhuǎn)動(dòng)。為了能夠反轉(zhuǎn)電動(dòng)機(jī)的方向,需要H橋電路。有關(guān)控制帶H橋的直流電機(jī)的更多信息,請(qǐng)參閱  直流電機(jī)控制實(shí)驗(yàn)室

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多