마지막으로 알아볼 녀석은 LCD1602 모듈입니다.




우선 datasheet를 먼저 보려고.. 했으나... ㅎㄷㄷ


http://www.elecrow.com/download/LCD1602.pdf



PIN map을 확인하여 arduino에 연결을 적절히(?) 해주세요. Ground를 특히 주의하셔야 합니다.


다행히 LCD library가 Arduino에서 제공되고 있어, Datasheet의 Initialization Sequence 정도 참고로 보시면 될듯합니다.





가난한 S/W 쟁이라 아무생각 없이 우선 cable들만 연결해서 동작이 되는지 확인해 보았습니다.



하지만 접지에 문제가 있는지 제대로 동작하지 않는 ㅠ.ㅠ

접지가 제대로 되지 않아 글자도 깨져 출력 되어 전원 인가된 상태만 확인하였습니다.

아래 사진에 하얀색으로 빵처럼 납작하게 생긴 판은 일명 빵판(bread-board)입니다.




결국 H/W 랩실에 들어가서 정상적으로 PIN head로 납땜을 해주었습니다.


S*-H사에서 갈고 닦은 납땜 실력으로 겨우 겨우 ^^:








/*

  LiquidCrystal Library - Hello World


 Demonstrates the use a 16x2 LCD display.  The LiquidCrystal

 library works with all LCD displays that are compatible with the

 Hitachi HD44780 driver. There are many of them out there, and you

 can usually tell them by the 16-pin interface.


 This sketch prints "Hello World!" to the LCD

 and shows the time.


  The circuit:

 * LCD RS pin to digital pin 12

 * LCD Enable pin to digital pin 11

 * LCD D4 pin to digital pin 5

 * LCD D5 pin to digital pin 4

 * LCD D6 pin to digital pin 3

 * LCD D7 pin to digital pin 2

 * LCD R/W pin to ground

 * LCD VSS pin to ground

 * LCD VCC pin to 5V

 * 10K resistor:

 * ends to +5V and ground

 * wiper to LCD VO pin (pin 3)


 Library originally added 18 Apr 2008

 by David A. Mellis

 library modified 5 Jul 2009

 by Limor Fried (http://www.ladyada.net)

 example added 9 Jul 2009

 by Tom Igoe

 modified 22 Nov 2010

 by Tom Igoe


 This example code is in the public domain.


 http://www.arduino.cc/en/Tutorial/LiquidCrystal

 */


// include the library code:

#include <LiquidCrystal.h>


// initialize the library with the numbers of the interface pins

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


void setup() {

  // set up the LCD's number of columns and rows:

  lcd.begin(16, 2);

  // Print a message to the LCD.

  lcd.print("hello, world!");

}


void loop() {

  // set the cursor to column 0, line 1

  // (note: line 1 is the second row, since counting begins with 0):

  lcd.setCursor(0, 1);

  // print the number of seconds since reset:

  lcd.print(millis() / 1000);

}


References :

https://www.arduino.cc/en/Tutorial/HelloWorld?from=Tutorial.LiquidCrystal

http://cafe.naver.com/mpucafe/2863

https://learn.adafruit.com/character-lcds/wiring-a-character-lcd

http://blog.naver.com/q19891204/220605172716

반응형




드디어 벼르고 벼르던 ARDUINO와 센서들을 구입하였습니다.

장난 삼아서라도 그냥 만들어 보고 싶던 것을 무작정 만들어보기~


아래 녀석은 ARDUINO 시리즈 중에 Genuino 101 입니다. 

미국에서는 ARDUINO라고 파는데, 그 외의 국가에서는 GENUINO라는 브랜드 명을 사용합니다.



이 보드를 선택하게 된 이유는 중력 센서와 가속도 센서가 포함되어 있기 때문이랍니다.

자세히 보니 BLE도 포함되어 있군요



OPEN-SOURCE는 사랑입니다. ㅎ




좀더 자세한 정보는 아래 Official 링크에서 확인 하실 수 있습니다.

https://www.arduino.cc/en/Main/ArduinoBoard101





기존에 사둔 라즈베리파이와 이 보드를 이용하여 우선 만들어 보고 싶은 프로젝트 1호는

집앞 아파트 계단에 몰래 담배피는 학생들을 잡기 위해 초음파 센서를 붙인 몰카 입니다. 

잡히기만 해봐라~ 부모님과 면담을 기필코 진행해 주리라 !!


아래는 HC-SR04 초음파 센서입니다. 측정거리는 2~400cm, DC 5V/2mA 로 저정도 성능이면 충분히 계단참을 감시할 수 있으리라 ^^: 생각이 듭니다.


이건 16*2 5V LCD 모듈입니다. 간단히 디버그 메세지 등을 뿌려 볼 예정입니다.


아래는 DHT11 온/습도 센서입니다. 영하 측정이 안되어서 아쉽긴 하지만 축사 온도 측정 등의 프로젝트에 활용해 볼 예정입니다. 온도는 0~50도, 습도는 20%~95%까지 측정 가능합니다.


S/W 쟁이라 첨보는 신기한 물건이라 사진을 찍어 보았습니다. 빵판입니다 ^^ Bread-Board로 납땜하기 싫을때 위에 모듈들을 꼽아 쓰는 보드 입니다.



허접하고 기술적으로도 많이 부족하지만 

그래도 뭔가 만들어 본다는 혼자만의 만족감이라고나 할까요 ㅎㅎ


진행사항 있을때마다 조금씩 업데이트 해보도록 하겠습니다.

반응형

+ Recent posts