아두이노 i2c 의 병렬연결 (Arduion connetion multi device by i2c)

in #kr7 years ago (edited)

![2tm_control_05.png

저번 포스팅에서 제빵용 발효기의 아두이노 온습도 제어기를 만들어서 성공적으로 구형 아날로그 제어기를 교체 했었다.

In my last post, I had successfully replaced the old analog controller by creating an Arduino temperature and humidity controller for baking fermenters.

그런데 이 경험을 여러분들과 공유를 했더니, DHT 온습도 센서보다는 SHT 온습도 센서가 정밀하다고 조언해 주셨다.

However, when I shared this experience with you, I advised that the SHT temperature and humidity sensor is more accurate than the DHT temperature and humidity sensor.

DHT22 센서, $3 정도 (DHT22 temperature and humidity sensor, about $3)

dht22.png

SHT 센서, $4-$5 정도 (SHT31 temperature and humidity sensor, about $4-$5)

sht31.png

그래서 SHT 온습도 센서를 구매해서 연결하려고 해보니, 이것은 DHT 와는 달리 i2c 인터페이스 였다. 이미 LCD 장치를 i2c 로 쓰고 있는데, 복수연결이 가능한가? 하고 검색해 봤더니, 가능하다고 하기는 하는데, 대부분 아두이노 장치간의 통신등의 예제만 있을 뿐, 멀티 센서를 i2c 로 연결하는 예제는 발견할 수가 없었다.

So, when I tried to connect SHT temperature sensor, it was an i2c interface, unlike DHT. I am already writing LCD device as i2c. Can multiple connections be made? I tried to search it, but I can say that it is possible. Mostly, there are only examples of communication between the Arduino devices. I could not find any example of connecting the multi sensors to i2c.

찾다가 못해서, 뭐 망가지기아 하겠어? 하는 생각으로 그냥 병렬로 연결했다.

I can not find it, so what do you want to break? I just connected in parallel with the idea.

그런데 안됨. ㅡㅡ;;

However, no. ㅡ ㅡ ;;

뭐지? LCD 디스플레이의 세팅값을 조정해도 안됨. 주소를 바꿔줘도 안됨. 2시간동안 수십번 재조립을 해봐도 안됨.
밤에 고생하다가, 그냥 잠자고는 다음날 아침... 아두이노 그룹에 조언을 구했다.

What? You can not adjust the LCD display setting. You can not change your address. Do not reassemble dozens of times in 2 hours. After suffering at night, I just slept and the next morning ... I asked advice from the Arduino group.

다들 반응이 그냥 될텐데요? 안된다는 하소연에 이해가 안된다는 반응. 할수 없이, 그냥 재조립하고 다시 시도하니...

Will everyone just react? I do not understand the complaint that no. I can not, just reassemble and try again ...

헐....
그냥 된다. =><=

OMG...
It just goes. => <=

27654534_1857601804281718_1320063853494704973_n.jpg

왜 조언을 구하기 전에는 아무리 해도 안되었었지? 한 2시간 헤매었는데... 아무래도 귀신이 씌웠었나 봅니다. 왜 되는지 모르겠다고 했더니, 한 친구가 "믿음이 부족해서 그런겁니다. " 라고 함... 그냥 인정. ㅡㅡ;;

Why did not you do it before you asked for advice? I've been wandering for about 2 hours ... I think the ghost has been put on. I said I do not know why, and a friend said, "It is because of lack of faith." ㅡ ㅡ ;;

i2c 인터페이스를 이용한, LCD 디스플레이와, 여러 센서들을 병렬로 연결하면 그냥 됩니다. 혹시 안되면 믿음이 부족하신 겁니다. ^^);;

With the i2c interface, LCD display, and multiple sensors in parallel, it just happens. If you do not, you do not have faith. ^^);;

소오스 (source)
https://github.com/winchild/SHT31-TemperatureHumidityLCD-Display

Coin Marketplace

STEEM 0.20
TRX 0.16
JST 0.030
BTC 65801.73
ETH 2664.59
USDT 1.00
SBD 2.88