總網頁瀏覽量

2011年9月17日 星期六

手機無線遙控車 = mobile phone + Arduino + WiFi + Car + L298N

這次改用田宮出品的玩具車套件來組裝一台車,Arduino板子可以用螺絲固定在底板上面,電池用雙面膠暫時黏住,提供Arduino電源. 利用 Android 手機來控制 WiFi (http server)車子. 影片在此  http://www.youtube.com/user/sinocgtchen , 架起來拍錄比較容易.

田宮材料表較貴但是質感比較好,拍賣網站可以買到我組裝的所有材料!
想了解如何製作或有興趣可以mail me : sinocgtchen@gmail.com



                                               利用自己寫的簡單web page控制車子.


My email : sinocgtchen@gmail.com
My Youtube: http://www.youtube.com/user/sinocgtchen
Motoduino 參考網站: http://motoduino.com




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

                   

無線遙控車 = Arduino + WiFi + Web Server + Browser + Car + L298N

這次利用Cooperhead WiFi Shield 加到Arduino board可以透過手機,PC, Notebook來控制小車子, Arduino上寫了一個簡單的web server (Http server),可以解析從瀏覽器傳過來的命令, 試過無線AP設定網路安全機制為WEP及 WPA都可以正常運作.
車子可以前進,後退,左轉,右轉,停止.




 WiFi Shield 未疊上去

把 WiFi Shield 疊上去後


簡單控制車子的 webpage


材料需求:
1. Arduino L298N or L293 Motor Driver Shield (驅動馬達用)
2.Cooperhead WiFi Shield (802.11b 無線傳輸擴充板)
3. 9V 電池一顆(Arduino用), 1.5V電池四顆or 9V電池一顆也可以(Motor用)
4. 兩輪車子底盤一組
5. 一些24 or 20 AWG線材等.....


這些材料拍賣網站都可以買的到,有興趣的可以自己DIY,有問題可以互相討論,
順便看一下影片:  http://www.youtube.com/user/sinocgtchen

我的email: sinocgtchen@gmail.com  



2011年9月4日 星期日

Arduino + UltraSonic + Servo + L293D + Car


This time I attached a ultrasonic and Servo to arduino (Atmega328P) with motor driver IC(L293D). The car can avoid objects by using a ultrasonic. If anyone is interested in this, or any questions, mail me: sinocgtchen@gmail.com (my youtube: http://www.youtube.com/user/sinocgtchen  ) . 


這次把超音波感測器裝上arduino小車,偵測障礙物距離避開障礙物. 整個控制還未調整到理想狀態.有時間在進行改良! 這次也把兩個輪子的馬達改成減速馬達,扭力較大在圓型的底盤也較好控制. 詳細做法及sketch可以參考這期的 Make: 01雜誌.


影片在我的Youtube : http://www.youtube.com/user/sinocgtchen 







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

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

2011年8月25日 星期四

Arduino + SPI LED (8 digital bits serial LED)

今天來試試小東西 SPI 介面的 LED 如下圗,程式也不難.
此例是從PC鍵盤輸入任何數字都可以顯示(數字會往右Shift).







//Pin connected to latch pin (ST_CP) of 74HC595
const int latchPin = 8;
//Pin connected to clock pin (SH_CP) of 74HC595
const int clockPin = 3;
////Pin connected to Data in (DS) of 74HC595
const int dataPin = 9;
byte Tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff};
void setup() {
  //set pins to output because they are addressed in the main loop
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);  
  pinMode(clockPin, OUTPUT);
  Serial.begin(9600);
  Serial.println("reset");
}
void loop() {
  if (Serial.available() > 0) {
    // ASCII '0' through '9' characters are
    // represented by the values 48 through 57.
    // so if the user types a number from 0 through 9 in ASCII, 
    // you can subtract 48 to get the actual value:
  int bitToSet = Serial.read() - 48;
  // write to the shift register with the correct bit set high:
  digitalWrite(latchPin, LOW);
  // shift the bits out:
  shiftOut(dataPin, clockPin, MSBFIRST, Tab[bitToSet]);
    // turn on the output so the LEDs can light up:
  digitalWrite(latchPin, HIGH);
  }
}







2011年8月17日 星期三

Arduino: bluetooth name/baud rate changing 使用FT232RL(USB轉TTL)改變藍牙Baud rate

這次來說明最簡單的方式修改bluetooth設定值,如  Name, Baud rate,......
1.把bluetooth module和FT232RL連接起來.如圖 .
2.插入USB到PC,打開Arduino 的COM Port Monitor.
3.注意monitor中的"baud rate"設定跟 "no line ending".要設定正確!
4.直接在monitor的command line下AT command.例如 AT+BAUD7(表示設定baud rate成 57600)
5.然後按下Send, bluetooth 將會回應 OK57600之類的訊息,表示修改成功!
有問題可以email me: sinocgtchen@gmail.com




2011年8月14日 星期日

Arduino Car = L293D + 74HC00 + ATMEGA328P

這次把實驗麵包板都改成自己焊接的小板子:
製作主要材料:
1. L293D motor driver IC  x1
2. 74HC00 NAND logic gate   IC x1
3. ATmega328   (arduino 相容線路) IC  x 1
4. 幾顆電容,電阻及接頭等,
5.電池 1.5V x 4 (提供馬達電源)
6. 電池 9V x 1 (提供 IC 電源)

Arduino Sketch如下: (前進一秒--->停一秒--->後退一秒--->停一秒--->右轉一秒 ---> 停一秒 ----> 左轉一秒 ---> 停一秒)


const int Motor_M1 = 7;     // Pin ? of L298N
const int Motor_M2 = 4;    // Pin ? of L298N
const int Motor_E1 = 6; // Pin ? of L298N    
const int Motor_E2 = 5;  // Pin ? of L298N  

void setup()
{
  Serial.begin(57600);
  // set all color leds as output pins
  pinMode(Motor_M1, OUTPUT);
  pinMode(Motor_M2, OUTPUT);
 
}

void loop()
{
  forward(0,0);
  delay(1000);
  motorstop(0,0);
  delay(1000);
  back(0,0);
  delay(1000);
  motorstop(0,0);
  delay(1000);
  right(0,0);
  delay(1000);
  motorstop(0,0);
  delay(1000);
  left(0,0);
  delay(1000);
  motorstop(0,0);
  delay(1000);
 
}

void motorstop(byte flag, byte numOfValues)
{
  digitalWrite( Motor_E1, 0);
  digitalWrite( Motor_E2, 0);
  Serial.println("stop : ");

}

void forward(byte flag, byte numOfValues)
{

  Serial.println("forward : ");

  digitalWrite( Motor_M1, HIGH);
  digitalWrite( Motor_M2, HIGH);

  analogWrite( Motor_E1, 255);
  analogWrite( Motor_E2, 255);
 
}

void back(byte flag, byte numOfValues)
{

  Serial.println("back : ");
  digitalWrite( Motor_M1, LOW);
  digitalWrite( Motor_M2, LOW);

  analogWrite( Motor_E1, 255);
  analogWrite( Motor_E2, 255);
 
}

void right(byte flag, byte numOfValues)
{
  Serial.println("right : ");

  digitalWrite( Motor_M1, HIGH);
  digitalWrite( Motor_M2, HIGH);

  analogWrite( Motor_E1, 255);
  analogWrite( Motor_E2, 0);
 
}

void left(byte flag, byte numOfValues)
{
  Serial.println("left : ");

  digitalWrite( Motor_M1, HIGH);
  digitalWrite( Motor_M2, HIGH);

  analogWrite( Motor_E1, 0);
  analogWrite( Motor_E2, 255);
 
}


圗中最底層放入電池,第二層是馬達驅動IC L293D 板子,最上層是Arduino相容板.
有問題或有興趣的朋友可以mail me :  sinocgtchen@gmail.com



我的 Youtube: http://www.youtube.com/user/sinocgtchen

2011年8月9日 星期二

製作 Arduino Pro board


今天來說說前陣子買的一塊Arduino Pro的板子,這塊版子是從露天買ATmega328P QFP封裝送的PCB空板子.發現把每個零件焊上後,TX和RX有問題,請參考下圖,把兩顆電阻移到要燒錄code的pin腳位置.這樣兩端的TX 和 RX就可以正常work. ps.這板子沒有FT232RL chip,燒錄code需要外接小板子(如USB2TTL(FT232RL)).我興趣的朋友或有任何問題可以mail給我, sinocgtchen@gmail.com