:::: MENU ::::
Posts tagged with: Arduino

Eagle CAD

Open Hardware를 위해 Eagel CAD를 많이 사용을 하지만 정작 사용법에 대한 한글 안내는 많지 않다.
유일한 것이 http://nohau.com.ne.kr/eagle.htm 의 링크에 있는 내용이다.
이 링크는 일본 자료를 번역한 것 같은데, 실제 툴이라는 것이 각각의 기능에 대한 알기보다는 실제로 자기가 사용을 해가면서 왜 기능이 필요한 가를 터득하는 것이 중요하다. 툴의 모든 기능이 다 필요로 하지는 않으니까…
이 링크가 별로 마음에 안드는 것은 웹사이트의 모든 키를 막아놔서 copy가 안되는데, Evernote같은 툴로 페이지를 스크랩하는 것은 가능하다. ^^*

간단히 Eagle CAD의 사용법을 정리하면..

1. Tool 받고 설치하기
http://www.cadsoftusa.com/ 사이트에서 다운로드 받는다.
정식버젼과 fress version과 s/w는 동일하지만 정식버젼은 key값을 입력을 해여하며, free version의 경우 다음과 같은 제약이 있다. 이 정도면 웬만한 작업은 거의 다 가능한 수준이다.

  • PCB의 크기는 100 x 80mm(4 x 3.2인치)까지 지원
  • 2 layer(Top과 Bottom)만 가능
  • Schematic은 sheet 1개만 가능

Free 버젼의 경우 툴을 받고 설치시 마지막에 라이센스를 물어보는 창이 있는데, 이때 “Don’t license now”를 선택하면 된다.

Control Panel
프로그램을 실행시키면 Control Panel이 뜬다.

Libraries 
Part들의 Schematic library와 PCB library가 등록되어 있다. 기호를 클릭할 때 등록된 내용들을 볼 수 있는데, 사용할 라이브러리를 개별적으로 선택이 가능하며 선택된 라이브러리는 초록색 원 모양이 표시된다.
그냥 전부 다 사용으로 한다. Use all 을 선택.. 처음 사용하는데 내가 필요한게 뭔지 어떻게 알 수 있는가?
참고로 라이브러리의 확장자는 lbr.

User Language Programs
 ULP라고 부르며, 아직 직접이런 것을 만들 필요는 없고, 나중에 PCB 작업이 끝나고 drill정보를 export하기위해 drillcfg.ulp정도만 사용이 된다.
Projects
이 폴더에 작업한 내용이 저장이 된다.

http://nohau.com.ne.kr/eagle.htm 이 사이트에서 다음의 2 항목을 참고해서 한번 회로도 및 PCB를 만들어 본다.
2. 프로젝트 만들기 : http://nohau.com.ne.kr/eagle09/eagle03.htm 참고

3.우선 사용하고 봅시다. : http://nohau.com.ne.kr/eagle09/eagle09.htm 참고

4. 라이브러리 만들기
회로도나 PCB작업의 경우 어려운 것은 내가 필요한 심볼 및 PCB footprint를 찾는 것과 만약에 이게 없으면 만들 수 있는 능력이다. 따라서 라이브러리를 만드는 방법은 반드시 알아야 한다. Schematic 라이브러리는 상대적으로 만들기가 쉽고, PCB footprint는 수치를 정확하게 맞추어야 하기 때문에 좀 까다로운 편이다.
라이브러리를 만드는 방법은 다음 링크의 글이 잘 정리가 되어 있다. HOW-TO: Make parts in Cadsoft Eagle 

Instructables에 소개된 회로도에서 PCB까지 만드는 방법에 대한 자료
Turn your EAGLE schematic into a PCB

PDF파일로 저장된 버젼

cfile26.uf.114A5E344F6ADF76136C61.pdf

5. 거버 만들기
Board 파일(*.brd)을 연다.
Drill Rack 파일의 작성: 명령 바에 “run drillcfg” 라고 입력하고 엔터 키를 누르거나, 메뉴 “File” → “Run”을 선택하여 “drillcfg”를 선택.
단위를 선택한 다이얼로그가 표시되면 인치(inch)를 선택하고,OK 버튼을 누른다.

현재 사용되고 있는 드릴(drill) 크기(size)들이 표시되는데, OK 버튼을 누르고 저장을 한다.

Excellon drill 파일의 작성
보드에서 CAM을 선택을 한다.

CAM Procesor 창이 뜨는데, “File > Open > Job…” 을 선택을 하고 표시된 파일중에 “excellon.cam“을 오픈한다.
그리고 좌측 하단의 Process Job을 선택한다.

거버 파일 작성
위 Excellon drill 파일의 작성과 마찬가지로 “File > Open > Job…”을 선택하고, 이번에는 “gerb274x.cam” 을 오픈한다.
그리고 좌측 하단의 Process Job을 선택한다.
이상으로 거버파일이 완성이 되었다. 완성된 거버파일은 gerbv같은 프로그램으로 확인을 한다.

6. 거버 확인하기
gerbv – A Free/Open Source Gerber Viewer :
http://gerbv.gpleda.org/


Fritzing에 Wiz820io 라이브러리 공식 등록

Fritzing 툴의이 최근 버젼(0.6.4)버젼부터 지난번에 제가 만든 Wiz820io가 공식 라이브러리도 등록이 되었습니다.
이번 버젼에서 눈에 띄게 달라진 점은 part 라이브러리가 각 제조사별로 브랜딩되어 있습니다.
즉 Arduino, Parallax, Sparkfun등의 탭들이 생겨서 각 제조사 별로 부품을 찾을 수 있게 되어 있네요.
제가 만든 Wiz820io는 Core Parts에 Connection 항목에 들어가 있습니다.


아두이노 보드에서 W5200 사용하기

아두이노의 공식 Ethernet 쉴드에는 WiznetW5100이 사용된다. 따라서 모든 Ethernet 라이브러리는 W5100을 이용하는 것으로 되어있는데 Wiznet의 신규칩인 W5200을 아두이노 보드에서 사용하기 위해서는 라이브러리를 일부 수정을 해야 한다. W5100과 비교해서 W5200의 장점은 대략 작은 패키지, 8 socket 지원(W5100의 경우 4 socket 지원), Power down mode, Wake on LAN 기능 지원 등이다. 
    W5100 to W5200 migration guide



Hardware 연결
간단한 테스트를 위해 Wiz820io를 사용을 해서 아래 그림처럼 테스트를 했다. 아래 그림은 Fritzing 이라는 툴로 Wiz820io 라이브러리를 만든 후 작성한 연결도이다. Fritzing관련해서는 이전 포스트 참고(Fritzing, Fritzing 라이브러리 만들기)
    Wiz820io의 Fritzing 라이브러리


cfile28.uf.182202414EE59CB821A744.fzpz


* PWDN, nINT, 스위치를 통한 reset 입력은 연결을 안 해도 되고, VCC, GND도 하나의 선만 연결해도 된다.




라이브러리 수정
변경을 최소화하고 기존의 라이브러리와의 호환성을 위해 변경된 드라이버는 W5100과 같은 파일명을 쓴다. 즉 W5100.cpp와 W5100.h 파일만 수정해서 아두이노 IDE가 설치된 폴더에 덮어쓰면 된다. 즉 “/libraries/Ethernet/utility” 아래에 있는 W5100.cpp 및 W5100.h 파일을 아래 첨부한 파일로 변경하면 된다. 파일에 수정된 부분은 W5200으로 검색을 하면 쉽게 찾을 수 있다.


cfile23.uf.160404394EE5D0692C5B5D.cpp


cfile3.uf.177E62394EE5D06A33D119.h




테스트
아두이노의 IDE에서 File > Examples >Ethernet > 에 있는 예제를 열어서 컴파일 후 아두이노보드에 다운로드를 하면 잘 동작한다. 
최근에 릴리즈한 Arduini 1.0 에서는 기존 Ethernet 라이브러리가 좀 더 확장이 되었다.  http://arduino.cc/en/Main/ReleaseNotes 참고

* Support for DHCP and DNS has been added to the Ethernet library, thanks to integration by Adrian McEwen. Most classes in the Ethernet library have been renamed to add a “Ethernet” prefix and avoid conflicts with other networking libraries. In particular, “Client” is now “EthernetClient”, “Server” is “EthernetServer”, and “UDP” is “EthernetUDP”. A new IPAddress class makes it easier to manipulate those values.


* The UDP API has been changed to be more similar to other libraries. Outgoing packets are now constructed using calls to the standard write(), print(), and println() functions – bracketed by beginPacket() and  endPacket(). The parsePacket() function checks for and parses an incoming packet, which can then be read using available(), read(), and peek(). The remoteIP() and remotePort() functions provide information about the packet’s origin. (Again, thanks to Adrian McEwen for the implementation.)


LeafLabs의 Maple mini, Maple Ret 5 보드 사용기

Arduino가 AVR을 기반으로 하여 오픈하드웨어 플랫폼을 주도하고 있는데, Leaflabs은 STM32시리즈를 기반으로 하는 오픈하드웨어 플랫폼을 만들고 있다. Leaflabs의 보드들의 이름은 Maple이다.
Leaflabs사의 홈페이지에서 주문을 하니 한 일주일만에 배송이 되었다. Arduino가 요즘에는 브랜딩 작업을 하고 있고, 포장 및 디자인까지 신경을 쓰는 반면 역시 후발 주자답게 포장이 좀 허접하다. 대신 사탕을 같이 넣어서 주네..ㅋㅋ



아두이노와 같은 모습의 IDE를 사용하는데, 일단 처음 부터 막힌다. IDE 다운로드


몇시간의 삽질끝과 bootloader 소스까지 받아서 bootloader 가 어떻게 동작을 하는지 알아낸 후에야 이해가 된다.
Windows 환경의 경우 드라이버를 수동으로 설치를 해야 하는데 2 종류의 드라이버를 설치를 해야한다.
 -. Maple R3 COM port 드라이버
 -. LibUSB-Win32 Devices 드라이버
만약 위 2번째 드라이버가 설치가 안되어 있으면, 다운로드시

Couldn’t find the DFU device: [1EAF:0003]


라는 메시지가 뜬다.

설치를 하는 방법이 좀 까다로운데, 리셋을 누르면 LED가 6번 빨리 깜박인다.
이 다음에 BUT 버튼을 누른후 장지관리자에서 설치가 되지 않은 드라이버를 수동으로 설치를 한다.
즉 Perpetual bootloader mode에서 설치를 해야 한다.
설치 파일은 IDE를 인스톨한 폴더 아래 drivers\mapleDrv 아래 dfu, serial 폴더에 각각 있다.

LeafLabs에 있는 Andrew가 알려준 유튜브에 있는 동영상



http://leaflabs.com/docs/maple-ide-install.html#id4 에 있는 설치 정보.


First, install DFU drivers (for uploading code to your Maple) using the following steps.



  1. Plug your Maple into the USB port.

  2. Hit the reset button on your Maple (it’s the small button at the bottom left, labeled RESET). Notice that it blinks quickly 6 times, then blinks slowly a few more times.

  3. Hit reset again, and this time push and hold the other button during the 6 fast blinks (the button is on the top right; it is labeled BUT). You can release it once the slow blinks start.

  4. Your Maple is now in perpetual bootloader mode. This should give you a chance to install the DFU drivers.

  5. Windows should now prompt you for some drivers. In the top level directory of the Maple IDE, point Windows to drivers/mapleDrv/dfu/.

Next, install serial drivers (for communicating with your Maple using serial over USB).



  1. Reset your Maple and allow it to exit the bootloader (wait for the slow blinking to stop). The Maple will next start running whatever program was uploaded to it last. (New Maples will start running the test program we upload to them before shipping them to you).

  2. Once Maple is running some user code, Windows should prompt you for more drivers. Point windows to driver/mapleDrv/serial.

일단 각각의 드라이버가 설치가 잘 되면 그 다음은 Arduino에서 작업을 하듯 할 수 있다.


 


아두이노의 미래


What’s Ahead Of Arduino – Part 1 – Massimo Banzi@MakerFaire 2011

What’s Ahead Of Arduino – Part 2 – Massimo Banzi@MakerFaire 2011
결국 아두이노의 힘은 커뮤니티!!

아래 사진은 Make Fair에서 나눠준 아두이노의 리플렛인데 신제품만 모았다.
각각의 제품마다 밑에 이 보드로 무엇을 할 수 있는지 설명이 있다.
가령 WiFi의 경우 Fully Hackable!
ADK의 경우 Develop your own android accessory !


아래 슬라이드는 아두이노가 OSHW 서밋에서 발표한 자료..


아두이노의 신제품


For the second year in a row we decided to announce our new products at Maker Faire in NYC.

Tomorrow morning, if you come to the Arduino tent, you will be able to see:


Arduino 1.0, we finally froze the Arduino API, the IDE and the layout of the boards. We’ve made some minor additions to the Arduino connectors to make them more flexible. Tomorrow you will be able to download the release candidate and in 1 month of frantic testing with the community, the platform will be ready and stable.


Arduino Leonardo, a low cost Arduino board with the Atmega32u4. It has the same shape and connectors as the UNO but it has a simpler circuit. On the software side it has a nifty USB driver able to simulate a mouse , a keyboard, a serial port (with more drivers coming later). As usual for Arduino, everything will be released as open source (Core, Bootloader, Hardware).


Arduino Due, a major breakthrough for Arduino because we’re launching an Arduino board with a 32bit Cortex-M3 ARM processor on it. We’re using the SAM3U processor from ATMEL running at 96MHz with 256Kb of Flash, 50Kb of Sram, 5 SPI buses, 2 I2C interfaces, 5 UARTS, 16 Analog Inputs at 12Bit resolution and much more.


Instead of just releasing the finished platform we are opening the process to the community early on. We’re going to be demoing the board and giving away some boards to a selected group of developers who will be invited to shape the platform while it’s been created. After Maker Faire, we will begin selling a small batch of Developer Edition boards on the Arduino store (store.arduino,cc) for members of the community who want to be join the development effort. We plan a final and tested release by the end of 2011


Arduino Wifi Shield. It adds Wi-Fi communication capabilities to any Arduino. Instead of using any of the classic WiFi modules on the market we wanted to have something that will provide the maximum level of hackability to the user. The shield is based on a wifi micro module made by H&D Wireless coupled with a powerful AVR32 processor that carries the full TCP-IP stack leaving room to add your own protocols and customisations. We’ve also worked hard to make sure that you will be able to migrate your code from the Ethernet Shield with minor changes.


We’re also going to show some prototypes of new platforms we’ve been working on: We have robots, new IDEs and more.


It has been a crazy few months and we want to thank ATMEL very much the support that we got on all the new products.


Come over to Maker Faire and have a look for yourself!


지난 9월 17, 18일 뉴욕의 Make Fair에서 아두이노는 자신들의 신제품 출시 계획을 발표했다.
Arduino 1.0
API, IDE가 드리어 1.0버젼을 달았다. 커뮤니티에서 1달여간의 추가적인 테스트를 거쳐 최종적으로 fix될 예정
http://code.google.com/p/arduino/wiki/Arduino1 에서 다운로드 가능하다.

Arduino Leonardo
Atmega32u4를 사용한 저가 보드. Atmega32u4는 32KB의 작은 용량의 MCU이나 USB device기능을 가지고 있다. 따라서 USB host 에 연결하여 여러가지 응용제품이 만들어 질 것 같다.

Arduino Due
이번 발표에서 가장 큰 변화이고 비중이 높은 내용이다. 즉 기존의 AVR 8bit를 뛰어넘어 CortexM3 코아인 SAM3U를 채택했는데, SAM3U 계열중 가장 고사양 파트인 SAM4U4E를 사용한다. 그리고 최종 제품을 다 만들기 전에 제품화의 과정을 커뮤니티와 공유하고 함께 만들어갈 것을 얘기하고 있다. 위 사진에서 처럼 보드는 기존 아두이노 Mega2560 보드의 형태이다.

역시 아두이노의 최대 강점은 그들이 쌓아놓은 커뮤니티의 힘인데 이것을 100%활용하겠다는 의지이다. 더불어 최근 Open Hardware 트랜드에 뛰어든 Microchip의 ChipKit을 견제하고 임 STM32로 Open Hardware보드를 만든 Leaflab을 견제하는 측면이 있다. 사실 그동안 8 비트 AVR의 한계로 개발자들의 많은 요구가 있었을 것 같은데, 이런 요구에 부응하는 전략이 될 것 같다.
그렇다면 기존 Arduino의 개발환경에서 CortexM3 계열까지 지원을 하겠다는 의미이고, 기존의 AVR 기반의 소프트웨어 라이브러리들이 CortexM3로 포팅이 될 것 이다.

그렇다면 쉴드들은?
아두이노의 Ethernet 쉴드 및 클론들의 아두이노 호환 쉴드들은 당분간 사용이 되겠고 관련 라이브러리들이 마찬가지로 SAM3U에 맞게 포팅이 되겠다. 하지만 Ethetnet의 경우 SAM3U의 performance로 볼때 충분히 software stack을 돌릴 수 있으므로 W5100을 사용하지 않는 MAC/PHY로만 구성된 쉴드가 나올수 있겠다. 왜냐면 이 분야의 엔지니어들의 습성상 자기가 모든 부분을 건드릴 수 있는 플랫폼을 좋아하기 때문이다.

Arduino WiFi shield
스웨덴 업체인 H&D wireless의 제품은 AVR32를 기반으로 하는 무선랜 솔루션이다. 즉 이미 AVR에 익숙한 아두이노 사용자들은 AVR32를 마음대로 수정해서 자기가 원하는 형태의 무선랜 모듈 쉴드를 가질 수 있다. 즉 좀 전에 위에서 언급한 대로 사용자가 최대한 제품을 건드릴 수 있는 여지를 만들어 놓았다. maximum level of hackability to the user.


임베디드보드에서 트위터하기 2 – 아두이노를 이용한 트위터

이전에 올린 임베디드보드에서 트위터하기의 2번째 버젼으로 아두이노를 이용해서 트위터하는 방법에 대한 분석자료입니다.
관련 자료: http://www.arduino.cc/playground/Code/TwitterLibrary
역시 proxy 사용해서 구현을 하고있는데 이전의 Supertweet.net 보다는 간단한 것 같지만, 테스트를 해보니 단점은 같은 내용의 메시지를 연속해서 보내면 에러가 난다. 아마도 스팸성 트윗을 걸러내기 위한 조치 같네요.

먼저 http://arduino-tweet.appspot.com/ 에 접속을 해서 사용하는 트위터 아이디의 토큰을 받는다.
이 토큰은 아래 소스에서 사용이 된다.

트위터 라이브러리 소스

#define LIB_DOMAIN “arduino-tweet.appspot.com”

bool Twitter::post(const char *msg)
{
 DNSError err = EthernetDNS.resolveHostName(LIB_DOMAIN, server);
 if (err != DNSSuccess) {
  return false;
 }
 parseStatus = 0;
 statusCode = 0;
 if (client.connect()) {
  client.println(“POST http://” LIB_DOMAIN “/update HTTP/1.0”);
  client.print(“Content-Length: “);
  client.println(strlen(msg)+strlen(token)+14);
  client.println();
  client.print(“token=”);
  client.print(token);
  client.print(“&status=”);
  client.println(msg);
 } else {
  return false;
 }
 return true;
}

위 소스에서 보듯이 먼저 arduino-tweet.appspot.com에 80 port로 접속을 한후 메시지를 보내는 형태인데, 실제 보내지게 되는 메시지는 다음과 같다. (* 아래 토큰은 남용을 방지하기 위해 임의로 바꿈)

POST http://arduino-tweet.appspot.com/update HTTP/1.0
Content-Length: 79

token=3737638B3-rfAUaR3oPmUZdhVXwpK3xSqBON6BBMVNWgsoqUaD&status=Hello, World 1!
Content-Length는 token의 길이 + 메시지의 길이 + 나머지 문자 14 바이트의 문자(token=과 &status=)이며, 실제 메시지는 &status=이후에 들어간다. 여기서는 Hello, World 1!


문제는 이런 트윗의 내용이 암호화가 되지 않고 전송이 되므로 Wireshark같은 스니퍼로 패킷을 잡으면 내용이 그대로 노출이 된다. 아무튼 임베디드 보드에서도 간단히 트위터를 사용이 가능하다.


임베디드 보드에서 트위터하기

이 블로그 포스트는 Twitter API Proxy 서비스인 supertweet.net를 이용해서 PC나 스마트폰이 아닌 임베디드 보드에서 트위터 메시지를 보내는 방법을 설명한다.
참조 사이트:mbed의 post to Twitter via SuperTweet 

먼저 트위터 아이디가 필요한데, 테스트를 위해 twitter.com 에서 ID를 하나 만들었다. EspressoDopio2. 참고로 내 트위터 아이디는 EspressoDopio

Supertweet.net 에 접속해서 docoment link에 가면 3가지 step으로 설명을 해 놓고 있다.
1. Sign UP/ Sign in now를 클릭해서 MyAuthAPIProxy가 계정 사용을 승인하도록 한다.
2. Basic Auth를 위한 패스워드를 설정한다. 이 password는 패스워드와 다르게 설정함.
이 설정이 되면 다음과 같이 Username이 나타다고 Secret 밑에 Show 를 클릭하면 내가 정한 password가 나타난다.


3. 이젠 임베디드 보드에서 트위터 메시지를 보내면 되는데, Twitter.com 대신에  http://api.supertweet.net 로 보내면 된다.
구체적인 방법은 http://www.supertweet.net/about/api 링크를 확인하면 되는데, 간단히 메시지 post하는 것을 설명하면…

 아래 예제는 curl를 사용해서 메세지를 보내는데, user:password는 위 테이블의 Username 즉 트위터 아이디가 되겠고, password는 Supertweet에서 설정한 password이다. 트위터 메시지는 “playing with cURL and the SuperTweet.net API” 이게 되겠다.

curl -u user:password -d “status=playing with cURL and the SuperTweet.net API” http://api.supertweet.net/1/statuses/update.xml
참고) cURL은 http://curl.haxx.se/ 에서 다운로드 가능. 윈도우 버젼도 있다.

실제 트위터에 메시지가 올라간 경우.


Wireshark로 실제 날라가는 패킷을 잡아보면 다음과 같다.

빨간색이 보낸 패킷이고 파란색이 받은 패킷이다.
보낸 패킷에서 2번째 줄이 Authorization인데, Basic 뒷 부분은 “Username:password” 가 base64로 인코딩되어 있고, 보낸 패킷의 마지막 부분의 status= 뒷부분이 보낸 메시지 이다.

따라서 임베디드 보드에서 이것을 구현을 하려면,
-. DNS: api.supertweet.net에 접속을 위해
-. HTTP Client
-. Base64 encoding 함수등이 구현이 되야 겠다.

구체적인 구현 결과물은 다음 기회에……


Arduino Education


아두이노가 Store, Labs에 이어 Education이라는 카테고리를 만들었습니다. http://scuola.arduino.cc/en
교사를 위한 공간이지만 반드시 교사일 필요는 없고, 기존의 커뮤니티 처럼 모두가 참여할 수 있는 구조입니다.
아직 베타버젼이어서 현재 한 20 명정도가 참여하고 있는데, 활성화가 되면 이들의 커뮤니티 확장이 가속도를 내는 것 같습니다.


최근 Lesson중 하나인 아두이노 이더넷 관련 내용 한번 보시죠.



최신 보드인 Arduino Ethernet은 W5100이 메인 보드에 default로 들어가 있고, USB가 빠졌습니다. 대신 작은 USB to Serial 보드로 연결해서 툴과 연결을 합니다.

최근에 Arduino의 멤버인 Banzi가 Getting Started with Arduino의 2nd 버젼도 거의 완성이 됐다는 트윗도 있습니다.

@bjepson(Brian Jepson)은 OReillyMedia의 에디터…



Pages:12345