Noodlejay BlaBla

welcome and happy to share


發表留言

震盪電路 electronic oscillator

彰師大電子系-電子實習講義
http://eedept.ncue.edu.tw/study/labs/semiLab/Experiment.htm

Wien bridge oscillator 文氏電橋/偉恩電橋

Relaxation oscillator 弛張震盪電路

OpAmpHystereticOscillator from wiki

參考:

https://zh.wikipedia.org/zh-tw/%E7%94%B5%E5%AD%90%E6%8C%AF%E8%8D%A1%E5%99%A8

https://en.wikipedia.org/wiki/Relaxation_oscillator#Pearson%E2%80%93Anson_oscillator


發表留言

Arduino四相五線步進馬達28BYJ48 5V + ULN 2003A

四相就是步進馬達即是有四個線圈假設為A、B、C、D,做動原理就是透過脈波依序去激磁線圈,

A→B→C→D→A→B→………A→B→C→D→

而ULN2003A其實只是提供了很多組電晶體(達靈頓對),作用是放大提供給線圈的電流,因為Arduino本身沒辦法給那麼大的電流,而這顆IC可以節省很多接線和空間,但如果你沒有這顆IC,其實用四顆電晶體(達靈頓對)來搭電路,就可以達到一樣的功能。

在此提供了一個簡單的範例,如果有任何錯誤或不清楚的地方歡迎留言討論。

//NOTE:
//程式結果:維持同一個方向持續的旋轉。

int state[8][4]={
0,0,0,1,
0,0,1,1,
0,0,1,0,
0,1,1,0,
0,1,0,0,
1,1,0,0,
1,0,0,0,
1,0,0,1
};

int n=0;

void setup() {
  // put your setup code here, to run once:
  pinMode(8,OUTPUT); 
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(11,OUTPUT);
  
  Serial.begin(9600);

  for(int j=0;j<8;j++){
    for(int i=0;i<4;i++){
       Serial.print(state[j][i]);
       Serial.print(",");
    }
    Serial.println("");
  }

}

void loop() {
  // put your main code here, to run repeatedly:
  
        
        digitalWrite(8,state[n][0]);
        digitalWrite(9,state[n][1]);
        digitalWrite(10,state[n][2]);
        digitalWrite(11,state[n][3]);

        n++;
        if(n>7){
          n=0;
        }
        
        delay(5); // 控制轉速
    
}

參考資料:

步進馬達簡介:

https://openhome.cc/Gossip/CodeData/mBlockArduino/mBlockArduino16.html

香港教師?詳細拆解

https://miteen.hk/share/28BYJ-48/

管他什麼原理,只要給我library

https://blog.jmaker.com.tw/uln2003-28byj-48/

超詳細的篇幅介紹
https://cookierobotics.com/042/


發表留言

Arduino/樹梅派 小專案開發 / 物聯網 /專題製作

Arduino/ 樹梅派 Raspberry Pi/ 物聯網 專題/小專案開發 /教學,亦或系統整合

-物聯網熱影像偵測系統

-荷重藍牙傳輸顯示系統

-氣體管路壓力流量控制

-電磁閥控制系統

-量測資料擷取/監控

PC人機介面開發/ Android簡易APP

AR/VR 小專案開發

Zenbo機器人 群控/APP/教學

自動控制/影像處理/有限元素分析

有任問題歡迎來信詢問,依據需求與經費提供客製化:


發表留言

Arduino LCD Keypad Shield (非I2C)

不含IC2通訊模塊,直接透過Arduino的I/O去通訊,使用內建的LiquidCrystal.h 涵式庫,進行文字顯示。

本模組涵6個按鈕,Select、Left、Up、Down、Right、Rst ,說穿了除了Rst都是連接到分壓電路的不同點位,然後透過A0讀取電壓值,在進行判斷目前按下的按鍵。

這樣設計的好處是,只需要一個A0就可以使用五個按鈕,而非5個I/O。

而插上擴展板之後,留有沒有使用到腳位孔,可以自行從擴展版外接出來。

參考程式碼:

#include <LiquidCrystal.h>

const int pin_RS = 8; 
const int pin_EN = 9; 
const int pin_D4 = 4; 
const int pin_D5 = 5; 
const int pin_D6 = 6; 
const int pin_D7 = 7; 

LiquidCrystal lcd( pin_RS,  pin_EN,  pin_D4,  pin_D5,  pin_D6,  pin_D7);



void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);

  lcd.begin(16,2);
  lcd.setCursor(0,0);
  lcd.print("Chung Fu Test");
  lcd.setCursor(0,1);
  lcd.print("12345");

  //Back Light
  pinMode(10,OUTPUT);
  analogWrite(10,200);
}

void loop() {
  // put your main code here, to run repeatedly:
    int r=analogRead(A0);
    Serial.print("read=");
    Serial.println(r);

    

//數值請自行校正
    if (r < 60) {
      Do_clear();
      lcd.print ("Right ");
    }
    else if (r<150){
       Do_clear();
      lcd.print("Up");
    }
    else if (r < 300) {
       Do_clear();
       lcd.print ("Down    ");
    }
    else if (r < 450){
      Do_clear();
      lcd.print ("Left  ");
    }
    else if (r < 800){
      Do_clear();
      lcd.print ("Select");
   }

   delay(100);
    
}


void Do_clear(){
      //lcd.clear();

      lcd.setCursor(0,1);
      lcd.print("                ");
      lcd.setCursor(0,1);

  }

參考網址:

https://blog.jmaker.com.tw/lcd-keypad/

https://wiki.dfrobot.com/LCD_KeyPad_Shield_For_Arduino_SKU__DFR0009#target_5


發表留言

定電流

輸入5V,電流限定1.5 mA , 5/R=1.5 mA ,R即3.3K 。
這個電路等同於非反向放大電路,當RL變化的時候,輸出電壓會跟著變化,但最多就到OP最大的電壓,

因此當RL超過4.6K電流即開始衰減。

5(1+RL/3.3) ≦ 12
RL ≦ 4.62 K

網址:

$ 1 0.000005 10.20027730826997 57 5 50 5e-11
g 16 176 16 224 0 0
r 16 176 192 176 0 3300
r 192 144 336 144 0 2637
w 448 144 448 192 0
w 192 144 192 176 0
a 192 192 336 192 8 12 -12 1000000 4.999910047072881 5 100000
O 448 192 512 192 0 0
370 336 144 448 144 1 0 0
w 336 192 448 192 0
R 192 208 192 272 0 0 40 5 0 0 0.5
p 192 144 48 32 1 0 0
p 448 192 448 288 1 0 0
x 225 10 524 40 4 24 OP供電正負12\s\s\\n\s\s電阻>4.6K\s電流即開始衰減
x 252 108 267 111 4 24 R
x 271 108 278 111 4 15 L
o 6 64 0 4098 20 0.00009765625 0 1
38 2 0 50 10000 RL