總網頁瀏覽量

2012年1月7日 星期六

手機遙控履帶坦克車= Motoduino ( Arduino ) + Bluetooth 藍芽 + Android

把擺一段時間履帶坦克車(田宮系列TAMIYA模型玩具)拿出來修改一下,這次用 motoduino板子來組裝就簡單許多. G-Sonsor手機遙控整體上還不錯!

使用的材料:
1. Motoduino + bluetooth (購買資訊)
2. 電池 9V
3. 三號電池 1.5V x 4
4. 田宮系列 TRACK&WHEEL SET 履帶組 (露天拍賣可買到, 如下圖)
5. 田宮系列 雙馬達4速變速箱 TWIN MOTOR GEAR BOX (露天拍賣可買到, 如下圖)
6. 田宮系列 Universal Plate  (露天拍賣可買到, 如下圖)








Youtube video: http://www.youtube.com/user/sinocgtchen 


  影片請看: http://www.youtube.com/user/sinocgtchen
   部落格 : http://sinocgtchen.blogspot.com
   Motoduino資訊: http://motoduino.com

My Email: sinocgtchen@gmail.com 

2011年12月22日 星期四

手機遙控玩具車 = Motoduino (Arduino) + Bluetooth + a Toy Car + Android Phone

這次利用小孩子不玩的玩具車改裝成手機遙控車(本來是用RF遙控),改裝此種遙控車要注意的地方是前輪馬達控制左右轉,後輪馬達控制前進及後退.車子的速度感及操控感改善­許多! 跟一般市場賣的遙控車感覺差不多,只是這是用Android手機藍芽操控!! 

使用材料:
1. Motoduino (Arduino + L293D)  x 1
2. Bluetooth  x 1
3. Toy Car with two motors   x 1
4.螺絲起子及焊接工具









Youtube video: http://www.youtube.com/user/sinocgtchen


有任何問題或興趣朋友可以參考我的Blog:
  影片請看: http://www.youtube.com/user/sinocgtchen
   部落格 : http://sinocgtchen.blogspot.com
   Motoduino資訊: http://motoduino.com

My Email: sinocgtchen@gmail.com

Motoduino 上修改藍芽模組Baud Rate

在 Motoduino上修改藍芽模組Baud Rate很簡單 步驟如下:

範例說明是以傳輸速率內設Baud Rate為 9600 bps 改成 57600 bps

1.打開 Arduino IDE 輸入底下程式(下圗)


2.把Motoduino接上PC

3.Compile程式然後upload到板子.

4.等upload完後,移開motoduino跟PC連線,插上藍芽模組(如下圗).



5.把Motoduino再接上PC,然後開啟Arduino的Monitor如下圖注意右下角的baud rate欄位選成9600
bps,  monitor內會顯示AT+BAUD7 (如下圗), 此時藍芽模組已改成57600 bps.

























  注意: 從此Arduino Monitor右下角的baud rate欄位選成57600 bps才看的到訊息!!

2011年12月11日 星期日

WiFi Remote Car = Motoduino (Arduino+L293D) + WiFi Shield + Web Server

這次利用 Motoduino (Arduino + L293D motor driver IC)加上WiFi Shield來遙控車子,在motoduino上建立一個web server. 利用Http protocol來控制車子前進後退轉彎. 此次利用Motoduino來控制比上次簡單許多!!





使用材料:
1.Motoduino ---------- 1 片
2. WiFi Shield --------- 1 片
3. 9V Battery ---------- 2 顆
4. 少許接線
5. 車子底盤及馬達. ------- 1 台

參考影片在此: http://www.youtube.com/user/sinocgtchen#p/u/6/wg6Wa3pRHcM
If you have any questions, please send email
My email : sinocgtchen@gmail.com
My Youtube: http://www.youtube.com/user/sinocgtchen
Motoduino 參考網站: http://motoduino.com

2011年12月10日 星期六

Fan RPM Meter (測量風扇轉速) = Motoduino (Arduino) + CNY70 + 12V Fan

這次利用CNY70及一個沒在用的小風扇,來測量其風扇轉速,方法很簡單, Arduino Sketch如下.
此次利用一顆9V電池當風扇電源.





使用材料如下:
1.電池9V 一顆
2.Motoduino (Arduino) x 1
3.CNY70 光感測器  x 1 (圖中五顆只用一顆)
4.黑色膠帶一小條
5. 少許線材.

Arduino Sketch:
程式說明: 此次是用attachInterrupt(0, rpm_fun, RISING), 第一參數0表示Pin2為外部中斷,
當0-->1時(Rising)就產生中斷執行rpm_fun. 利用 if(rpmcount >= 20) 來調整 RPM resolution.

#############################

volatile byte rpmcount;
unsigned int rpm;
unsigned long timeold;

void setup()
{
  Serial.begin(9600);
  attachInterrupt(0, rpm_fun, RISING);
  rpmcount = 0;
  rpm = 0;
  timeold = 0;
  }

void loop()
{
  if (rpmcount >= 20)
  {
    rpm = (30 * 1000 / (millis()- timeold)) * rpmcount;
    timeold = millis();
    rpmcount = 0;
    Serial.println(rpm, DEC);
  }
}
void rpm_fun()
{
  rpmcount++;
}

#############################

有興趣或有問題網友可以發mail來, 謝謝!
My Youtube : http://www.youtube.com/watch?v=I3pIOMORmHQ
My Email : sinocgtchen@gmail.com

相關購買資訊: http://motoduino.com


2011年12月1日 星期四

Motoduino = Arduino + Motor driver L293D

Motoduino整合arduino跟L293D馬達驅動IC的控制板,完全相容於Arduino Duemilanove.
Motoduino主要結合Arduino和馬達驅動IC(L293D),可以應用於自走車,尋跡車等有馬達需求應用上. Motoduino也可以很容易加上藍芽模組做成遙控車,例如手機遙控車.
motoduino picture
 主要特性:
1.      可驅動兩顆馬達 7V ~ 12 V
2.       channel工作電流 <= 1A
3.      PIN 5, PIN 6, PIN 7PIN 8專門用來驅動馬達
4.      支援PWM 馬達轉速控制

商品內容包含:
1.      Motoduino 電路板一片
2.      藍芽模組一片
3.      Arduino 範例程式(遙控車用)
4.      Android 範例程式(遙控車用, android 2.2) 
5.     Motoduino 使用手冊

  相關影片請看: http://www.youtube.com/user/sinocgtchen
   部落格 :  http://sinocgtchen.blogspot.com
   購買資訊: http://motoduino.com

   有任何問題或有興趣朋友,歡迎來信討問,謝謝!!

2011年11月7日 星期一

Email Alarm = Arduino + Ethernet Shield + PIR Motion Sensor

This is a simple E-Mail Alerter/Alarm. If PIR motion sensor detected something or someone active/moving, an E-Mail will be sent to a specified E-Mail account by arduino. I specified my gmail account to receive it.

這次利用手邊放了一陣子的Ethernet Shield來做Email的警報器,如果紅外線人體感測器感測到有人或有東西在移動(測試大約6公尺左右距離都沒問題),馬上發出一封email到我的gmail信箱. 我的手機馬上就會通知我有來信.



使用的材料:
1.Arduino board  x 1
2.Ethernet Shield x 1
3.PIR Motion Sensor
4.I/O Expansion Shield (option)
5.2 Email accounts, one is sender(from), another one is receiver(to)

Sketch: (for Arduino 0022 version)

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

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xAF, 0xCE, 0xDD }; // whatever mac you want
byte ip[] = { 192, 168, 0, 109};
byte server[] = { 203, 188, 201, 253 }; // Mail server address  smtp.mail.yahoo.com.tw)
Client client(server, 25);  // yahoo's mobile smtp server ip/port 587

/////////////////////////////
//VARS
//the time we give the sensor to calibrate (10-60 secs according to the datasheet)
int calibrationTime = 30;      

//the time when the sensor outputs a low impulse
long unsigned int lowIn;        

//the amount of milliseconds the sensor has to be low
//before we assume all motion has stopped
long unsigned int pause = 5000;

boolean lockLow = true;
boolean takeLowTime;

int pirPin = 3;    //the digital pin connected to the PIR sensor's output
int ledPin = 13;
int nPIR_detect;

void setup()
{
 Ethernet.begin(mac, ip);
 Serial.begin(57600);

  pinMode(pirPin, INPUT);
  digitalWrite(pirPin, LOW);
 
  //give the sensor some time to calibrate
  Serial.print("calibrating sensor ");
    for(int i = 0; i < calibrationTime; i++){
      Serial.print(".");
      delay(1000);
      }
    Serial.println(" done");
    Serial.println("SENSOR ACTIVE");
    delay(50);
     nPIR_detect = 0;
}

void loop()
{
  delay(1000);
  if(PIR_detected())  // PIR : HIGH
  {
     if (client.available()) {
       char c = client.read();
       Serial.print(c);
     }

    Serial.println("connecting...");

     if (client.connect()) {
       Serial.println("connected");
       client.println("EHLO smtp.mail.yahoo.com.tw");
//       client.println("AUTH PLAIN AHNpbm9jZ3RjbGVuQHlhaH9vLmNvbSgwet323tcxYTU=");  // example
       client.println("AUTH PLAIN *************************************************=");  // replace the **'s with your auth info from the perl script.
       client.println("MAIL FROM:<**@yahoo.com.tw>");  // replace the ** with your mail address
       client.println("RCPT TO:<**@gmail.com>");       // replace the ** with to mail address
       client.println("DATA");
       client.println("From: <**@yahoo.com.tw>");
       client.println("TO: <**@gmail.com>");
       client.println("SUBJECT: Something has been detected by PIR");
       client.println();
       client.println("This is PIR testing.");
       client.println("Warning: detected something!!");
       client.println(".");
       client.println(".");
     
       delay(1000);
       client.stop();
       Serial.println("mail sent!!");    
       delay(30000);
     }
     else
     {
       Serial.println("connection failed");
     }
  }
}

boolean PIR_detected()
{
  boolean bPIR;
 
     if(digitalRead(pirPin) == HIGH){
       digitalWrite(ledPin, HIGH);   //the led visualizes the sensors output pin state
       if(lockLow){
         //makes sure we wait for a transition to LOW before any further output is made:
         lockLow = false;          
         Serial.println("---");
         Serial.print("motion detected at ");
         Serial.print(millis()/1000);
         Serial.println(" sec");
         delay(50);
         }        
         takeLowTime = true;
       
         bPIR = true;
       }
   
     if(digitalRead(pirPin) == LOW){      
       digitalWrite(ledPin, LOW);  //the led visualizes the sensors output pin state
     
       if(takeLowTime){
        lowIn = millis();          //save the time of the transition from high to LOW
        takeLowTime = false;       //make sure this is only done at the start of a LOW phase
        }
       //if the sensor is low for more than the given pause,
       //we assume that no more motion is going to happen
       if(!lockLow && millis() - lowIn > pause){
           //makes sure this block of code is only executed again after
           //a new motion sequence has been detected
           lockLow = true;                      
           Serial.print("motion ended at ");      //output
           Serial.print((millis() - pause)/1000);
           Serial.println(" sec");
           delay(50);
           }
           bPIR = false;
       }
    return bPIR;
}


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

my blog: http://sinocgtchen.blogspot.com/
my Youtube: http://www.youtube.com/user/sinocgtchen

相關購買資訊: http://motoduino.com