【问题标题】:5volt Arduino Pro Mini Not Able to Drive 5 Volt actuator But The same work perfectly Done by Arduino Uno5volt Arduino Pro Mini 无法驱动 5 Volt 执行器,但同样的工作由 Arduino Uno 完美完成
【发布时间】:2019-04-18 09:21:50
【问题描述】:

我想用 5 伏 Arduino pro mini 驱动一个执行器,它是由手机的蓝牙信号控制的。

电路细节:

1)Arduino Promini 5 伏 2) Hc05蓝牙模块 3)5伏执行器 我直接给 Arduino pro mini 的 RAW 引脚供电 11.8 伏。

当它接收到 1 或 0 时,它无法控制执行器,并且在将执行器的数据引脚与 arduino pro-mini 的引脚 13 连接后,闪光灯持续闪烁

但以上相同的操作完全由 Arduino Uno Board 完成。那么有没有可能通过蓝牙信号使用arduino promini控制执行器。我使用 Arduino pro mini 而不是 Arduino Uno 的原因是它占用的空间更少。

Arduino 代码:

            #include<SoftwareSerial.h>

            SoftwareSerial BT(2, 3); 

            #include <Servo.h>

            Servo myservo;

            int ServoPin =13; 

            void setup()  
            {  
              Serial.begin(9600);
              myservo.attach(ServoPin);
              pinMode(ServoPin, OUTPUT);
              digitalWrite(ServoPin, LOW);
              myservo.write(40);

              // set digital pin to control as an output
              pinMode(9, OUTPUT);
             // set the data rate for the SoftwareSerial port
             BT.begin(9600);
            // Send test message to other device
            BT.println("Hello from Arduino");
            }
            char a; // stores incoming character from other device
            void loop() 
           {
             if (BT.available())// if text arrived in from BT serial...  

                {
                      a=(BT.read());
                       Serial.println(a);
                          if (a=='1')

                             { 
                           digitalWrite(9, HIGH); 
                           BT.println(" You have to turn oN the LED/servo| I got the command : 1 ")  ; 



                           Serial.println("I got the command :");



                           Serial .println(a);
                           myservo.write(180); 

                              a=' '; 
                               }
                           else if (a=='0')
                           {
                                myservo.write(40);

                                digitalWrite(9, LOW);

                                BT.println(" You have to turn Off the LED!/servo| I got the command :0");

                               Serial.println("I got the command :");

                               Serial .println(a);


                                          a=' ';
                                      }


                        }
                 }

【问题讨论】:

    标签: arduino arduino-ide


    【解决方案1】:

    我认为问题在于电流。首先检查驱动执行器需要多少功率。如果电流不足,您可以使用 ULN2003,它是一个继电器驱动器 ic,但如果您的空间较小,您可以将它用于您的 ckt,您可以使用单个达林顿对。

    【讨论】:

    • 除了执行器之外,其余的东西都在正常工作,或者它们也给出了不正确的结果???你能分享一下引脚 9 的读数(VI)吗
    猜你喜欢
    • 2016-12-27
    • 2019-02-19
    • 1970-01-01
    • 2017-05-23
    • 2022-01-15
    • 1970-01-01
    • 2016-07-17
    • 2013-10-27
    • 2016-02-23
    相关资源
    最近更新 更多