Skip to content

nCube:Thyme for Arduino Application : nCube Base (Korean)

IoTKETI edited this page Feb 20, 2018 · 8 revisions

nCube:Thyme for Arduino - Application : nCube-Base

๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์ •

ํ†ตํ•ฉ ๊ฐœ๋ฐœํ™˜๊ฒฝ ์„ค์น˜ & nCube:Thyme for Arduino Libraries ๋‹ค์šด๋กœ๋“œ

Json & MQTT Libraries for Arduino ๋‹ค์šด๋กœ๋“œ

์šฐ์„  ์•„๋ž˜ ๋งํฌ ๋œ github ํŽ˜์ด์ง€๋ฅผ ํ†ตํ•ด ArduinoJson๊ณผ PubSubClient ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ๋‹ค์šด๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

๋‹ค์Œ์œผ๋กœ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์„ nCube:Thyme for Arduino Libraries ๋””๋ ‰ํ† ๋ฆฌ๋กœ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค. nCube:Thyme for Arduino Libraries๋Š” ์•„๋ž˜ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด ๋ฐฐ์น˜๋ฉ๋‹ˆ๋‹ค.

ํ•˜๋“œ์›จ์–ด

  • Cortex M0 processor
  • SPI, I2C, UART ํ†ต์‹  ์ง€์›
  • 802.11bgn์„ ์ง€์›ํ•˜๋Š” Atmel WINC1500 WiFi chip

CM1106 CO2 Sensor

  • ๋Œ€๊ธฐ์ค‘์˜ Co2, TVOC(TOTAL Volatile Organic Compounds), ์˜จ๋„ ๊ฐ’์„ ์ธก์ •ํ•ฉ๋‹ˆ๋‹ค
  • UART ํ†ต์‹ ์„ ํ†ตํ•ด Arduino์— ์„ผ์„œ ๊ฐ’์„ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค.

RGB LED

  • RGB 3-color LED ๋ณด๋“œ๋Š” ๋นจ๊ฐ„์ƒ‰, ๋…น์ƒ‰, ํŒŒ๋ž€์ƒ‰๊น”๋กœ ์ผœ์ง‘๋‹ˆ๋‹ค.
  • RGB 3-color LED ๋ณด๋“œ๋Š” R, G, B ํ•€์˜ ์ž…๋ ฅ์— ๋”ฐ๋ผ ๋™์ž‘๋ฉ๋‹ˆ๋‹ค.

nCube-Base ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ๊ฐœ๋ฐœ

ํ•˜๋“œ์›จ์–ด ์—ฐ๊ฒฐ

์•„๋ž˜์˜ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด Adafruit Feather M0 ๋ณด๋“œ์™€ ์„ผ์„œ๋ฅผ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
2017-11-04 11 20 14

nCube-Base Arudino sketch

์•„๋ž˜์˜ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด lib/oneM2MClient/examples/nCube-Base ๋””๋ ‰ํ† ๋ฆฌ์— ์žˆ๋Š” nCube-Base.ino Arduino sketch ์˜ˆ์ œ ์ฝ”๋“œ๋ฅผ src ๋””๋ ‰ํ† ๋ฆฌ์— ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

nCube-Base Arduino sketch ์—…๋กœ๋“œ & ์‹คํ–‰


USB ์ผ€์ด๋ธ”์„ ์‚ฌ์šฉํ•˜์—ฌ Adafruit Feather M0 ๋ณด๋“œ์™€ PC๋ฅผ ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.


nCube-Base.ino Arduino sketch ์˜ˆ์ œ ์ฝ”๋“œ๋ฅผ ์ปดํŒŒ์ผ ๋ฐ ์—…๋กœ๋“œ ํ•˜๊ธฐ์œ„ํ•ด PlatformIO ํˆด๋ฐ”์—์„œ Upload ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.


nCube-Base ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์˜ ์‹คํ–‰ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด ์‹œ๋ฆฌ์–ผ ๋ชจ๋‹ˆํ„ฐ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
PlatformIO ํˆด๋ฐ”์—์„œ ์‹œ๋ฆฌ์–ผ ๋ชจ๋‹ˆํ„ฐ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.


๋…ธํŠธ๋ถ ๋˜๋Š” ์Šค๋งˆํŠธํฐ์˜ WiFi๋ฅผ ์ด์šฉํ•˜์—ฌ ์‹œ๋ฆฌ์–ผ ๋ชจ๋‹ˆํ„ฐ์— ํ‘œ์‹œ๋œ 'wifi101-XXXX' (different name for each Adafruit Feather M0 board)์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.


๊ทธ๋ฆฌ๊ณ  ์›น ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์—ด์–ด, URL ์ฃผ์†Œ์ฐฝ์— 'http://wifi101.local'๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.
Network Name ์•„๋ž˜์—๋Š” ์—ฐ๊ฒฐํ•  AP์˜ SSID๋ฅผ ์ž…๋ ฅํ•˜๊ณ , Pass phrase ์•„๋ž˜์—๋Š” AP์˜ ํŒจ์Šค์›Œ๋“œ๋ฅผ ์ž…๋ ฅํ•œ ํ›„ connect ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.


WiFi๋ฅผ ์—ฐ๊ฒฐํ•˜๋ฉด nCube-Base๊ฐ€ ๋ฆฌ์†Œ์Šค๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์„ผ์„œ์˜ ์„ผ์‹ฑ ๊ฐ’์„ ์—…๋กœ๋“œํ•ฉ๋‹ˆ๋‹ค. ๊ฒฐ๊ณผ๋Š” ์‹œ๋ฆฌ์–ผ ๋ชจ๋‹ˆํ„ฐ๋กœ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

nCube-Base ๋ฐ์ดํ„ฐ ์กฐํšŒ & ์ œ์–ด

nCube-Base ์„ผ์„œ ๋ฐ์ดํ„ฐ ์กฐํšŒ

์„ผ์„œ์˜ ๋ฐ์ดํ„ฐ๋ฅผ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด, Mobius Resource Monitor๋ฅผ ์—ฝ๋‹ˆ๋‹ค.


์œ„ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด Resource Path์— ๋ณ€์ˆ˜ AE_NAME์˜ ๊ฐ’์„ ์ž…๋ ฅํ•˜๊ณ  Start ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.


์œ„ ๊ทธ๋ฆผ์€ ์กฐํšŒ๋œ nCube-Base ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์˜ ๋ฆฌ์†Œ์Šค ๊ตฌ์กฐ์ž…๋‹ˆ๋‹ค.


Container(cnt)์— co2์˜ ์„ผ์‹ฑ ๊ฐ’์ด ์—…๋กœ๋“œ๋ฉ๋‹ˆ๋‹ค.

nCube-Base RGB-LED Control

RGB-LED๋ฅผ ์ œ์–ดํ•˜๊ธฐ ์œ„ํ•ด led cnt์— Content-Instance(cin)์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.


led cnt ์œ„์— ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ ค๋‘๊ณ  ์˜ค๋ฅด์ชฝ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•˜์—ฌ Create๋ฅผ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.


Content(con)์— 0~7์˜ ์ˆซ์ž๋ฅผ ์„ ํƒํ•˜์—ฌ ์ž…๋ ฅํ•˜๊ณ  Create ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ฉ๋‹ˆ๋‹ค.


์œ„์˜ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด LED๋Š” con์˜ ๊ฐ’์— ๋”ฐ๋ผ ๋นจ๊ฐ„์ƒ‰, ๋…น์ƒ‰, ํŒŒ๋ž€์ƒ‰์œผ๋กœ ์ผœ์ง‘๋‹ˆ๋‹ค.

Clone this wiki locally