本篇使用Arduino 及 TEA5767 模組DIY一個FM 接收器

 

 

Connect TEA 5767 to Arduino Uno in the following way:
        SDA of TEA5767 breakout board to A4 of Arduino.
        SCL of TEA5767 breakout board to A5 of Arduino.
        GND of TEA5767 breakout board to GND of Arduino
        VCC of TEA5767 breakout board to VCC of Arduino.

 

 Here is the sketch. Note you need Arduino 1.0

#include <Wire.h>

unsigned char frequencyH = 0;
unsigned char frequencyL = 0;

unsigned int frequencyB;
double frequency = 0;

void setup()
{
  Wire.begin();
  frequency = 93.0; //starting frequency
  setFrequency();
  Serial.begin(9600);
}

void loop()
{
  int reading = analogRead(0);
  //frequency = map((float)reading, 0.0, 1024.0, 87.5, 108.0);
 
  frequency = ((double)reading * (108.0 - 87.5)) / 1024.0 + 87.5;
  frequency = ((int)(frequency * 10)) / 10.0;
 
  setFrequency();
  Serial.println(frequency);
}

void setFrequency()
{
  frequencyB = 4 * (frequency * 1000000 + 225000) / 32768;
  frequencyH = frequencyB >> 8;
  frequencyL = frequencyB & 0XFF;
  delay(100);
  Wire.beginTransmission(0x60);
  Wire.write(frequencyH);
  Wire.write(frequencyL);
  Wire.write(0xB0);
  Wire.write(0x10);
  Wire.write((byte)0x00);
  Wire.endTransmission();
  delay(100); 
}

 

Anther code example

 

The Arduino code is as below:

/// Original from Arduino FM receiver with TEA5767 http://www.electronicsblog.net
// Modified by Jingfeng Liu
//  LinkSprite.com
//
#include <Wire.h>
#include <LiquidCrystal.h>

unsigned char search_mode=0;

int b=0;
int c=0;

#define Button_next 6
#define Button_prev 7

unsigned char frequencyH=0;
unsigned char frequencyL=0;

unsigned int frequencyB;
double frequency=0;

double freq_available=0;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()   {

  Wire.begin();
  lcd.begin(16, 2);

  /// buttons

  pinMode(Button_next, INPUT);
  digitalWrite(Button_next, HIGH); //pull up resistor

  pinMode(Button_prev, INPUT);
  digitalWrite(Button_prev, HIGH); //pull up resistor

  frequency=87.5; //starting frequency

  frequencyB=4*(frequency*1000000+225000)/32768; //calculating PLL word

  frequencyH=frequencyB>>8;

  frequencyL=frequencyB&0XFF;

  delay(100);

  Wire.beginTransmission(0x60);   //writing TEA5767

  Wire.write(frequencyH);
  Wire.write(frequencyL);
  Wire.write(0xB0);
  Wire.write(0x10);
  Wire.write(0x00);
  Wire.endTransmission();

  delay(100);

}

void loop()
{

  unsigned char buffer[5];

  lcd.setCursor(0, 0);

  Wire.requestFrom(0x60,5); //reading TEA5767

  if (Wire.available())

  {
    for (int i=0; i<5; i++) {

      buffer[i]= Wire.read();
    }

    freq_available=(((buffer[0]&0x3F)<<8)+buffer[1])*32768/4-225000;

    lcd.print("FM ");

    lcd.print((freq_available/1000000));

    frequencyH=((buffer[0]&0x3F));

    frequencyL=buffer[1];

    if (search_mode) {

      if(buffer[0]&0x80) search_mode=0;

    }

    if (search_mode==1) lcd.print(" SCAN");
    else {
      lcd.print("       ");
    }

    lcd.setCursor(0, 1);

    lcd.print("Level: ");
    lcd.print((buffer[3]>>4));
    lcd.print("/16 ");

    if (buffer[2]&0x80) lcd.print("STEREO   ");
    else lcd.print("MONO   ");

  }

  ///// buttons read

  //////////// button_next//////////
  if (!digitalRead(Button_next)&&!b) {

    frequency=(freq_available/1000000)+0.05;

    frequencyB=4*(frequency*1000000+225000)/32768+1;

    frequencyH=frequencyB>>8;
    frequencyL=frequencyB&0XFF; 

    Wire.beginTransmission(0x60); 

    Wire.write(frequencyH);
    Wire.write(frequencyL);
    Wire.write(0xB0);
    Wire.write(0x1F);
    Wire.write(0x00);

    Wire.endTransmission();

    //////////////////////

    b=100;

  };

  if (!digitalRead(Button_next)&&b==1) {

    ///scannnn UP

    search_mode=1;

    Wire.beginTransmission(0x60); 

    Wire.write(frequencyH+0x40);
    Wire.write(frequencyL);
    Wire.write(0xD0);
    Wire.write(0x1F);
    Wire.write(0x00);

    Wire.endTransmission();

    /////////////////

    b=100;

  };  

  if (!b==0) b--;

  //////////// button_prev//////////
  if (!digitalRead(Button_prev)&&!c) {

    frequency=(freq_available/1000000)-0.05;

    frequencyB=4*(frequency*1000000+225000)/32768+1;

    frequencyH=frequencyB>>8;
    frequencyL=frequencyB&0XFF;

    Wire.beginTransmission(0x60); 

    Wire.write(frequencyH);
    Wire.write(frequencyL);
    Wire.write(0xB0);
    Wire.write(0x1F);
    Wire.write(0x00);

    Wire.endTransmission();

    c=100;

  };

  if (!digitalRead(Button_prev)&&c==1) {

    ///scannnn DOWN

    search_mode=1;

    Wire.beginTransmission(0x60); 

    Wire.write(frequencyH+0x40);
    Wire.write(frequencyL);

    Wire.write(0x50);
    Wire.write(0x1F);
    Wire.write(0x00);
    Wire.endTransmission(); 

    c=100;

  };        

  if (!c==0) c--;

  ////////////////////

}

Another code from

http://www.instructables.com/id/How-to-use-the-TEA5767-FM-Radio-module-Arduino-Tut/ 

/* How to use the TEA5767 FM radio Module with Arduino
   More info: http://www.ardumotive.com/how-to-use-the-tea5767-fm-radio-module-en.html
   Dev: Vasilakis Michalis // Date: 21/9/2015 // www.ardumotive.com    */

//Libraries:
#include <TEA5767.h>
#include <Wire.h>

//Constants:
TEA5767 Radio; //Pinout SLC and SDA - Arduino uno pins A5 and A4


//Variables:
double old_frequency;
double frequency;
int search_mode = 0;
int search_direction;
unsigned long last_pressed;
unsigned char buf[5];
int stereo;
int signal_level;
double current_freq;
unsigned long current_millis = millis();
int inByte;
int flag=0;

void setup () {
  //Init
  Serial.begin(9600);
  Radio.init();
  Radio.set_frequency(95.2); //On power on go to station 95.2

}

void loop () {
 
  if (Serial.available()>0) {
    inByte = Serial.read();
    if (inByte == '+' || inByte == '-'){  //accept only + and - from keyboard
     flag=0;
    }
  }


  if (Radio.read_status(buf) == 1) {
     current_freq =  floor (Radio.frequency_available (buf) / 100000 + .5) / 10;
     stereo = Radio.stereo(buf);
     signal_level = Radio.signal_level(buf);
     //By using flag variable the message will be printed only one time.
     if(flag == 0){
      Serial.print("Current freq: ");
      Serial.print(current_freq);
      Serial.print("MHz Signal: ");
      //Strereo or mono ?
     if (stereo){
       Serial.print("STEREO ");
      }
  else{
    Serial.print("MONO ");
  }
     Serial.print(signal_level);
     Serial.println("/15");
     flag=1;
     }
  }
  
  //When button pressed, search for new station
  if (search_mode == 1) {
      if (Radio.process_search (buf, search_direction) == 1) {
          search_mode = 0;
      }
  }
  //If forward button is pressed, go up to next station
  if (inByte == '+') {
    last_pressed = current_millis;
    search_mode = 1;
    search_direction = TEA5767_SEARCH_DIR_UP;
    Radio.search_up(buf);
  }
  //If backward button is pressed, go down to next station
  if (inByte == '-') {
    last_pressed = current_millis;
    search_mode = 1;
    search_direction = TEA5767_SEARCH_DIR_DOWN;
    Radio.search_down(buf);
  }
  delay(500);
  
}

 

參考資料

TEA5767 datasheet

Arduino FM receiver with TEA5767(*)

MicroPython ESP8266 I2C documentation(*)

How to Use the TEA5767 FM Radio Module - Arduino Tutorial

TEA5767 FM Radio Breakout Board for Arduino

https://www.electronicsblog.net/arduino-fm-receiver-with-tea5767/

Use TEA5767 FM Module to Create an Arduino Based FM Radio

http://www.raspberry-pi-geek.com/Archive/2016/16/Remote-controlled-Arduino-FM-radio
http://www.ardumotive.com/how-to-use-the-tea5767-fm-radio-module-en.html

 

 

文章標籤

stanley 發表在 痞客邦 留言(1) 人氣()

(1)How to Make an Automatic Hacksaw at Home -Rzilla

(2)How To Make A Drill Press Hacksaw

http://toolmonger.com/2008/04/16/boa-versa-saw/

 

http://www.technologystudent.com/equip1/phcksw1.htm

https://www.youtube.com/watch?v=BHFO4q5PvYc

 

https://www.youtube.com/watch?v=8TvwB-rbnvk

 

How to make a Powerful 24V JIGSAW at home DIY Chainsaw

undefined

 

   

 

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

我們家裡總是有一、二台廢棄不用的光碟機,丟掉又覺得可惜,於是收集一些文章看看如何將光碟機廢物再利用,看看創客們的創意能做些什麼事情,是可行的嗎或是一堆爛又或許可以給我們一些新的創意和想法。
PS: 利用光碟機製作出來的CNC列印最大範圍為4x4公分

(1)用兩臺光碟機和一臺Raspberry Pi打造繪圖機器人

比較簡易的介紹,並没有描述出全部的製造過程,但創意十足

(2)作一個CNC的寫字機

很省錢的作法,拆了光碟機的步進馬達當作X軸Y軸,39元的保鮮盒及麻將牌尺當支架
(3) 拆光碟機,作點好玩的
分解光碟機步驟及拆光碟機技巧,可以仔細閱讀。
(4)用cd-rom 拆的零件做cnc 控制-1
這篇也是分解光碟機步驟,有圖及馬達電路測試可以仔細閱讀。
(5) CNC Clock製作
這篇記錄如何拆光碟機雕刻機的製作歷程雕刻機的製作歷程至組裝CNC clock的所有步驟。
(6)雕刻機的製作歷程

這雕刻機套件是利用兩個光碟機作 x y 軸控制,在x軸上方放置 雷射利用雷射的聚光將木片 或是可以吸收熱能的物品燒焦,以達到光雕的功能!!
(7)Arduino : 舊光碟機變身紅外線遙控車
(8)自製光桌

(9)射雕刻機:廢舊光碟機的涅槃之路


這篇記錄雕刻機的製作歷程及分享雕刻機製作出來的許多物品。
(10)CNC
記錄L298N及步進馬達之間的連接方式及測試。
 
(11)Mini CNC Plotter - Arduino Based
這個網站列出所需要的元件和使用Arduino測試馬達運轉
(12)Arduino筆記(二十五):Mini DVD 繪圖機

 

#----------------

元件參考網站

3D列印機DIY (偏貴,但元件表列完整)

 

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

 LED燈珠的型號

LED燈珠的型號太多了,有直插和貼片式的,還有大功率燈珠,燈珠電流從幾十毫安到幾安的都有,電壓就比較一致,大多都在三點幾伏。沒辦法一概而論。 粗略說,
按封裝分為直插、貼片;
按功率說分為大、中、小功率 。
#------------------------------------------------

貼片封裝為0805、1206等小功率管,工作電流一般為10毫安,但也有例外。
貼片封裝為3014、3528、3535等小功率管,工作電流一般為20~50毫安,但也有例外;
貼片封裝為5050、5060、5630等中功率管,工作電流一般為50~150毫安,但也有例外;
大功率LED全是貼片封裝,各公司不同品牌不同系列參數有很大不同;但標稱1W的一般工作電流都是350mA。

#--------------------------------

小功率

小功率的直插式LED燈珠,一般都是按直徑分型號的3mm 4mm 5mm 8mm 10mm 12mm。不論直徑大小,其工作電壓和工作電流都是一樣的。小功率紅光LED(比如常見的5MM直插)電壓2v,電流15毫安。

顏色分:紅光 黃光 1.7--2.1V

白光 藍光 暖白光 粉紅光 紫色光 2.8--3.6V

綠光2.6--3.4V

大功率
大功率白光LED(比如CREE的XML-T6)單顆功率已經達到10W,電壓3.3v電流3A, #-----------------------------

LED燈珠的規格

1.0.06W的,電壓是2.5-3.5V,電流是20mA。
2.0.5W的,電壓是2.5-3.77V,電流是150mA。
3.1W的,電壓是2.79-3.99V,電流是350mA。
4.3W的,電壓是3.05-4.47V,電流是700mA。
5.5W的,電壓是3.16-4.88V,電流是1000mA。

燈珠1W的電流:320-350mA ,選驅動一般是選300mA電流的,晶片大小30mil 、35mil、 40mil、 45mil 。
燈珠3W的電流:700mA ,驅動一般600mA ,晶片大小45mil 。
1W 3W電壓都在3.0-3.6V之間 ,好點的3.2-3.4V 。

至於5W的單顆晶片一般是50mil以上的,其他參數尚不明確。
一般用作照明用的LED燈珠由0.5w-5w的都有, 工作電壓在3-3.2V左右。  

在LED燈產品中常聽到的流明值、照度、光色,其單位和意義是什麼?

 在照明產品中,流明值代表的是「光通量」。也就是在積分球中所有光通量的數量。但是流明值不一定等於實際使用上的亮度,因為光學的設計和光的指向性都對實際照度有所影響。
照度的單位是Lux,也就是實際上在某特定位置的亮度。照度的測量是以照度計來量測的,基本上離光源越遠,照度值就越小。
光色是指其光的顏色,以目前的LED燈照明產品來說,光色分兩種
6500K左右的正白光與3000K左右的黃光。

LED燈的瓦數怎麼分?
為什麼有的一顆3W,有的一顆說是1W,有的七顆說是7W,有的七顆說是10W呢?

目前高功率的晶粒主流都是350mA,3.3V。也就是說,一顆就是大約1.155瓦。但是有的業者為了節省晶粒的成本,會以加大電流的方式驅動LED,來提高LED的耗電量並提高亮度。但是這樣的光效是不好的,平均每瓦的流明值會下降,同時會影響到LED的壽命。或者有些業者是以耗電量來定義瓦數,然而運用比較不好的Driver,其功率因數較低,耗電量也會較高。比較好的方式是以LED本身的最優化設計來驅動,並以其功率來比較產品才對。基本上只要是一顆LED,都把它看成1.1W左右即可,如果7顆但是標示10W的耗電量,有可能是因為其Driver功率因數大約只有80%左右。

LED電阻值裝配計算式 

(電源電壓V-LED切入電壓V)÷限流電流A=電阻值Ω

範例

使用變壓器.輸出為DC12V的電源下,串聯3顆超白光LED(1W的,電壓是2.79-3.99V,電流是300mA~350mA)。

電源電壓:12V LED切入電壓:我們取平均電壓3.5V
3.5V*3=10.5 限流電流:300mA(mA千分之一安培) 

帶入算式

(12V-10.5V)÷ 300mA=5Ω

參考網站  : LED 串聯電阻計算器 

燈頭規格:

E40燈具:常見於工廠屋頂(天井燈)或較高處之照明,一般瓦數較高,40瓦-1000瓦
E27燈具:一般家庭常見燈泡,使用範圍廣,適用於吊燈、吸頂燈、壁燈、衛浴燈、風扇燈等。E27表示該燈頭為螺旋式,螺殼螺紋內徑為27mm。

E12燈具:常見於神龕的小燈泡,一般用於蠟燭式吊燈,壁燈。
E12表示該燈頭為螺旋式,螺殼螺紋內徑為12mm。
G9燈頭:主要用於一些燈罩較小,燈體尺寸較小之燈具。
G9表示該燈頭為插入式,兩插腳中心距離9mm。
MR16、MR11:MR代表多重反射罩,數字代表前直徑,MR16是16*1/8=2英吋。
GU10:G表示燈頭類型是插入式,U表示燈頭部分呈現U自形,10表示燈腳孔之間的中心距是10mm。
MR16 LED: 多用在非主照明上,例如櫃內擺飾品,牆上小幅詩畫
AR111 LED: 可以當主照明,例如客廳等較高的空間,通常不會只放一盞

這種AR111跟MR16 都是屬於投射燈 只是差別在於大小要當主照明就用15CM嵌燈,氣氛用就選MR16或AR111

燈管規格:
T5/T8/T9三種最為常見,T指燈管,數字代表1/8英吋的倍數,
例如T5表示直徑為5/8英吋(約16mm),T9就是9/8英吋(29mm)。

傳統燈泡改LED燈泡

只要燈座尺寸相同即可,一般為螺旋燈頭E12/E14/E27/E40。而一般小家庭用的燈泡燈頭多為E27。拜神明的蠟燭燈為E12/E14。公共區域所用的水銀燈/天井燈則多為E40燈頭。
燈管部份,與燈泡不同,無法直接替換。因為日光燈(螢光燈)需要有(點燈器)(或稱啟動器)以及(安定器)才能發光,而這兩者反而會干擾LED燈管;所以原本使用日光燈的燈具,需先處理內部的線路,將點燈器以及安定器移除,才能更換成LED燈管。
參考網站: LED燈具改裝達人

LED投射燈
現在應用較多的LED投射燈基本上是選用1W大功率LED管(每個LED管會帶有一個由PMMA製成的高光效透鏡,其主要功用是二次分配LED管發出的光),呈單線排列(二線或多線排列的將其歸為LED投射燈),大多數LED投射燈的LED管都是共用一個散熱器,也有的廠家是每一個LED管安置一個小型散熱器,其發光角度一般有窄(20度左右)、中(50度左右)、寬(120度左右)三種,目前,大功率LED投射燈(窄角度)的最遠的有效投射距離為15-20米,其常用功率大概有8W、12W、24W、27W、36W等幾種功率形式,而它們的常用外形尺寸一般為300、500、600、1000等幾種,可以按實際工程應用選擇不同的長度和功率密度。


LED投射燈應用場所

單體建築、歷史建築群外牆照明。大樓內光外透照明、室內局部照明。綠化景觀照明、廣告牌照明。醫療、文化等專門設施照明。酒吧、舞廳等娛樂場所氣氛照明等。

買投射燈需要注意什麼?

光束角:也就是指向性光源,如 R、PAR、MR、AR等反射型燈種,因發出的光經本身反射面的反射控光使光線集中向前投射,在其光度分佈曲線上以 50% 最大光度形成的夾角稱為光束角。 光束角隨燈種而異: R 反射燈泡僅有單一光束角度(25°或 30°),光強度較柔和。 PAR-38 有廣角 30°(FL)及窄角12°(SP)二種 MR-16有 8°/12°/24°/36° / 60°等多種光束角燈種。 相同燈種、相同光通亮,其光束角愈小光愈集中、中心點光強度愈高,投射出光形範圍愈小。


LED 電路

LED這個東西的亮度控制在於電流,而非電壓。電流越大,就能提供越高的亮度。通常這類的LED工作電流大約在25mA上下。所以不能直接接上電源,必須使用串聯一個適當的電阻限制電流。
而高功率1W的一顆LED工作電流就大多了,1W的約在100-350mA。3W的則在400-700mA之間。是超過一般LED的10倍甚至20倍。所以亮度自然非常的亮囉。1W約最大約可以提供50流明的照度喔。
LED發光是以電流強度,不是電壓! 當電流超過LED Imax,LED便會燒毀只要是電流低於LED Imax額定電流以下,用幾伏特直流電都是一樣的亮度!
而Imax是靠啥控制的呢? 就是限流電阻! 決定電路電流大小........前提當然是要電壓是固定值!
所以我們需要LED定電流模組或LED定電流IC去提供LED所需要的電流

熱能比較

目前的傳統燈具皆是以熱能原理來發出光源

以下作簡略說明

1.  日光燈管,亦稱作螢光燈管是使用電力在氣中激活汞蒸氣形成電漿並發出短波紫外線,令質(螢光粉)發出可見的螢光以照明。

 

2.  鎢絲燈(白熾燈)

白熾燈的發光原理都是利用物體受熱發光原理和熱輻射原理而實現的,就是給燈絲導通足夠的電流,燈絲發熱至白熾狀 態,就會發出光亮。

3.  鹵素燈泡與白熾燈的原理大致相同,最大差別在於,鹵素燈的玻璃外殼中充有一些鹵族元素氣體(通常是),其工作原理為:當燈絲發熱時鎢原子被蒸發後,會和鹵素原子結合在一起,形成鹵化鎢(碘化鎢溴化鎢),鹵化鎢遇熱後又會重新分解成鹵素蒸氣和鎢,鎢又在燈絲上沉積下來,彌補被蒸發掉的部分。

 

4.  省電燈泡

省電燈泡的發光原理與日光燈(螢光燈)大致相同,是將螢光燈安定器組合成一個整體的照明設備。

省電燈泡所含的物料包括金屬、玻璃和汞(水銀)。在使用時,會產生些微的電磁波微波

 

如何判斷夠不夠亮

 照度 (Illuminance) ,單位為勒克斯 (Lux-lm / ㎡ ) 或稱米燭光 。單位面積內所接受射入的光通量,用來表示某一場所的明亮度。 1 平方公尺面積上總光通量有 1 流明時,稱為該面積上照度為 1 勒克斯 (Lux) 。不同的場合所需的照度不盡相同,可參考以下簡表規劃設計。

 
 

亮度及空間坪數關連參考

10W吸頂燈 20W吸頂燈 30W吸頂燈
1-2坪 2-3坪 3-4坪
樓梯間,儲藏室 樓梯間,儲藏室,廚房 儲藏室,廚房,客廳

 

 LED 崁燈燈具採購參考

高度:2M以下 高度:2~2.25M 高度:2.5M~3M 高度:3~3.5M
瓦數:10W以下 瓦數:10W 瓦數:12W 瓦數:15M
照度:400-700lm 照度:700-1000lm 照度:1000-1200lm 照度:1200-1500lm

 

 LED 瓦數與流明的關係

以往在購置燈泡的時候,消費者一直是使用「瓦數(W)」作為購置指標,如100瓦 , 60瓦, 或40瓦,而非以亮度單位「流明(lm)」。但隨著照明技術的提高,每瓦可發生的照度也一直在提升。以前100瓦白熾燈(約1,520流明),現在27瓦的節能燈泡(CFL或稱螺旋燈泡,雖然不一定是螺旋狀)即可實現,而LED燈泡只需要大約15瓦,甚至更低。 所以說,您如需要1,520流明,用白熾燈泡須耗100瓦,用節能燈泡需耗27瓦,用LED大約只需消耗15瓦。因此相同瓦數來比較,流明越高表示越亮, 一坪約需60燭光(=60w)亦即如果是3w的led就需要4顆=1顆60w的傳統燈泡的亮度。購置LED燈泡,我們需要的是亮度,不是瓦數。以往的習慣是以瓦數作為評判標準。同樣的亮度,瓦數越高當然消耗的電量也就越多了。其實,亮度的單位是流明(lm)。傳統燈具由於技術及材料單一,一直以瓦數當單位。但離開LED照明時代,因各廠商技術實力有所不同,再以瓦數當單位會招致混亂,無法停止區分。例如,以一個1,000流明的LED燈泡而言,技術好的廠商10瓦就可到達。技術一般的廠商,則需要13瓦才可以做到。所以,通常的計算是以空間坪數去換算顆數的需要量。問題來了,該選幾瓦或是多少流明的LED燈泡呢?一般而言,書桌上的檯燈約需60瓦的白熾燈泡,約810流明,LED燈泡約需9瓦。床頭燈約需40瓦白熾燈泡,約485流明,LED燈泡約需7瓦。天花板的筒燈,需100瓦的白熾燈泡或23瓦節能燈泡,約1520流明,LED燈泡約需13或15瓦。當然,製造商技術不同,流明數與瓦數的比照也會不同。所以,看流明數較有參考性。所以選購時要參考LED燈泡瓦數、流明數和用途的說明。大家不要選錯方向了。 

每種燈泡每瓦的基本流明可參考下面資料。

光源種類 額定功率 光通量 (Lm) 光效 (Lm/W)
T5 螢光燈管,14W 14W 1250 89.29
T9或T8 普通螢光燈管,20W 20W 1050 52.50
T9或T8 三波長螢光燈管,20W 20W 1400 70.00
節能燈 CFL 13W, 螺旋型 13W 875 67.31
節能燈 CFL 21W, 螺旋型 21W 1200 57.14
節能燈 CFL 17W, 球型 860 17W 780 45.88
PL燈, 13W 13W 860 66.15
白熾燈泡 100W 1250 12.50
LED 7W 560 70~90(依色溫而定)


白熾燈泡,約12流明/瓦=我們以40W燈泡來算=40*12=480流明 
螢光燈泡(省電燈泡),約57流明/瓦=我們以10W燈泡來算=10*57=570流明 
LED燈泡,約70~80流明/瓦=我們以7W來算=7*80=560流明左右 

9W或10W LED 可直接取代 12W省電燈泡與 60W白熾燈燈泡
7W LED 可直接取代 10W省電燈泡與 40W白熾燈燈泡

LED色溫和發光效率

undefined
低色溫:色溫在3300K以下,光色偏紅給以溫暖的感覺;有穩重的氣 氛,溫暖的覺;當採用低色溫光源照射時,能使紅色更鮮豔。
中色溫:色溫在3000--6000K為中間,人在此色調下無特別明顯的視 覺心理效,有爽快的感覺;所以稱為“中性”色溫。當採用中色溫光 源照射時,使藍色具有 清涼感。
高色溫:色溫超過6000K,光色偏藍,給人以清冷的感覺,當採用高 色溫光源照時,使物體有冷的感覺。

 色溫 IF (MA) Lm CCT (K) Power (W) lm/W
2700K 60 261.3 2770 3.8W 68.5
4000K 60 319.5 3997 3.8W 83.4
5000K 60 358.2 4980 3.8W 93.5
5700K 60 358.7 5412 3.8W 93.8
6500K 60 365.2 6188 3.8W 95.6
8000K 60 374.8 7799 3.8W 98.0


原文網址:https://read01.com/KDR36R.html

參考電路如下:
(1)LM3402構成的1W串聯LED路燈驅動器
(2)TPS61165 LED升壓轉換器應用電路
(3)基于AP8801构成的1W功率的高效高亮度LED灯驱动电路
(4)基于PT4105构成的高效率1W的LED灯电路
(5)採用PT4115的LED光源驅動電路設計(16元)
(6)高效!7×1W LED升壓驅動ic
(7)二個TL431組成的LED恆流電路圖及原理分析
(8)小電路、小技巧:基於TL431的恆流恆壓充電電路
(9)採用LM3241的3W LED燈電路圖
(10)大功率LED恆流驅動方案選擇及設計實例(LM321)(LM2734)

(11)High Power LED Driver Circuits(MOS &NPN)
(12)Ultimate Night Vision Headlamp - 500+ Lumens With Only 8 Watts(Good)
(13)Power LED's - Simplest Light With Constant-current Circuit(Good)

                        

 

 

 

 

 

LM3402構成的1W串聯LED路燈驅動LM3402構成的1W串聯LED路燈驅動

LM3402構成的1W串聯LED路燈驅動

 


 

 

 

 

 

 

文章標籤

stanley 發表在 痞客邦 留言(2) 人氣()

     

       TP4056簡介:TP4056是一款完整的單節鋰離子電池恆定電流/恆定電壓線性充電器。TP4056可以配合USB電源和適配器電源工作。 由於採用了內部PMOSFET架構,加上防倒充電路,所以不需要外部隔離二極體。熱反饋可對充電電流進行自動調節,以便在大功率操作或高環境溫度條件下對晶片溫度加以限制。充電電壓固定於4.2V,而充電電流可通過一個電阻器進行外部設置。當充電電流在達到最終浮充電壓之後降至設定值1/10時,TP4056將自動終止充電循環。

 台灣遙控模型RCTW-USB充電模組TP4056 

 

以下為我買的TP4056模組規格(NT$ 15)
1A 鋰電池 專用充電板 充電模組 TP4056 鋰電池充電器 Micro USB 

鋰電池充電板

充電方式:線性充電

充電電流:1A(可調)

充電精度:: 1.5%

輸入電壓:4.5V-5.5V

滿充電壓:4.2V

充電指示:紅燈充電 藍色充滿

輸入介面:Micro USB

工作溫度:-10℃ 到 +85

重量:1.8g

尺寸: 25*19*10mm

 產品特點:

  • 本模組使用非常成熟的充電晶片TP4056,週邊電路簡單,保護性能好,充電精度高。
  • 本模組完全機械自動化加工,全貼片零件製造,每個模組出貨之前都會測試,可靠性高。
  • 本模組電流可自行調節,只要更改電路板中的固定電阻,就能更改輸出致100mA-1000mA,非常方便。

 使用說明/注意事項

  • 充電電流最好是電池容量的0.37C,就是容量的0.37倍,比如1000mAH的電池充電電流400這樣就夠了。過大充電速度快效果就差,沖完了電池電壓掉的就多!
  • 充電連接導線不能過細過長。這樣連接電阻大。太細的話沖完了電池電壓掉的就多。
  • 與電池連接最好接觸良好。不然沖完了電池電壓掉的就多。
  • 如果5V的輸入電壓偏高,比如5.2甚至5.5,會造成充電電流不足1000mA,這是正常的。電壓高了晶片發熱會自動減小充電電流,不至晶片燒毀。晶片在工作中60度左右發熱是正常的。畢竟充電電流大。

 

TP4056的輸出電流為1000 mA左右,但是如果我們有不同的電池,我們需要對輸出電流值進行調整。

 

 (2) 4個18650 Battery Charger

(3)5個 DIY: Lithium 18650 Cells Charger by Using TP4056 Modules

 

 

(4)有光就有電:DIY能為手機充電的太陽能充電器

stanley 發表在 痞客邦 留言(3) 人氣()

與老婆商量後決定diy一個躺椅,因此先收集理想的躺椅尺寸與外形

下個步驟要再尋找合適的木材及裁切尺寸

(1) 躺椅尺寸與外形

躺椅尺寸:1920*600*450mm(椅背二段式)

(2)

 

190cm * 69cm * 56 cm

 

180cm * 68cm * 36cm

 

 

 

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

 

2017 06 03

當使用 ftp.nlst 去列出在Server上的檔案,但是當程式在Server上找不到任何符合條件的檔案時
程式會中止且產生下面的錯誤訊息

ftplib.error_perm: 550 No files found.

 

我們可使用下面的程式片段去解決這個空目錄的問題

try:
    ls = ftp.nlst('D1*.txt')
except ftplib.error_perm as e:
    print "Directory is empty : "+str(e)
    exit(1)

 

回主目錄

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

 

H-Bridge Motor Control with Power MOSFETS

MOSFET H-bridge with opto-isolation.

DIY MOSFET Motor Controller

 

PWM Control of a Larger DC Motor

4 NPN Bridge to control DC motor

 Bidirectional motor control

Raspberry Pi and Arduino Serial Communication

 

電池反接保護電路  https://read01.com/zh-tw/zBjkJR.html#.WfqLpZAVHI4

undefined

VZ1為穩壓管防止柵源電壓過高擊穿mos管。NMOS管的導通電阻比PMOS的小,最好選NMOS。

STEPPER MOTOR CONTROL CIRCUIT WITH PIC16F84A MOSFET

undefined

http://www.bristolwatch.com/L298N/stepper.htm

undefined

http://hades.mech.northwestern.edu/index.php/Unipolar_Stepper_Motor_Driver_Circuit

undefined
原文網址:https://read01.com/zBjkJR.html

 

 

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

2017/05/25

此需求是以python和openpyxl,ftplib為主,從unix主機下載指定的csv檔,並且自動的將csv轉成xlsx檔案
而其中第一row為中文標題,而第三column為日期yy/mm/dd形式,我們要將日期格式轉成yy/mm/dd的文字格式

#-------------------------------------------
# -*- coding: big5 -*-
from ftplib import FTP, all_errors
from openpyxl import Workbook
from openpyxl.styles import Font, Fill
import datetime
import wx
import os
import re
import csv
import sys

def getFile(filename):
    try:
       ftp.retrbinary("RETR " + filename ,open(filename, 'wb').write)
    except:
       print('檔案下載失敗!')
       print "Error"
 
try:
       ftp = FTP("XXX.XXX.XX.XX")
       ftp.login("XX","XXX")
       print('使用者連線成功')
    
except AttributeError:
       print('連線失敗(主機或帳號或密碼錯誤)')
       ftp = None
      
except all_errors, err:
       print(str(err))
       ftp = None

# download the file 
local_Dir  = "c:\\tmp"
host_Dir = r"/BACK2/f/"
print "Changing local directory to " + local_Dir
os.chdir(local_Dir)
print 'Changing remote directory to ' + host_Dir
ftp.cwd(host_Dir)
ls = ftp.nlst('*-*.csv')
count = len(ls)
curr = 0 
print "found {} files".format(count)
for filename in ls:
    curr += 1   
    print "get file {} to {}".format(filename,local_Dir)
    getFile(filename)                                                  #從unix 的指定目錄下下載指定的檔案  
 
ftp.quit()
ftp = None
print('ftp離線')                                                   # ftp 完作成且離線
#-------- open csv and transfer to excel automatically--------
for fnList in ls:                                                          #依次開啓所有的csv檔案
  fileName, file_extension = os.path.splitext(fnList)
  saveFn = fileName + '.xlsx'                                     #分開檔名及檔案 extension
  print saveFn                                                           #印出每個檔案l值,視情況可以省略
  wb = Workbook()
  ws = wb.active           
  with open(fnList, 'r') as f:
     reader = csv.reader(f)
     for r, row in enumerate(reader):                            #設定row 迴圈
       for c, col in enumerate(row):                               #設定column 迴圈
         for idx, val in enumerate(col.split(',')):
           cell = ws.cell(row=r+1, column=c+1)
           cell.font = Font(size=12)                                 #設定字體大小
           if (c == 3 and r > 0):                                      #特殊需求處理,要將日期格式轉成文字格式
             val = "{:10}".format(val)                              #特殊需求處,只有第3column及row2以後要處理格式
             cell.value = val                                             #將值填入cell內  
             cell.number_format = 'yy/mm/dd'                  #文字格式
           else:
             cell.value = val.decode('big5')
                        
           print cell.value                                       #印出每個cell值,視情況可以省略

  wb.save(saveFn)

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

             下載影片的方法巿很多種,,而個人比較推薦的是利用Python 語言所開發的youtube-dl, 這是一個在命令列操作的軟體, 使用方法很簡單,只要輸入youtube-dl  URL 即可下載檔案,而需要圖形介面的使用者可下載Youtube-dlG,它是利用wxPython開發可跨平臺的 youtube-dlG (youtube-dl-gui) 當做 youtube-dl 的前端圖形操作界面

如讀者的系統為Windows 則直接下載執行檔即可使用,而Liunx 使用者要準備好Python,WxPython軟體安裝,要按照安裝程序準備安執行環境。

youtube-dl有很多參數可以使用,底下列出HELP的參數:

Usage: youtube-dl-script.py [OPTIONS] URL [URL...]
 
Options:
  General Options:
    -h, --help                       Print this help text and exit
    --version                        Print program version and exit
    -U, --update                     Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)
    -i, --ignore-errors              Continue on download errors, for example to skip unavailable videos in a playlist
    --abort-on-error                 Abort downloading of further videos (in the playlist or the command line) if an error occurs
    --dump-user-agent                Display the current browser identification
    --list-extractors                List all supported extractors
    --extractor-descriptions         Output descriptions of all supported  extractors
    --force-generic-extractor        Force extraction to use the generic extractor
    --default-search PREFIX          Use this prefix for unqualified URLs. For
                                     example "gvsearch2:" downloads two videos
                                     from google videos for youtube-dl "large
                                     apple". Use the value "auto" to let
                                     youtube-dl guess ("auto_warning" to emit a
                                     warning when guessing). "error" just throws
                                     an error. The default value "fixup_error"
                                     repairs broken URLs, but emits an error if
                                     this is not possible instead of searching.
    --ignore-config                  Do not read configuration files. When given
                                     in the global configuration file /etc
                                     /youtube-dl.conf: Do not read the user
                                     configuration in ~/.config/youtube-
                                     dl/config (%APPDATA%/youtube-dl/config.txt
                                     on Windows)
    --config-location PATH           Location of the configuration file; either the path to the config or its containing  directory.
    --flat-playlist                  Do not extract the videos of a playlist, only list them.
    --mark-watched                   Mark videos watched (YouTube only)
    --no-mark-watched                Do not mark videos watched (YouTube only)
    --no-color                       Do not emit color codes in output
 
  Network Options:
    --proxy URL                      Use the specified HTTP/HTTPS/SOCKS proxy.
                                     To enable experimental SOCKS proxy, specify
                                     a proper scheme. For example
                                     socks5://127.0.0.1:1080/. Pass in an empty
                                     string (--proxy "") for direct connection
    --socket-timeout SECONDS         Time to wait before giving up, in seconds
    --source-address IP              Client-side IP address to bind to
    -4, --force-ipv4                 Make all connections via IPv4
    -6, --force-ipv6                 Make all connections via IPv6
 
  Geo Restriction:
    --geo-verification-proxy URL     Use this proxy to verify the IP address for
                                     some geo-restricted sites. The default
                                     proxy specified by --proxy (or none, if the
                                     options is not present) is used for the actual downloading.
    --geo-bypass                     Bypass geographic restriction via faking X-Forwarded-For HTTP header (experimental)
    --no-geo-bypass                  Do not bypass geographic restriction via
                                     faking X-Forwarded-For HTTP header (experimental)
    --geo-bypass-country CODE        Force bypass geographic restriction with
                                     explicitly provided two-letter ISO 3166-2 country code (experimental)
 
  Video Selection:
    --playlist-start NUMBER          Playlist video to start at (default is 1)
    --playlist-end NUMBER            Playlist video to end at (default is last)
    --playlist-items ITEM_SPEC       Playlist video items to download. Specify
                                     indices of the videos in the playlist
                                     separated by commas like: "--playlist-items
                                     1,2,5,8" if you want to download videos
                                     indexed 1, 2, 5, 8 in the playlist. You can
                                     specify range: "--playlist-items
                                     1-3,7,10-13", it will download the videos
                                     at index 1, 2, 3, 7, 10, 11, 12 and 13.
    --match-title REGEX              Download only matching titles (regex or caseless sub-string)
    --reject-title REGEX             Skip download for matching titles (regex or caseless sub-string)
    --max-downloads NUMBER           Abort after downloading NUMBER files
   --min-filesize SIZE              Do not download any videos smaller than  SIZE (e.g. 50k or 44.6m)
    --max-filesize SIZE              Do not download any videos larger than SIZE (e.g. 50k or 44.6m)
    --date DATE                      Download only videos uploaded in this date
    --datebefore DATE                Download only videos uploaded on or before  this date (i.e. inclusive)
    --dateafter DATE                 Download only videos uploaded on or after this date (i.e. inclusive)
    --min-views COUNT                Do not download any videos with less than  COUNT views
    --max-views COUNT                Do not download any videos with more than COUNT views
    --match-filter FILTER            Generic video filter. Specify any key (see
                                     help for -o for a list of available keys)
                                     to match if the key is present, !key to
                                     check if the key is not present, key >
                                     NUMBER (like "comment_count > 12", also
                                     works with >=, <, <=, !=, =) to compare
                                     against a number, key = 'LITERAL' (like
                                     "uploader = 'Mike Smith'", also works with
                                     !=) to match against a string literal and &
                                     to require multiple matches. Values which
                                     are not known are excluded unless you put a
                                     question mark (?) after the operator. For
                                     example, to only match videos that have
                                     been liked more than 100 times and disliked
                                     less than 50 times (or the dislike
                                     functionality is not available at the given
                                     service), but who also have a description,
                                     use --match-filter "like_count > 100 &
                                     dislike_count <? 50 & description" .
    --no-playlist                    Download only the video, if the URL refers  to a video and a playlist.
    --yes-playlist                   Download the playlist, if the URL refers to a video and a playlist.
    --age-limit YEARS                Download only videos suitable for the given age
    --download-archive FILE          Download only videos not listed in the
                                     archive file. Record the IDs of all downloaded videos in it.
    --include-ads                    Download advertisements as well (experimental)
 
  Download Options:
    -r, --limit-rate RATE            Maximum download rate in bytes per second  (e.g. 50K or 4.2M)
    -R, --retries RETRIES            Number of retries (default is 10), or "infinite".
    --fragment-retries RETRIES       Number of retries for a fragment (default is 10), or "infinite" (DASH, hlsnative and ISM)
    --skip-unavailable-fragments     Skip unavailable fragments (DASH, hlsnative  and ISM)
    --abort-on-unavailable-fragment  Abort downloading when some fragment is not available
    --keep-fragments                 Keep downloaded fragments on disk after downloading is finished; fragments are erased by default
    --buffer-size SIZE               Size of download buffer (e.g. 1024 or 16K) (default is 1024)
    --no-resize-buffer               Do not automatically adjust the buffer
                                     size. By default, the buffer size is automatically resized from an initial value  of SIZE.
    --playlist-reverse               Download playlist videos in reverse order
    --playlist-random                Download playlist videos in random order
    --xattr-set-filesize             Set file xattribute ytdl.filesize with  expected file size (experimental)
    --hls-prefer-native              Use the native HLS downloader instead of ffmpeg
    --hls-prefer-ffmpeg              Use ffmpeg instead of the native HLS downloader
    --hls-use-mpegts                 Use the mpegts container for HLS videos,
                                     allowing to play the video while
                                     downloading (some players may not be able to play it)
    --external-downloader COMMAND    Use the specified external downloader.
                                     Currently supports aria2c,avconv,axel,curl,ffmpeg,httpie,wget
    --external-downloader-args ARGS  Give these arguments to the external downloader
 
  Filesystem Options:
    -a, --batch-file FILE            File containing URLs to download ('-' for
                                     stdin)
    --id                             Use only video ID in file name
    -o, --output TEMPLATE            Output filename template, see the "OUTPUT
                                     TEMPLATE" for all the info
    --autonumber-start NUMBER        Specify the start value for %(autonumber)s
                                     (default is 1)
    --restrict-filenames             Restrict filenames to only ASCII
                                     characters, and avoid "&" and spaces in
                                     filenames
    -w, --no-overwrites              Do not overwrite files
    -c, --continue                   Force resume of partially downloaded files.
                                     By default, youtube-dl will resume
                                     downloads if possible.
    --no-continue                    Do not resume partially downloaded files
                                     (restart from beginning)
    --no-part                        Do not use .part files - write directly
                                     into output file
    --no-mtime                       Do not use the Last-modified header to set
                                     the file modification time
    --write-description              Write video description to a .description
                                     file
    --write-info-json                Write video metadata to a .info.json file
    --write-annotations              Write video annotations to a
                                     .annotations.xml file
    --load-info-json FILE            JSON file containing the video information
                                     (created with the "--write-info-json"
                                     option)
    --cookies FILE                   File to read cookies from and dump cookie
                                     jar in
    --cache-dir DIR                  Location in the filesystem where youtube-dl
                                     can store some downloaded information
                                     permanently. By default $XDG_CACHE_HOME
                                     /youtube-dl or ~/.cache/youtube-dl . At the
                                     moment, only YouTube player files (for  videos with obfuscated signatures) are cached, but that may change.
    --no-cache-dir                   Disable filesystem caching
    --rm-cache-dir                   Delete all filesystem cache files
 
  Thumbnail images:
    --write-thumbnail                Write thumbnail image to disk
    --write-all-thumbnails           Write all thumbnail image formats to disk
    --list-thumbnails                Simulate and list all available thumbnail formats
 
  Verbosity / Simulation Options:
    -q, --quiet                      Activate quiet mode
    --no-warnings                    Ignore warnings
    -s, --simulate                   Do not download the video and do not write  anything to disk
    --skip-download                  Do not download the video
    -g, --get-url                    Simulate, quiet but print URL
    -e, --get-title                  Simulate, quiet but print title
    --get-id                         Simulate, quiet but print id
    --get-thumbnail                  Simulate, quiet but print thumbnail URL
    --get-description                Simulate, quiet but print video description
    --get-duration                   Simulate, quiet but print video length
    --get-filename                   Simulate, quiet but print output filename
    --get-format                     Simulate, quiet but print output format
    -j, --dump-json                  Simulate, quiet but print JSON information.
                                     See --output for a description of available
                                     keys.
    -J, --dump-single-json           Simulate, quiet but print JSON information
                                     for each command-line argument. If the URL
                                     refers to a playlist, dump the whole
                                     playlist information in a single line.
    --print-json                     Be quiet and print the video information as
                                     JSON (video is still being downloaded).
    --newline                        Output progress bar as new lines
    --no-progress                    Do not print progress bar
    --console-title                  Display progress in console titlebar
    -v, --verbose                    Print various debugging information
    --dump-pages                     Print downloaded pages encoded using base64
                                     to debug problems (very verbose)
    --write-pages                    Write downloaded intermediary pages to
                                     files in the current directory to debug problems
    --print-traffic                  Display sent and read HTTP traffic
    -C, --call-home                  Contact the youtube-dl server for debugging
    --no-call-home                   Do NOT contact the youtube-dl server for debugging
 
  Workarounds:
    --encoding ENCODING              Force the specified encoding (experimental)
    --no-check-certificate           Suppress HTTPS certificate validation
    --prefer-insecure                Use an unencrypted connection to retrieve information about the video. (Currently supported only for YouTube)
    --user-agent UA                  Specify a custom user agent
    --referer URL                    Specify a custom referer, use if the video access is restricted to one domain
    --add-header FIELD:VALUE         Specify a custom HTTP header and its value, separated by a colon ':'. You can use this option multiple times
    --bidi-workaround                Work around terminals that lack bidirectional text support. Requires bidiv or fribidi executable in PATH
    --sleep-interval SECONDS         Number of seconds to sleep before each
                                     download when used alone or a lower bound
                                     of a range for randomized sleep before each
                                     download (minimum possible number of
                                     seconds to sleep) when used along with--max-sleep-interval.
    --max-sleep-interval SECONDS     Upper bound of a range for randomized sleep
                                     before each download (maximum possible
                                     number of seconds to sleep). Must only be
                                     used along with --min-sleep-interval.
 
  Video Format Options:
    -f, --format FORMAT              Video format code, see the "FORMAT SELECTION" for all the info
    --all-formats                    Download all available video formats
    --prefer-free-formats            Prefer free video formats unless a specific one is requested
    -F, --list-formats               List all available formats of requested videos
    --youtube-skip-dash-manifest     Do not download the DASH manifests and  related data on YouTube videos
    --merge-output-format FORMAT     If a merge is required (e.g.
                                     bestvideo+bestaudio), output to given
                                     container format. One of mkv, mp4, ogg,
                                     webm, flv. Ignored if no merge is required
 
  Subtitle Options:
    --write-sub                      Write subtitle file
    --write-auto-sub                 Write automatically generated subtitle file (YouTube only)
    --all-subs                       Download all the available subtitles of the video
    --list-subs                      List all available subtitles for the video
    --sub-format FORMAT              Subtitle format, accepts formats
                                     preference, for example: "srt" or "ass/srt/best"
    --sub-lang LANGS                 Languages of the subtitles to download
                                     (optional) separated by commas, use --list-subs for available language tags
 
  Authentication Options:
    -u, --username USERNAME          Login with this account ID
    -p, --password PASSWORD          Account password. If this option is left out, youtube-dl will ask interactively.
    -2, --twofactor TWOFACTOR        Two-factor authentication code
    -n, --netrc                      Use .netrc authentication data
    --video-password PASSWORD        Video password (vimeo, smotri, youku)
 
  Adobe Pass Options:
    --ap-mso MSO                     Adobe Pass multiple-system operator (TV
                                     provider) identifier, use --ap-list-mso for a list of available MSOs
    --ap-username USERNAME           Multiple-system operator account login
    --ap-password PASSWORD           Multiple-system operator account password.
                                     If this option is left out, youtube-dl will ask interactively.
    --ap-list-mso                    List all supported multiple-system operators
 
  Post-processing Options:
    -x, --extract-audio              Convert video files to audio-only files
                                     (requires ffmpeg or avconv and ffprobe or
                                     avprobe)
    --audio-format FORMAT            Specify audio format: "best", "aac",
                                     "flac", "mp3", "m4a", "opus", "vorbis", or
                                     "wav"; "best" by default; No effect without -x
    --audio-quality QUALITY          Specify ffmpeg/avconv audio quality, insert
                                     a value between 0 (better) and 9 (worse)
                                     for VBR or a specific bitrate like 128K (default 5)
    --recode-video FORMAT            Encode the video to another format if necessary (currently supported:
                                                         mp4|flv|ogg|webm|mkv|avi)
    --postprocessor-args ARGS        Give these arguments to the postprocessor
    -k, --keep-video                          Keep the video file on disk after the post-processing; the video is erased by default
    --no-post-overwrites             Do not overwrite post-processed files; the  post-processed files are overwritten by default
    --embed-subs                     Embed subtitles in the video (only for mp4,webm and mkv videos)
    --embed-thumbnail                Embed thumbnail in the audio as cover art
    --add-metadata                   Write metadata to the video file
    --metadata-from-title FORMAT     Parse additional metadata like song title /
                                     artist from the video title. The format
                                     syntax is the same as --output, the parsed
                                     parameters replace existing values.
                                     Additional templates: %(album)s,
                                     %(artist)s. Example: --metadata-from-title
                                     "%(artist)s - %(title)s" matches a title
                                     like "Coldplay - Paradise"
    --xattrs                         Write metadata to the video file's xattrs
                                     (using dublin core and xdg standards)
    --fixup POLICY                   Automatically correct known faults of the
                                               file. One of never (do nothing), warn (only emit a warning), detect_or_warn
                                                (the default; fix file if we can, warn otherwise)
    --prefer-avconv                  Prefer avconv over ffmpeg for running the postprocessors (default)
    --prefer-ffmpeg                  Prefer ffmpeg over avconv for running the postprocessors
    --ffmpeg-location PATH           Location of the ffmpeg/avconv binary;
                                     either the path to the binary or its containing directory.
    --exec CMD              Execute a command on the file after downloading, similar to find's -exec
                                     syntax. Example: --exec 'adb push {}  /sdcard/Music/ && rm {}'
    --convert-subs FORMAT            Convert the subtitles to other format (currently supported: srt|ass|vtt)
#-------------------------------------------------

註:據說 Youtube 連結網址如果有「&」的話會導致下載失敗,可以前後用雙引號包起來就可以解決這個問題

 

官方網址及下載點(youtube-dl持續更新版本,請下載最新版本,目前為2017.05.01)

安裝步驟

在windows 下,如下載youtube-dl-2017.05.01.exe,則直接執行即可,
如為youtube-dl-2017.05.01.zip, 則要解開ZIP檔案後,找到setup.py, 然後執行 
python setup.py install 

最後執行完畢後會在 E:\XX\APP\Scripts 下新增 youtube-dl.exe 

 

文章標籤

stanley 發表在 痞客邦 留言(0) 人氣()

Close

您尚未登入,將以訪客身份留言。亦可以上方服務帳號登入留言

請輸入暱稱 ( 最多顯示 6 個中文字元 )

請輸入標題 ( 最多顯示 9 個中文字元 )

請輸入內容 ( 最多 140 個中文字元 )

reload

請輸入左方認證碼:

看不懂,換張圖

請輸入驗證碼