Skip to content

SecuritySensor4ToMQTT

Arduino sketch to read the status of up to 4 security sensors using End Of Line resistors and push events to MQTT

Lihan__

Published July 08, 2026

Original author: SuperHouseOriginal source (new tab)

SecuritySensor4ToMQTT

Project description

SecuritySensor4ToMQTT โ€” Turning a Wired Alarm Loop into an MQTT Event Stream

#HomeSecurity #MQTT #EOLResistor #AlarmPanel #Arduino #WIZnet #W5100 #TOE #TCP #HomeAutomation

๐Ÿ“š Context: Hobby / home-automation building block, published by SuperHouse Automation Pty Ltd (Jonathan Oxer) in 2015. A compact, single-sketch Arduino firmware. Implementation status: Code-complete and field-oriented โ€” network bring-up, MAC-from-ROM, 6-state sensor supervision, and live MQTT publishing are all present in the sketch. The repository is code-only (no captured logs/screenshots), so behaviour is verified from the source, not from bundled test artifacts.


01 โ€” What is this project?

Traditional wired intrusion alarms are wonderfully reliable but stubbornly closed. A classic panel sits in a cupboard, reads its End-of-Line (EOL) resistor loops, and โ€” if you're lucky โ€” dials a monitoring centre. Getting those same sensor states into a modern smart-home stack (Home Assistant, Node-RED, a phone dashboard) usually means either ripping the panel out or bolting on an expensive proprietary bridge.

SecuritySensor4ToMQTT takes the opposite approach: it is the panel, but it speaks MQTT natively. The firmware reads up to four security sensors wired with End-of-Line resistors into analog inputs, classifies each loop into one of six electrically-distinct states, and publishes every state change to an MQTT broker as a plain, easy-to-consume message.

Because it uses EOL resistors rather than simple dry contacts, it doesn't just know "open vs closed" โ€” it can tell Normal, Tamper, Alarm, Alarm+Tamper, Shorted, and Cut apart by measuring where the analog reading lands. That is genuine alarm-grade supervision: a snipped wire or a shorted loop is reported as an event, not silently ignored.

The end result is a small, always-on box that turns a professional wired sensor topology into a stream of MQTT events any home-automation platform can subscribe to โ€” with an optional on-device colour OLED for local status.

02 โ€” Why MQTT + EOL supervision?

๐Ÿ”ท EOL resistors = tamper-aware sensing, not just on/off

A dry-contact sensor gives you one bit. An EOL-resistor loop gives you a value. By placing a known resistor at the far end of the loop, the panel can distinguish a healthy "Normal" loop from an "Alarm" (contact opened), a "Tamper" (enclosure interfered with), a "Cut" wire, or a "Shorted" loop. The project encodes this directly as ADC threshold bands (0โ€“162 Short, 163โ€“409 Normal, 410โ€“551 Tamper, 552โ€“641 Alarm, 642โ€“848 Alarm+Tamper, 849โ€“1023 Cut). This is the difference between a hobby reed switch and a supervised security zone.

๐Ÿ”ท MQTT = drop-in integration with the modern smart home

Rather than inventing a protocol, the firmware publishes to standard MQTT topics (sensors for state changes, events on startup). That means it works out-of-the-box with Mosquitto, Home Assistant, Node-RED, or any dashboard that speaks MQTT โ€” no custom server, no polling, just lightweight pub/sub over a persistent TCP connection.

๐Ÿ”ท Always-on, low-overhead, and cheap to duplicate

Each panel carries a panelId, so you can scatter several boxes around a building and let them all report to one broker with unambiguous message prefixes. The design is deliberately minimal โ€” one sketch, a couple of libraries โ€” which keeps it approachable and easy to reproduce.

03 โ€” System architecture

03 โ€” System architecture

04 โ€” Why WIZnet W5100? โญ

๐Ÿ”ท The technical core: a hardwired TCP/IP stack next to a small MCU

The panel runs on an ATmega2560-class Arduino board (the sketch uses digital pins up to 53 and an I2C MAC ROM, the hallmark of a Freetronics EtherMega-style board). That MCU has generous flash but only a few kilobytes of SRAM โ€” and it is already busy continuously sampling four analog loops, running a state machine, driving an OLED, and maintaining an MQTT session. Handing the entire TCP/IP job to software would be the wrong trade.

The WIZnet W5100 solves exactly this. It integrates a hardwired TCP/IP core (TCP, UDP, ICMP, IPv4, ARP) plus the 10/100 Ethernet MAC & PHY, exposes 4 independent hardware sockets backed by a 16 KB internal TX/RX buffer, and connects to the MCU over SPI. The three-way handshake, retransmissions, checksums and ACKs all happen inside the W5100 silicon โ€” the ATmega only reads and writes socket payloads.

๐Ÿ”ท Socket mode used: TOE TCP (Sn_MR_TCP)

This project lives entirely in the W5100's TCP Offload Engine (TOE) TCP mode. The MQTT client (PubSubClient) opens a persistent TCP connection to the broker on port 1883 (client.connect(...)) and publishes over it (client.publish("sensors", ...)). No UDP, no MACRAW โ€” just a rock-solid offloaded TCP session, which is exactly what a long-lived MQTT link to an always-on alarm panel wants.

๐Ÿ”ท Advantage over the alternatives

Compared with a MAC+PHY-only chip like the ENC28J60, which forces a software TCP/IP stack (e.g. UIPEthernet) that consumes precious SRAM and CPU, the W5100 gives this panel a reliable network link at near-zero MCU cost. On a device that must never drop its alarm-reporting connection while simultaneously supervising four zones, that offload is the difference between "works on the bench" and "runs for months in a cupboard." It also drops straight into the standard Arduino Ethernet library, so the whole network layer is a handful of lines (Ethernet.begin(mac) and away it goes).

๐Ÿ”ท Verified evidence โœ…

  • Network bring-up in code: Ethernet.begin(mac) (DHCP) and Ethernet.begin(mac, ip) (static) โ€” both paths present. The source even comments the intent: "setup the Ethernet library to talk to the Wiznet board."
  • Live MQTT over TCP: PubSubClient client(server, 1883, callback), client.connect(...), client.publish("sensors", ...) and a startup client.publish("events", "Starting up").
  • Production-style identity: unique MAC pulled from an I2C ROM (Microchip 24AA125E48) with a static fallback.
  • Genuine supervision: six ADC threshold bands encode Short / Normal / Tamper / Alarm / Alarm+Tamper / Cut.

05 โ€” Key components

๐ŸŒ WIZnet W5100 โ€” TOE TCP socket mode

The networking heart of the panel. Hardwired TCP/IP core with integrated MAC & PHY, 4 hardware sockets, 16 KB buffer, SPI host interface. Here it carries a single persistent TOE TCP connection to the MQTT broker.

๐Ÿง  ATmega2560-class Arduino (Freetronics EtherMega-style)

Samples the four analog loops, runs the 6-state classifier, and hosts the MQTT client. Uses pins up to 53 โ†’ a Mega-class MCU rather than an Uno.

๐Ÿ“Ÿ Microchip 24AA125E48 MAC ROM (I2C)

Provides a globally-unique, burned-in MAC address so multiple panels never collide on the network โ€” read over I2C at boot.

๐Ÿ“š PubSubClient (MQTT)

Lightweight Arduino MQTT client handling the publish/subscribe session to the broker.

๐Ÿ–ฅ๏ธ Freetronics OLED128 (optional, FTOLED)

128ร—128 colour OLED for on-device status and event display when a headless box isn't desired.

๐Ÿ”Œ EOL-resistor sensor loops ร—4

End-of-Line resistors turn each sensor into a supervised analog loop, enabling tamper/cut/short discrimination rather than plain open/closed.

06 โ€” Application scenarios

01. Retrofitting a legacy wired alarm into a smart home Reuse existing EOL-resistor sensor wiring, but publish every zone change to MQTT so Home Assistant or Node-RED can automate lights, notifications, or sirens.

02. Multi-zone home / small-office intrusion monitoring Four supervised zones per box, with tamper and wire-cut detection โ€” meaningful security coverage that a phone dashboard can watch in real time.

03. Perimeter supervision that survives sabotage Because the loop is supervised, a cut or shorted wire is itself an event. An intruder disabling a sensor triggers an alarm instead of a silent blind spot.

04. Distributed panels across a building Deploy several units, each with a distinct panelId, all publishing to one broker โ€” a cheap way to cover a whole site while keeping messages unambiguous.

Conclusion

A wired burglar-alarm loop is about as far from "networking gear" as home hardware gets โ€” yet here a WIZnet W5100 quietly carries every alarm event onto the network, turning a closed panel into an open MQTT stream.

  • โœ… Four supervised EOL-resistor zones with six discriminated states (Normal / Tamper / Alarm / Alarm+Tamper / Short / Cut)
  • โœ… Reliable, always-on network link via WIZnet W5100 in TOE TCP mode โ€” offloaded TCP at near-zero MCU cost
  • โœ… Native MQTT pub/sub (PubSubClient) โ†’ drops straight into Home Assistant / Node-RED / any MQTT dashboard
  • โœ… Production-style unique MAC from I2C ROM with DHCP-or-static flexibility
  • โœ… Optional on-device colour OLED status without any extra host
  • โœ… Multi-panel scalable via per-box panelId
  • โœ… Reach: from FPGA firewalls to end-of-line alarm resistors, WIZnet silicon keeps turning up wherever something has to reliably talk IP โ€” including inside a domestic security panel.

07 โ€” Similar Projects on WIZnet Makers

The WIZnet Makers platform already hosts a small cluster of wired-security and sensor-to-broker projects. Placing SecuritySensor4ToMQTT among them shows a clear spectrum โ€” from bare sensor demos to full supervised-and-published panels.

  • Intrusion detection system using W5100 + Arduino โ€” a W5100 + Arduino intrusion-detection build; the closest sibling in silicon and MCU family. (maker.wiznet.io/WIZnet/projects/intrusion-detection-system-using-w5100-arduino/)
  • A simple burglar Alarm: motion sensor, noise sensor and ethernet shield โ€” reads motion and noise sensors over an Ethernet shield; multi-sensor alarm, different sensing style. (maker.wiznet.io/Alan/projects/a-simple-burglar-alarm...)
  • Proof of Concept Door Alarm โ€” an Ethernet-shield door-alarm example, monitored via the Arduino platform. (maker.wiznet.io/WIZnet/projects/proof-of-concept-door-alarm/)
  • Arduino MEGA + Ethernet Shield + PIR โ€” a Mega-class board reading a PIR sensor and surfacing data to phone/desktop. (maker.wiznet.io/WIZnet/projects/arduino-mega-ethernet-shield-pir/)
  • Send data from DHT11 sensor using MQTT with Pi Pico and W5500 โ€” the modern MQTT counterpart: a Pico + W5500 pushing sensor data over MQTT. (maker.wiznet.io/wiz_chandana/projects/send-data-from-dht11-sensor-using-mqtt-with-pi-pico-and-w5500/)
ProjectMCUWIZnet chipSensing approachReporting methodDistinctive angle
SecuritySensor4ToMQTT (this)ATmega2560 (Mega)W51004ร— EOL-resistor loops, 6 statesMQTT over TOE TCPSupervised (tamper/cut) and MQTT-published
Intrusion detection (W5100 + Arduino)ArduinoW5100Intrusion sensor(s)Ethernet-connectedSame chip/MCU family; intrusion focus
Simple burglar Alarm (Alan)ArduinoEthernet shield (WIZnet)Motion + noise sensorsEthernet shieldMulti-sensor, non-supervised loops
Proof of Concept Door AlarmArduinoEthernet shield (WIZnet)Door sensorMonitored via Arduino platformMinimal PoC demo
Arduino MEGA + Ethernet + PIRATmega2560 (Mega)Ethernet shield (WIZnet)PIR motionPhone / desktop viewSame board class; single PIR
DHT11 โ†’ MQTT (Pico + W5500)RP2040 (Pico)W5500DHT11 environmentalMQTTModern chip; telemetry, not security

Insight: This ecosystem spans two axes โ€” sensing sophistication (dry-contact/PIR demos vs. supervised EOL loops) and reporting maturity (view-on-a-web-page vs. MQTT pub/sub). Most of the security-domain entries sit at the demo end of one axis or the other. SecuritySensor4ToMQTT is distinctive because it lands high on both at once: genuine alarm-grade EOL supervision and clean MQTT integration. The DHT11+Pico+W5500 project shows where the platform's newer hardware takes the same sensor-to-broker pattern โ€” but toward environmental telemetry rather than security. In short, this project is the "grown-up alarm panel" of the cluster.

Q&A

Q. Which WIZnet socket mode does this use, and why not UDP? A. It uses TOE TCP (Sn_MR_TCP). MQTT rides on a persistent TCP connection, and for an always-on alarm reporter you want TCP's guaranteed, ordered delivery and connection awareness โ€” a dropped/re-established session is itself information. UDP would trade that reliability away for latency the application doesn't need.

Q. Does the W5100 do the TCP work, or the ATmega? A. The W5100 does it. Its hardwired TCP/IP core handles the handshake, retransmission, checksums and ACKs in silicon; the ATmega only reads/writes socket payloads over SPI. That offload is precisely why an 8 KB-SRAM MCU can comfortably supervise four zones and hold an MQTT link.

Q. What makes the sensing "supervised" rather than a simple switch? A. The End-of-Line resistors. By measuring the analog value of each loop (not just open/closed), the firmware distinguishes Normal, Tamper, Alarm, Short and Cut โ€” so tampering or a severed wire is reported as an event instead of being silently missed.

Q. Could this be moved to a newer WIZnet part? A. Conceptually yes โ€” the same TOE TCP / MQTT pattern maps cleanly onto W5100S or W5500 (as the Pico + W5500 sibling project demonstrates), which is a natural modernization path for anyone rebuilding this today.



SecuritySensor4ToMQTT โ€” ์œ ์„  ์•Œ๋žŒ ๋ฃจํ”„๋ฅผ MQTT ์ด๋ฒคํŠธ ์ŠคํŠธ๋ฆผ์œผ๋กœ

#ํ™ˆ๋ณด์•ˆ #MQTT #EOL์ €ํ•ญ #์•Œ๋žŒํŒจ๋„ #Arduino #WIZnet #W5100 #TOE #TCP #ํ™ˆ์˜คํ† ๋ฉ”์ด์…˜

๐Ÿ“š ์ปจํ…์ŠคํŠธ: SuperHouse Automation Pty Ltd(Jonathan Oxer)๊ฐ€ 2015๋…„์— ๊ณต๊ฐœํ•œ ํ™ˆ ์˜คํ† ๋ฉ”์ด์…˜์šฉ ๋นŒ๋”ฉ ๋ธ”๋ก. ๋‹จ์ผ ์Šค์ผ€์น˜๋กœ ์ด๋ค„์ง„ ์ปดํŒฉํŠธํ•œ Arduino ํŽŒ์›จ์–ด. ๊ตฌํ˜„ ์ƒํƒœ: ์ฝ”๋“œ ์™„๊ฒฐ + ํ˜„์žฅ ์ง€ํ–ฅํ˜• โ€” ๋„คํŠธ์›Œํฌ ์ดˆ๊ธฐํ™”, ROM์—์„œ MAC ์ฝ๊ธฐ, 6-์ƒํƒœ ์„ผ์„œ ๊ฐ์‹œ, ์‹ค์‹œ๊ฐ„ MQTT ๋ฐœํ–‰์ด ๋ชจ๋‘ ์Šค์ผ€์น˜ ์•ˆ์— ๋“ค์–ด ์žˆ์Œ. ์ €์žฅ์†Œ๋Š” ์ฝ”๋“œ ์ „์šฉ(๋กœ๊ทธ/์Šคํฌ๋ฆฐ์ƒท ์—†์Œ)์ด๋ผ, ๋™์ž‘์€ ๋ฒˆ๋“ค ํ…Œ์ŠคํŠธ ์‚ฐ์ถœ๋ฌผ์ด ์•„๋‹ˆ๋ผ ์†Œ์Šค ์ฝ”๋“œ๋กœ ๊ฒ€์ฆํ–ˆ๋‹ค.


01 โ€” ์ด ํ”„๋กœ์ ํŠธ๋Š” ๋ฌด์—‡์ธ๊ฐ€?

์ „ํ†ต์ ์ธ ์œ ์„  ์นจ์ž… ์•Œ๋žŒ์€ ์ง€๋…ํ•˜๊ฒŒ ์‹ ๋ขฐ์„ฑ ๋†’์ง€๋งŒ, ๊ทธ๋งŒํผ ์ง€๋…ํ•˜๊ฒŒ ํ์‡„์ ์ด๋‹ค. ๊ณ ์ „์ ์ธ ํŒจ๋„์€ ๋ฒฝ์žฅ ์•ˆ์— ๋ฐ•ํ˜€ End-of-Line(EOL) ์ €ํ•ญ ๋ฃจํ”„๋ฅผ ์ฝ๊ณ , ์šด์ด ์ข‹์œผ๋ฉด ๊ด€์ œ์„ผํ„ฐ๋กœ ์ „ํ™”๋ฅผ ๊ฑด๋‹ค. ์ด ์„ผ์„œ ์ƒํƒœ๋“ค์„ ์š”์ฆ˜ ์Šค๋งˆํŠธํ™ˆ ์Šคํƒ(Home Assistant, Node-RED, ํฐ ๋Œ€์‹œ๋ณด๋“œ)์œผ๋กœ ๋Œ์–ด์˜ค๋ ค๋ฉด ๋Œ€๊ฐœ ํŒจ๋„์„ ํ†ต์งธ๋กœ ๋œฏ์–ด๋‚ด๊ฑฐ๋‚˜, ๋น„์‹ผ ๋…์  ๋ธŒ๋ฆฌ์ง€๋ฅผ ๋ง๋ถ™์—ฌ์•ผ ํ•œ๋‹ค.

SecuritySensor4ToMQTT๋Š” ์ •๋ฐ˜๋Œ€๋กœ ์ ‘๊ทผํ•œ๋‹ค. ์ด๊ฑด ๊ทธ ์ž์ฒด๋กœ ํŒจ๋„์ด๋ฉด์„œ, MQTT๋ฅผ ๋„ค์ดํ‹ฐ๋ธŒ๋กœ ๋งํ•œ๋‹ค. ํŽŒ์›จ์–ด๋Š” EOL ์ €ํ•ญ์œผ๋กœ ๋ฐฐ์„ ๋œ ์ตœ๋Œ€ 4๊ฐœ์˜ ๋ณด์•ˆ ์„ผ์„œ๋ฅผ ์•„๋‚ ๋กœ๊ทธ ์ž…๋ ฅ์œผ๋กœ ์ฝ์–ด, ๊ฐ ๋ฃจํ”„๋ฅผ ์ „๊ธฐ์ ์œผ๋กœ ๊ตฌ๋ถ„๋˜๋Š” 6๊ฐ€์ง€ ์ƒํƒœ ์ค‘ ํ•˜๋‚˜๋กœ ๋ถ„๋ฅ˜ํ•˜๊ณ , ์ƒํƒœ๊ฐ€ ๋ฐ”๋€” ๋•Œ๋งˆ๋‹ค MQTT ๋ธŒ๋กœ์ปค๋กœ ์†Œ๋น„ํ•˜๊ธฐ ์‰ฌ์šด ํ‰๋ฌธ ๋ฉ”์‹œ์ง€๋ฅผ ๋ฐœํ–‰ํ•œ๋‹ค.

๋‹จ์ˆœ ๋“œ๋ผ์ด ์ ‘์ ์ด ์•„๋‹ˆ๋ผ EOL ์ €ํ•ญ์„ ์“ฐ๊ธฐ ๋•Œ๋ฌธ์—, "์—ด๋ฆผ vs ๋‹ซํž˜"๋งŒ ์•„๋Š” ๊ฒŒ ์•„๋‹ˆ๋‹ค. ์•„๋‚ ๋กœ๊ทธ ์ธก์ •๊ฐ’์ด ์–ด๋А ๊ตฌ๊ฐ„์— ๋–จ์–ด์ง€๋Š”์ง€๋ฅผ ๋ณด๊ณ  **Normal(์ •์ƒ), Tamper(๋ณ€์กฐ), Alarm(๊ฒฝ๋ณด), Alarm+Tamper, Shorted(๋‹จ๋ฝ), Cut(์ ˆ๋‹จ)**์„ ๊ตฌ๋ถ„ํ•œ๋‹ค. ์ด๊ฒƒ์ด ์ง„์งœ ์•Œ๋žŒ ๋“ฑ๊ธ‰ ๊ฐ์‹œ๋‹ค โ€” ์ž˜๋ฆฐ ๋ฐฐ์„ ์ด๋‚˜ ๋‹จ๋ฝ๋œ ๋ฃจํ”„๊ฐ€ ์กฐ์šฉํžˆ ๋ฌด์‹œ๋˜์ง€ ์•Š๊ณ  ์ด๋ฒคํŠธ๋กœ ๋ณด๊ณ ๋œ๋‹ค.

์ตœ์ข… ๊ฒฐ๊ณผ๋ฌผ์€ ์ž‘๊ณ  ํ•ญ์ƒ ์ผœ์ ธ ์žˆ๋Š” ๋ฐ•์Šค ํ•˜๋‚˜๋กœ, ์ „๋ฌธ๊ฐ€๊ธ‰ ์œ ์„  ์„ผ์„œ ํ† ํด๋กœ์ง€๋ฅผ ์–ด๋–ค ํ™ˆ ์˜คํ† ๋ฉ”์ด์…˜ ํ”Œ๋žซํผ์ด๋“  ๊ตฌ๋…ํ•  ์ˆ˜ ์žˆ๋Š” MQTT ์ด๋ฒคํŠธ ์ŠคํŠธ๋ฆผ์œผ๋กœ ๋ฐ”๊ฟ”์ค€๋‹ค. ์›ํ•œ๋‹ค๋ฉด ๊ธฐ๊ธฐ ์ž์ฒด ์ปฌ๋Ÿฌ OLED๋กœ ๋กœ์ปฌ ์ƒํƒœ ํ‘œ์‹œ๋„ ๊ฐ€๋Šฅํ•˜๋‹ค.

02 โ€” ์™œ MQTT + EOL ๊ฐ์‹œ์ธ๊ฐ€?

๐Ÿ”ท EOL ์ €ํ•ญ = ๋‹จ์ˆœ on/off๊ฐ€ ์•„๋‹ˆ๋ผ ๋ณ€์กฐ ๊ฐ์ง€๊ฐ€ ๋˜๋Š” ์„ผ์‹ฑ

๋“œ๋ผ์ด ์ ‘์  ์„ผ์„œ๋Š” 1๋น„ํŠธ๋ฅผ ์ค€๋‹ค. EOL ์ €ํ•ญ ๋ฃจํ”„๋Š” ๊ฐ’์„ ์ค€๋‹ค. ๋ฃจํ”„ ๋์— ์ •ํ•ด์ง„ ์ €ํ•ญ์„ ๋‘๋ฉด, ํŒจ๋„์€ ๊ฑด๊ฐ•ํ•œ "Normal" ๋ฃจํ”„์™€ "Alarm"(์ ‘์  ์—ด๋ฆผ), "Tamper"(ํ•˜์šฐ์ง• ์กฐ์ž‘), "Cut"(๋ฐฐ์„  ์ ˆ๋‹จ), "Shorted"(๋‹จ๋ฝ)์„ ๊ตฌ๋ถ„ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด ํ”„๋กœ์ ํŠธ๋Š” ์ด๊ฑธ ADC ์ž„๊ณ„ ๊ตฌ๊ฐ„์œผ๋กœ ์ง์ ‘ ์ธ์ฝ”๋”ฉํ•œ๋‹ค(0โ€“162 Short, 163โ€“409 Normal, 410โ€“551 Tamper, 552โ€“641 Alarm, 642โ€“848 Alarm+Tamper, 849โ€“1023 Cut). ์ทจ๋ฏธ์šฉ ๋ฆฌ๋“œ ์Šค์œ„์น˜์™€ ๊ฐ์‹œ๋˜๋Š” ๋ณด์•ˆ ์กด(zone)์˜ ์ฐจ์ด๊ฐ€ ๋ฐ”๋กœ ์ด๊ฒƒ์ด๋‹ค.

๐Ÿ”ท MQTT = ์š”์ฆ˜ ์Šค๋งˆํŠธํ™ˆ์— ๊ทธ๋Œ€๋กœ ๊ฝ‚ํžˆ๋Š” ํ†ตํ•ฉ

ํ”„๋กœํ† ์ฝœ์„ ์ƒˆ๋กœ ๋ฐœ๋ช…ํ•˜๋Š” ๋Œ€์‹ , ํŽŒ์›จ์–ด๋Š” ํ‘œ์ค€ MQTT ํ† ํ”ฝ์œผ๋กœ ๋ฐœํ–‰ํ•œ๋‹ค(์ƒํƒœ ๋ณ€ํ™”๋Š” sensors, ๋ถ€ํŒ… ์‹œ์—” events). ๋•๋ถ„์— Mosquitto, Home Assistant, Node-RED, ๋˜๋Š” MQTT๋ฅผ ๋งํ•˜๋Š” ์–ด๋–ค ๋Œ€์‹œ๋ณด๋“œ์™€๋„ ๋ณ„๋„ ์„ค์ • ์—†์ด ๋ฐ”๋กœ ๋™์ž‘ํ•œ๋‹ค โ€” ์ปค์Šคํ…€ ์„œ๋ฒ„๋„, ํด๋ง๋„ ์—†์ด, ์ง€์†์  TCP ์—ฐ๊ฒฐ ์œ„์—์„œ ๊ฐ€๋ฒผ์šด pub/sub๋งŒ ์˜ค๊ฐ„๋‹ค.

๐Ÿ”ท ํ•ญ์ƒ ์ผœ์ ธ ์žˆ๊ณ , ์˜ค๋ฒ„ํ—ค๋“œ๊ฐ€ ๋‚ฎ๊ณ , ๋ณต์ œ๊ฐ€ ์‹ธ๋‹ค

๊ฐ ํŒจ๋„์€ panelId๋ฅผ ๊ฐ–๊ธฐ ๋•Œ๋ฌธ์—, ์—ฌ๋Ÿฌ ๋ฐ•์Šค๋ฅผ ๊ฑด๋ฌผ ๊ณณ๊ณณ์— ๋ฟŒ๋ ค ํ•˜๋‚˜์˜ ๋ธŒ๋กœ์ปค๋กœ ๋ช…ํ™•ํ•œ ๋ฉ”์‹œ์ง€ ์ ‘๋‘์‚ฌ์™€ ํ•จ๊ป˜ ๋ณด๊ณ ํ•˜๊ฒŒ ํ•  ์ˆ˜ ์žˆ๋‹ค. ์„ค๊ณ„๋Š” ์˜๋„์ ์œผ๋กœ ์ตœ์†Œํ™”๋ผ ์žˆ๋‹ค โ€” ์Šค์ผ€์น˜ ํ•˜๋‚˜, ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ช‡ ๊ฐœ โ€” ๊ทธ๋ž˜์„œ ์ ‘๊ทผํ•˜๊ธฐ ์‰ฝ๊ณ  ์žฌํ˜„ํ•˜๊ธฐ ์‰ฝ๋‹ค.

03 โ€” ์‹œ์Šคํ…œ ์•„ํ‚คํ…์ฒ˜

03 โ€” ์‹œ์Šคํ…œ ์•„ํ‚คํ…์ฒ˜

04 โ€” ์™œ WIZnet W5100์ธ๊ฐ€? โญ

๐Ÿ”ท ๊ธฐ์ˆ ์  ํ•ต์‹ฌ: ์ž‘์€ MCU ์˜†์— ๋ถ™์€ ํ•˜๋“œ์™€์ด์–ด๋“œ TCP/IP ์Šคํƒ

ํŒจ๋„์€ ATmega2560๊ธ‰ Arduino ๋ณด๋“œ์—์„œ ๋Œ์•„๊ฐ„๋‹ค(์Šค์ผ€์น˜๊ฐ€ ๋””์ง€ํ„ธ ํ•€์„ 53๋ฒˆ๊นŒ์ง€ ์“ฐ๊ณ  I2C MAC ROM์„ ์‚ฌ์šฉ โ€” Freetronics EtherMega ๊ณ„์—ด ๋ณด๋“œ์˜ ํŠน์ง•). ์ด MCU๋Š” ํ”Œ๋ž˜์‹œ๋Š” ๋„‰๋„‰ํ•˜์ง€๋งŒ SRAM์€ ๋ช‡ KB๋ฟ์ด๊ณ , ์ด๋ฏธ 4๊ฐœ ์•„๋‚ ๋กœ๊ทธ ๋ฃจํ”„๋ฅผ ๋Š์ž„์—†์ด ์ƒ˜ํ”Œ๋งํ•˜๊ณ , ์ƒํƒœ ๋จธ์‹ ์„ ๋Œ๋ฆฌ๊ณ , OLED๋ฅผ ๊ตฌ๋™ํ•˜๊ณ , MQTT ์„ธ์…˜์„ ์œ ์ง€ํ•˜๋А๋ผ ๋ฐ”์˜๋‹ค. TCP/IP ์ž‘์—… ์ „์ฒด๋ฅผ ์†Œํ”„ํŠธ์›จ์–ด์— ๋– ๋„˜๊ธฐ๋Š” ๊ฑด ์ž˜๋ชป๋œ ์„ ํƒ์ด๋‹ค.

WIZnet W5100์ด ๋ฐ”๋กœ ์ด ๋ฌธ์ œ๋ฅผ ํ‘ผ๋‹ค. ํ•˜๋“œ์™€์ด์–ด๋“œ TCP/IP ์ฝ”์–ด(TCP, UDP, ICMP, IPv4, ARP)์™€ 10/100 ์ด๋”๋„ท MAC & PHY๋ฅผ ํ†ตํ•ฉํ•˜๊ณ , 16 KB ๋‚ด๋ถ€ TX/RX ๋ฒ„ํผ๋กœ ๋’ท๋ฐ›์นจ๋˜๋Š” 4๊ฐœ ๋…๋ฆฝ ํ•˜๋“œ์›จ์–ด ์†Œ์ผ“์„ ์ œ๊ณตํ•˜๋ฉฐ, SPI๋กœ MCU์™€ ์—ฐ๊ฒฐ๋œ๋‹ค. 3-way ํ•ธ๋“œ์…ฐ์ดํฌ, ์žฌ์ „์†ก, ์ฒดํฌ์„ฌ, ACK๊ฐ€ ์ „๋ถ€ W5100 ์‹ค๋ฆฌ์ฝ˜ ๋‚ด๋ถ€์—์„œ ์ฒ˜๋ฆฌ๋˜๊ณ , ATmega๋Š” ์†Œ์ผ“ ํŽ˜์ด๋กœ๋“œ๋งŒ ์ฝ๊ณ  ์“ด๋‹ค.

๐Ÿ”ท ์‚ฌ์šฉ ์†Œ์ผ“ ๋ชจ๋“œ: TOE TCP (Sn_MR_TCP)

์ด ํ”„๋กœ์ ํŠธ๋Š” ์ „์ ์œผ๋กœ W5100์˜ TCP Offload Engine(TOE) TCP ๋ชจ๋“œ ์œ„์—์„œ ์‚ฐ๋‹ค. MQTT ํด๋ผ์ด์–ธํŠธ(PubSubClient)๊ฐ€ ๋ธŒ๋กœ์ปค์˜ 1883 ํฌํŠธ๋กœ ์ง€์†์  TCP ์—ฐ๊ฒฐ์„ ์—ด๊ณ (client.connect(...)), ๊ทธ ์œ„์—์„œ ๋ฐœํ–‰ํ•œ๋‹ค(client.publish("sensors", ...)). UDP๋„, MACRAW๋„ ์•„๋‹ˆ๋‹ค โ€” ์˜คํ”„๋กœ๋“œ๋œ ๊ฒฌ๊ณ ํ•œ TCP ์„ธ์…˜ ํ•˜๋‚˜๋ฟ์ด๊ณ , ์ด๊ฒƒ์ด ํ•ญ์ƒ ์ผœ์ง„ ์•Œ๋žŒ ํŒจ๋„์˜ ์žฅ์ˆ˜(long-lived) MQTT ๋งํฌ๊ฐ€ ์ •ํ™•ํžˆ ์›ํ•˜๋Š” ๊ฒƒ์ด๋‹ค.

๐Ÿ”ท ๋Œ€์ฒด ์†”๋ฃจ์…˜ ๋Œ€๋น„ ์šฐ์œ„

MAC+PHY๋งŒ ์žˆ๋Š” ENC28J60 ๊ฐ™์€ ์นฉ์€ ์†Œํ”„ํŠธ์›จ์–ด TCP/IP ์Šคํƒ(์˜ˆ: UIPEthernet)์„ ๊ฐ•์ œํ•˜๊ณ , ์ด๋Š” ๊ท€ํ•œ SRAM๊ณผ CPU๋ฅผ ์žก์•„๋จน๋Š”๋‹ค. ๋ฐ˜๋ฉด W5100์€ ์ด ํŒจ๋„์— ๊ฑฐ์˜ ์ œ๋กœ์— ๊ฐ€๊นŒ์šด MCU ๋น„์šฉ์œผ๋กœ ์‹ ๋ขฐ์„ฑ ์žˆ๋Š” ๋„คํŠธ์›Œํฌ ๋งํฌ๋ฅผ ์ค€๋‹ค. 4๊ฐœ ์กด์„ ๊ฐ์‹œํ•˜๋ฉด์„œ ์•Œ๋žŒ ๋ณด๊ณ  ์—ฐ๊ฒฐ์„ ์ ˆ๋Œ€ ๋Š์–ด์„  ์•ˆ ๋˜๋Š” ๊ธฐ๊ธฐ์—์„œ, ์ด ์˜คํ”„๋กœ๋“œ๋Š” "์‹คํ—˜์‹ค์—์„œ ๋จ"๊ณผ "๋ฒฝ์žฅ์—์„œ ๋ช‡ ๋‹ฌ์„ ๋ˆ๋‹ค"์˜ ์ฐจ์ด๋‹ค. ๋˜ํ•œ ํ‘œ์ค€ Arduino Ethernet ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์— ๊ทธ๋Œ€๋กœ ๊ฝ‚ํ˜€์„œ, ๋„คํŠธ์›Œํฌ ๊ณ„์ธต ์ „์ฒด๊ฐ€ ๋ช‡ ์ค„๋กœ ๋๋‚œ๋‹ค(Ethernet.begin(mac) ํ•œ ์ค„๋กœ ์ถœ๋ฐœ).

๐Ÿ”ท ๊ฒ€์ฆ๋œ ์ฆ๊ฑฐ โœ…

  • ์ฝ”๋“œ ๋‚ด ๋„คํŠธ์›Œํฌ ์ดˆ๊ธฐํ™”: Ethernet.begin(mac)(DHCP)์™€ Ethernet.begin(mac, ip)(๊ณ ์ •) โ€” ๋‘ ๊ฒฝ๋กœ ๋ชจ๋‘ ์กด์žฌ. ์†Œ์Šค๊ฐ€ ์˜๋„๊นŒ์ง€ ์ฃผ์„์œผ๋กœ ๋‚จ๊น€: "setup the Ethernet library to talk to the Wiznet board."
  • ์‹ค์‹œ๊ฐ„ MQTT over TCP: PubSubClient client(server, 1883, callback), client.connect(...), client.publish("sensors", ...), ๊ทธ๋ฆฌ๊ณ  ๋ถ€ํŒ… ์‹œ client.publish("events", "Starting up").
  • ์–‘์‚ฐํ˜• ์•„์ด๋ดํ‹ฐํ‹ฐ: I2C ROM(Microchip 24AA125E48)์—์„œ ์ฝ์–ด์˜จ ๊ณ ์œ  MAC + ๊ณ ์ • MAC ํด๋ฐฑ.
  • ์ง„์งœ ๊ฐ์‹œ: 6๊ฐœ ADC ์ž„๊ณ„ ๊ตฌ๊ฐ„์ด Short / Normal / Tamper / Alarm / Alarm+Tamper / Cut๋ฅผ ์ธ์ฝ”๋”ฉ.

05 โ€” ํ•ต์‹ฌ ๊ตฌ์„ฑ์š”์†Œ

๐ŸŒ WIZnet W5100 โ€” TOE TCP ์†Œ์ผ“ ๋ชจ๋“œ

ํŒจ๋„์˜ ๋„คํŠธ์›Œํ‚น ์‹ฌ์žฅ. ํ•˜๋“œ์™€์ด์–ด๋“œ TCP/IP ์ฝ”์–ด์— MAC & PHY ํ†ตํ•ฉ, 4๊ฐœ ํ•˜๋“œ์›จ์–ด ์†Œ์ผ“, 16 KB ๋ฒ„ํผ, SPI ํ˜ธ์ŠคํŠธ ์ธํ„ฐํŽ˜์ด์Šค. ์—ฌ๊ธฐ์„  MQTT ๋ธŒ๋กœ์ปค๋กœ ๊ฐ€๋Š” ์ง€์†์  TOE TCP ์—ฐ๊ฒฐ ํ•˜๋‚˜๋ฅผ ๋‹ด๋‹นํ•œ๋‹ค.

๐Ÿง  ATmega2560๊ธ‰ Arduino (Freetronics EtherMega ๊ณ„์—ด)

4๊ฐœ ์•„๋‚ ๋กœ๊ทธ ๋ฃจํ”„๋ฅผ ์ƒ˜ํ”Œ๋งํ•˜๊ณ , 6-์ƒํƒœ ๋ถ„๋ฅ˜๊ธฐ๋ฅผ ๋Œ๋ฆฌ๊ณ , MQTT ํด๋ผ์ด์–ธํŠธ๋ฅผ ํ˜ธ์ŠคํŒ…. ํ•€์„ 53๋ฒˆ๊นŒ์ง€ ์“ฐ๋ฏ€๋กœ Uno๊ฐ€ ์•„๋‹ˆ๋ผ Mega๊ธ‰ MCU.

๐Ÿ“Ÿ Microchip 24AA125E48 MAC ROM (I2C)

์ „ ์„ธ๊ณ„์ ์œผ๋กœ ๊ณ ์œ ํ•œ ์†Œ์„ฑ(burned-in) MAC ์ฃผ์†Œ๋ฅผ ์ œ๊ณตํ•ด ์—ฌ๋Ÿฌ ํŒจ๋„์ด ๋„คํŠธ์›Œํฌ์—์„œ ์ถฉ๋Œํ•˜์ง€ ์•Š๋„๋ก ํ•จ โ€” ๋ถ€ํŒ… ์‹œ I2C๋กœ ์ฝ๋Š”๋‹ค.

๐Ÿ“š PubSubClient (MQTT)

๋ธŒ๋กœ์ปค์™€์˜ pub/sub ์„ธ์…˜์„ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒฝ๋Ÿ‰ Arduino MQTT ํด๋ผ์ด์–ธํŠธ.

๐Ÿ–ฅ๏ธ Freetronics OLED128 (์˜ต์…˜, FTOLED)

ํ—ค๋“œ๋ฆฌ์Šค ๋ฐ•์Šค๋ฅผ ์›์น˜ ์•Š์„ ๋•Œ ๊ธฐ๊ธฐ ์ž์ฒด์—์„œ ์ƒํƒœยท์ด๋ฒคํŠธ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” 128ร—128 ์ปฌ๋Ÿฌ OLED.

๐Ÿ”Œ EOL ์ €ํ•ญ ์„ผ์„œ ๋ฃจํ”„ ร—4

End-of-Line ์ €ํ•ญ์ด ๊ฐ ์„ผ์„œ๋ฅผ ๊ฐ์‹œ๋˜๋Š” ์•„๋‚ ๋กœ๊ทธ ๋ฃจํ”„๋กœ ๋ฐ”๊ฟ”, ๋‹จ์ˆœ ์—ด๋ฆผ/๋‹ซํž˜์ด ์•„๋‹ˆ๋ผ ๋ณ€์กฐ/์ ˆ๋‹จ/๋‹จ๋ฝ ๊ตฌ๋ถ„์„ ๊ฐ€๋Šฅ์ผ€ ํ•œ๋‹ค.

06 โ€” ์‘์šฉ ์‹œ๋‚˜๋ฆฌ์˜ค

01. ๋ ˆ๊ฑฐ์‹œ ์œ ์„  ์•Œ๋žŒ์„ ์Šค๋งˆํŠธํ™ˆ์œผ๋กœ ๋ฆฌํŠธ๋กœํ• ๊ธฐ์กด EOL ์ €ํ•ญ ์„ผ์„œ ๋ฐฐ์„ ์„ ๊ทธ๋Œ€๋กœ ์žฌ์‚ฌ์šฉํ•˜๋˜, ๋ชจ๋“  ์กด ๋ณ€ํ™”๋ฅผ MQTT๋กœ ๋ฐœํ–‰ํ•ด Home Assistant๋‚˜ Node-RED๊ฐ€ ์กฐ๋ช…ยท์•Œ๋ฆผยท์‚ฌ์ด๋ Œ์„ ์ž๋™ํ™”ํ•˜๊ฒŒ ํ•œ๋‹ค.

02. ๋‹ค์ค‘ ์กด ๊ฐ€์ • / ์†Œ๊ทœ๋ชจ ์‚ฌ๋ฌด์‹ค ์นจ์ž… ๊ฐ์‹œ ๋ฐ•์Šค๋‹น 4๊ฐœ ๊ฐ์‹œ ์กด์— ๋ณ€์กฐยท๋ฐฐ์„  ์ ˆ๋‹จ ๊ฐ์ง€๊นŒ์ง€ โ€” ํฐ ๋Œ€์‹œ๋ณด๋“œ๊ฐ€ ์‹ค์‹œ๊ฐ„์œผ๋กœ ์ง€์ผœ๋ณผ ์ˆ˜ ์žˆ๋Š” ์˜๋ฏธ ์žˆ๋Š” ๋ณด์•ˆ ์ปค๋ฒ„๋ฆฌ์ง€.

03. ์‚ฌ๋ณดํƒ€์ฃผ์—๋„ ๊ฒฌ๋””๋Š” ๊ฒฝ๊ณ„์„  ๊ฐ์‹œ ๋ฃจํ”„๊ฐ€ ๊ฐ์‹œ๋˜๋ฏ€๋กœ, ์ ˆ๋‹จ์ด๋‚˜ ๋‹จ๋ฝ ์ž์ฒด๊ฐ€ ์ด๋ฒคํŠธ๋‹ค. ์นจ์ž…์ž๊ฐ€ ์„ผ์„œ๋ฅผ ๋ฌด๋ ฅํ™”ํ•˜๋ฉด ์กฐ์šฉํ•œ ์‚ฌ๊ฐ์ง€๋Œ€๊ฐ€ ์•„๋‹ˆ๋ผ ๊ฒฝ๋ณด๊ฐ€ ์šธ๋ฆฐ๋‹ค.

04. ๊ฑด๋ฌผ ์ „์—ญ์˜ ๋ถ„์‚ฐ ํŒจ๋„ ๊ฐ๊ธฐ ๋‹ค๋ฅธ panelId๋ฅผ ๊ฐ€์ง„ ์—ฌ๋Ÿฌ ์œ ๋‹›์„ ๋ฐฐ์น˜ํ•ด ๋ชจ๋‘ ํ•˜๋‚˜์˜ ๋ธŒ๋กœ์ปค๋กœ ๋ฐœํ–‰ โ€” ๋ฉ”์‹œ์ง€๋ฅผ ๋ช…ํ™•ํžˆ ์œ ์ง€ํ•˜๋ฉด์„œ ํ˜„์žฅ ์ „์ฒด๋ฅผ ์‹ธ๊ฒŒ ์ปค๋ฒ„ํ•˜๋Š” ๋ฐฉ๋ฒ•.

Conclusion (๊ฒฐ๋ก )

์œ ์„  ๋„๋‚œ ์•Œ๋žŒ ๋ฃจํ”„๋Š” ๊ฐ€์ •์šฉ ํ•˜๋“œ์›จ์–ด ์ค‘์—์„œ๋„ "๋„คํŠธ์›Œํ‚น ์žฅ๋น„"์™€ ๊ฐ€์žฅ ๋ฉ€๋ฆฌ ๋–จ์–ด์ง„ ๋ฌผ๊ฑด์ด๋‹ค โ€” ๊ทธ๋Ÿฐ๋ฐ ์—ฌ๊ธฐ์„œ๋„ WIZnet W5100์ด ์กฐ์šฉํžˆ ๋ชจ๋“  ์•Œ๋žŒ ์ด๋ฒคํŠธ๋ฅผ ๋„คํŠธ์›Œํฌ๋กœ ์‹ค์–ด ๋‚˜๋ฅด๋ฉฐ, ํ์‡„๋œ ํŒจ๋„์„ ์—ด๋ฆฐ MQTT ์ŠคํŠธ๋ฆผ์œผ๋กœ ๋ฐ”๊ฟ”๋†“๋Š”๋‹ค.

  • โœ… 6๊ฐ€์ง€ ์ƒํƒœ(Normal / Tamper / Alarm / Alarm+Tamper / Short / Cut)๋ฅผ ๊ตฌ๋ถ„ํ•˜๋Š” ๊ฐ์‹œํ˜• EOL ์ €ํ•ญ ์กด 4๊ฐœ
  • โœ… TOE TCP ๋ชจ๋“œ์˜ WIZnet W5100์œผ๋กœ ์‹ ๋ขฐ์„ฑ ์žˆ๋Š” ์ƒ์‹œ ๋„คํŠธ์›Œํฌ ๋งํฌ โ€” ๊ฑฐ์˜ ์ œ๋กœ MCU ๋น„์šฉ์˜ ์˜คํ”„๋กœ๋“œ TCP
  • โœ… ๋„ค์ดํ‹ฐ๋ธŒ MQTT pub/sub(PubSubClient) โ†’ Home Assistant / Node-RED / ์–ด๋–ค MQTT ๋Œ€์‹œ๋ณด๋“œ๋“  ๊ทธ๋Œ€๋กœ ์—ฐ๊ฒฐ
  • โœ… I2C ROM์—์„œ ์ฝ๋Š” ๊ณ ์œ  MAC + DHCP/๊ณ ์ • ์œ ์—ฐ์„ฑ์˜ ์–‘์‚ฐํ˜• ์„ค๊ณ„
  • โœ… ๋ณ„๋„ ํ˜ธ์ŠคํŠธ ์—†์ด ๊ธฐ๊ธฐ ์ž์ฒด ์ปฌ๋Ÿฌ OLED ์ƒํƒœ ํ‘œ์‹œ(์˜ต์…˜)
  • โœ… ๋ฐ•์Šค๋ณ„ panelId๋กœ ๋‹ค์ค‘ ํŒจ๋„ ํ™•์žฅ ๊ฐ€๋Šฅ
  • โœ… Reach: FPGA ๋ฐฉํ™”๋ฒฝ๋ถ€ํ„ฐ End-of-Line ์•Œ๋žŒ ์ €ํ•ญ๊นŒ์ง€, WIZnet ์‹ค๋ฆฌ์ฝ˜์€ ๋ญ”๊ฐ€ IP๋กœ ์•ˆ์ •์ ์œผ๋กœ ํ†ต์‹ ํ•ด์•ผ ํ•˜๋Š” ๊ณณ์ด๋ผ๋ฉด ์–ด๋””๋“  โ€” ๊ฐ€์ •์šฉ ๋ณด์•ˆ ํŒจ๋„ ์•ˆ์—๊นŒ์ง€ โ€” ๊ณ„์† ๋“ฑ์žฅํ•œ๋‹ค.

07 โ€” WIZnet Makers ๋‚ด ์œ ์‚ฌ ํ”„๋กœ์ ํŠธ

WIZnet Makers ํ”Œ๋žซํผ์—๋Š” ์ด๋ฏธ ์œ ์„  ๋ณด์•ˆยท์„ผ์„œโ†’๋ธŒ๋กœ์ปค ๊ณ„์—ด ํ”„๋กœ์ ํŠธ๊ฐ€ ์†Œ๊ทœ๋ชจ๋กœ ๋ชจ์—ฌ ์žˆ๋‹ค. SecuritySensor4ToMQTT๋ฅผ ๊ทธ ์‚ฌ์ด์— ๋†“์œผ๋ฉด ๋ช…ํ™•ํ•œ ์ŠคํŽ™ํŠธ๋Ÿผ์ด ๋ณด์ธ๋‹ค โ€” ๋งจ๋ชธ ์„ผ์„œ ๋ฐ๋ชจ๋ถ€ํ„ฐ ์™„์ „ํ•œ "๊ฐ์‹œ + ๋ฐœํ–‰" ํŒจ๋„๊นŒ์ง€.

  • Intrusion detection system using W5100 + Arduino โ€” W5100 + Arduino ์นจ์ž… ํƒ์ง€ ๋นŒ๋“œ. ์‹ค๋ฆฌ์ฝ˜๊ณผ MCU ๊ณ„์—ด์ด ๊ฐ€์žฅ ๊ฐ€๊นŒ์šด ํ˜•์ œ. (maker.wiznet.io/WIZnet/projects/intrusion-detection-system-using-w5100-arduino/)
  • A simple burglar Alarm: motion sensor, noise sensor and ethernet shield โ€” ์ด๋”๋„ท ์‹ค๋“œ ์œ„์—์„œ ๋ชจ์…˜ยท์†Œ์Œ ์„ผ์„œ๋ฅผ ์ฝ๋Š” ๋‹ค์ค‘ ์„ผ์„œ ์•Œ๋žŒ. ์„ผ์‹ฑ ๋ฐฉ์‹์ด ๋‹ค๋ฆ„. (maker.wiznet.io/Alan/projects/a-simple-burglar-alarm...)
  • Proof of Concept Door Alarm โ€” ์ด๋”๋„ท ์‹ค๋“œ ๋„์–ด ์•Œ๋žŒ ์˜ˆ์ œ. Arduino ํ”Œ๋žซํผ์œผ๋กœ ๋ชจ๋‹ˆํ„ฐ๋ง. (maker.wiznet.io/WIZnet/projects/proof-of-concept-door-alarm/)
  • Arduino MEGA + Ethernet Shield + PIR โ€” Mega๊ธ‰ ๋ณด๋“œ๋กœ PIR ์„ผ์„œ๋ฅผ ์ฝ์–ด ํฐ/๋ฐ์Šคํฌํ†ฑ์œผ๋กœ ๋ฐ์ดํ„ฐ ๋…ธ์ถœ. (maker.wiznet.io/WIZnet/projects/arduino-mega-ethernet-shield-pir/)
  • Send data from DHT11 sensor using MQTT with Pi Pico and W5500 โ€” ํ˜„๋Œ€ํŒ MQTT ๋Œ€์‘๊ตฐ: Pico + W5500์ด ์„ผ์„œ ๋ฐ์ดํ„ฐ๋ฅผ MQTT๋กœ ํ‘ธ์‹œ. (maker.wiznet.io/wiz_chandana/projects/send-data-from-dht11-sensor-using-mqtt-with-pi-pico-and-w5500/)
ํ”„๋กœ์ ํŠธMCUWIZnet ์นฉ์„ผ์‹ฑ ๋ฐฉ์‹๋ณด๊ณ  ๋ฐฉ์‹์ฐจ๋ณ„ ํฌ์ธํŠธ
SecuritySensor4ToMQTT (๋ณธ๊ฑด)ATmega2560 (Mega)W5100EOL ์ €ํ•ญ ๋ฃจํ”„ 4๊ฐœ, 6์ƒํƒœTOE TCP ์œ„ MQTT๊ฐ์‹œํ˜•(๋ณ€์กฐ/์ ˆ๋‹จ) ์ด๋ฉด์„œ MQTT ๋ฐœํ–‰
Intrusion detection (W5100 + Arduino)ArduinoW5100์นจ์ž… ์„ผ์„œ์ด๋”๋„ท ์—ฐ๊ฒฐ๋™์ผ ์นฉ/MCU ๊ณ„์—ด; ์นจ์ž… ์ดˆ์ 
Simple burglar Alarm (Alan)Arduino์ด๋”๋„ท ์‹ค๋“œ(WIZnet)๋ชจ์…˜ + ์†Œ์Œ์ด๋”๋„ท ์‹ค๋“œ๋‹ค์ค‘ ์„ผ์„œ, ๋น„๊ฐ์‹œ ๋ฃจํ”„
Proof of Concept Door AlarmArduino์ด๋”๋„ท ์‹ค๋“œ(WIZnet)๋„์–ด ์„ผ์„œArduino ํ”Œ๋žซํผ ๋ชจ๋‹ˆํ„ฐ๋ง์ตœ์†Œ PoC ๋ฐ๋ชจ
Arduino MEGA + Ethernet + PIRATmega2560 (Mega)์ด๋”๋„ท ์‹ค๋“œ(WIZnet)PIR ๋ชจ์…˜ํฐ/๋ฐ์Šคํฌํ†ฑ ์กฐํšŒ๋™์ผ ๋ณด๋“œ๊ธ‰; ๋‹จ์ผ PIR
DHT11 โ†’ MQTT (Pico + W5500)RP2040 (Pico)W5500DHT11 ํ™˜๊ฒฝMQTTํ˜„๋Œ€ ์นฉ; ๋ณด์•ˆ ์•„๋‹Œ ํ…”๋ ˆ๋ฉ”ํŠธ๋ฆฌ

์ธ์‚ฌ์ดํŠธ: ์ด ์ƒํƒœ๊ณ„๋Š” ๋‘ ์ถ•์œผ๋กœ ํŽผ์ณ์ง„๋‹ค โ€” ์„ผ์‹ฑ์˜ ์ •๊ตํ•จ(๋“œ๋ผ์ด ์ ‘์ /PIR ๋ฐ๋ชจ vs. ๊ฐ์‹œํ˜• EOL ๋ฃจํ”„)๊ณผ ๋ณด๊ณ ์˜ ์„ฑ์ˆ™๋„(์›นํŽ˜์ด์ง€ ์กฐํšŒ vs. MQTT pub/sub). ๋ณด์•ˆ ๋„๋ฉ”์ธ ํ•ญ๋ชฉ ๋Œ€๋ถ€๋ถ„์€ ๋‘ ์ถ• ์ค‘ ํ•œ์ชฝ์˜ ๋ฐ๋ชจ ๋๋‹จ์— ๋จธ๋ฌธ๋‹ค. SecuritySensor4ToMQTT๊ฐ€ ์ฐจ๋ณ„์ ์ธ ์ด์œ ๋Š” ๋‘ ์ถ• ๋ชจ๋‘์—์„œ ๋™์‹œ์— ๋†’์€ ๊ณณ์— ์žˆ๋‹ค๋Š” ์ ์ด๋‹ค โ€” ์ง„์งœ ์•Œ๋žŒ ๋“ฑ๊ธ‰ EOL ๊ฐ์‹œ ๊ทธ๋ฆฌ๊ณ  ๊น”๋”ํ•œ MQTT ํ†ตํ•ฉ. DHT11+Pico+W5500 ํ”„๋กœ์ ํŠธ๋Š” ๊ฐ™์€ "์„ผ์„œโ†’๋ธŒ๋กœ์ปค" ํŒจํ„ด์ด ํ”Œ๋žซํผ์˜ ์‹ ํ˜• ํ•˜๋“œ์›จ์–ด๋กœ ์–ด๋””๊นŒ์ง€ ๊ฐ€๋Š”์ง€ ๋ณด์—ฌ์ฃผ์ง€๋งŒ, ๋ฐฉํ–ฅ์€ ๋ณด์•ˆ์ด ์•„๋‹ˆ๋ผ ํ™˜๊ฒฝ ํ…”๋ ˆ๋ฉ”ํŠธ๋ฆฌ๋‹ค. ์š”์ปจ๋Œ€ ์ด ํ”„๋กœ์ ํŠธ๋Š” ์ด ๋ฌถ์Œ์˜ "๋‹ค ํฐ ์–ด๋ฅธ ์•Œ๋žŒ ํŒจ๋„"์ด๋‹ค.

Q&A

Q. ์–ด๋–ค WIZnet ์†Œ์ผ“ ๋ชจ๋“œ๋ฅผ ์“ฐ๋ฉฐ, ์™œ UDP๊ฐ€ ์•„๋‹Œ๊ฐ€? A. TOE TCP(Sn_MR_TCP)๋ฅผ ์“ด๋‹ค. MQTT๋Š” ์ง€์†์  TCP ์—ฐ๊ฒฐ ์œ„์— ์˜ฌ๋ผ๊ฐ€๋ฉฐ, ํ•ญ์ƒ ์ผœ์ง„ ์•Œ๋žŒ ๋ณด๊ณ ๊ธฐ๋ผ๋ฉด TCP์˜ ๋ณด์žฅ๋œ ์ˆœ์„œ ์ „๋‹ฌ๊ณผ ์—ฐ๊ฒฐ ์ธ์ง€๊ฐ€ ํ•„์š”ํ•˜๋‹ค โ€” ์„ธ์…˜์ด ๋Š๊ธฐ๊ณ  ์žฌ์ˆ˜๋ฆฝ๋˜๋Š” ๊ฒƒ ์ž์ฒด๊ฐ€ ์ •๋ณด๋‹ค. UDP๋Š” ์ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ํ•„์š”๋กœ ํ•˜์ง€ ์•Š๋Š” ์ง€์—ฐ ์ด๋“์„ ์œ„ํ•ด ๊ทธ ์‹ ๋ขฐ์„ฑ์„ ๋‚ด๋‹ค ๋ฒ„๋ฆฌ๋Š” ์…ˆ์ด ๋œ๋‹ค.

Q. TCP ์ž‘์—…์€ W5100์ด ํ•˜๋‚˜, ATmega๊ฐ€ ํ•˜๋‚˜? A. W5100์ด ํ•œ๋‹ค. ํ•˜๋“œ์™€์ด์–ด๋“œ TCP/IP ์ฝ”์–ด๊ฐ€ ํ•ธ๋“œ์…ฐ์ดํฌยท์žฌ์ „์†กยท์ฒดํฌ์„ฌยทACK๋ฅผ ์‹ค๋ฆฌ์ฝ˜์—์„œ ์ฒ˜๋ฆฌํ•˜๊ณ , ATmega๋Š” SPI๋กœ ์†Œ์ผ“ ํŽ˜์ด๋กœ๋“œ๋งŒ ์ฝ๊ณ  ์“ด๋‹ค. ์ด ์˜คํ”„๋กœ๋“œ ๋•๋ถ„์— 8 KB SRAM MCU๊ฐ€ 4๊ฐœ ์กด ๊ฐ์‹œ ์™€ MQTT ๋งํฌ ์œ ์ง€๋ฅผ ์—ฌ์œ ๋กญ๊ฒŒ ํ•ด๋‚ธ๋‹ค.

Q. ๋ฌด์—‡์ด ์ด ์„ผ์‹ฑ์„ ๋‹จ์ˆœ ์Šค์œ„์น˜๊ฐ€ ์•„๋‹ˆ๋ผ "๊ฐ์‹œํ˜•"์œผ๋กœ ๋งŒ๋“œ๋‚˜? A. End-of-Line ์ €ํ•ญ์ด๋‹ค. ๊ฐ ๋ฃจํ”„์˜ ์•„๋‚ ๋กœ๊ทธ ๊ฐ’์„(๋‹จ์ˆœ ์—ด๋ฆผ/๋‹ซํž˜์ด ์•„๋‹ˆ๋ผ) ์ธก์ •ํ•จ์œผ๋กœ์จ, ํŽŒ์›จ์–ด๋Š” Normal, Tamper, Alarm, Short, Cut์„ ๊ตฌ๋ถ„ํ•œ๋‹ค โ€” ๋ณ€์กฐ๋‚˜ ๋ฐฐ์„  ์ ˆ๋‹จ์ด ์กฐ์šฉํžˆ ๋ˆ„๋ฝ๋˜์ง€ ์•Š๊ณ  ์ด๋ฒคํŠธ๋กœ ๋ณด๊ณ ๋œ๋‹ค.

Q. ๋” ์ตœ์‹  WIZnet ๋ถ€ํ’ˆ์œผ๋กœ ์˜ฎ๊ธธ ์ˆ˜ ์žˆ๋‚˜? A. ๊ฐœ๋…์ ์œผ๋กœ ๊ฐ€๋Šฅํ•˜๋‹ค โ€” ๋™์ผํ•œ TOE TCP / MQTT ํŒจํ„ด์ด W5100S๋‚˜ W5500์— ๊น”๋”ํžˆ ๋งคํ•‘๋œ๋‹ค(Pico + W5500 ํ˜•์ œ ํ”„๋กœ์ ํŠธ๊ฐ€ ์ด๋ฅผ ๋ณด์—ฌ์ค€๋‹ค). ์˜ค๋Š˜ ์ด๊ฑธ ๋‹ค์‹œ ๋งŒ๋“ ๋‹ค๋ฉด ์ž์—ฐ์Šค๋Ÿฌ์šด ํ˜„๋Œ€ํ™” ๊ฒฝ๋กœ๋‹ค.

Comments

Comments