---
title: "Arduino Uno R3 + W5100 send notification to LINE"
url: "https://maker.wiznet.io/teddy/projects/arduino-uno-r3-w5100-send-notification-to-line/"
markdown_url: "https://maker.wiznet.io/teddy/projects/arduino-uno-r3-w5100-send-notification-to-line/md"
type: "UCC: User Created Content"
author: "เจ้าของร้าน"
author_url: "https://www.ab.in.th/article/81/arduino-uno-r3-w5100-%E0%B8%AA%E0%B9%88%E0%B8%87%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%88%E0%B9%89%E0%B8%87%E0%B9%80%E0%B8%95%E0%B8%B7%E0%B8%AD%E0%B8%99%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2-line"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "เจ้าของร้าน"
original_url: "https://www.ab.in.th/article/81/arduino-uno-r3-w5100-%E0%B8%AA%E0%B9%88%E0%B8%87%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%88%E0%B9%89%E0%B8%87%E0%B9%80%E0%B8%95%E0%B8%B7%E0%B8%AD%E0%B8%99%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2-line"
published: "2022-10-25"
language: "en"
likes: 7
views: 712
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Arduino Uno R3 + W5100 send notification to LINE

> Arduino Uno R3 + W5100 send notification to LINE

Original author: เจ้าของร้าน (source: https://www.ab.in.th/article/81/arduino-uno-r3-w5100-%E0%B8%AA%E0%B9%88%E0%B8%87%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%88%E0%B9%89%E0%B8%87%E0%B9%80%E0%B8%95%E0%B8%B7%E0%B8%AD%E0%B8%99%E0%B9%80%E0%B8%82%E0%B9%89%E0%B8%B2-line)

## Article

rduino Uno R3** + W5100 send notification to LINE**

Hello, since I haven't written an article for several months. Today is a free day, Saft for Home during the Covid-19 festival, plus a brother came to consult about the old project that I used to do about sending notifications via Line using the Uno R3. The old one that had fallen after cleaning the server the previous time came back to dust again.

From what friends know that Arduino Uno R3 + Module W5100 or Module enc28j60 or Module W5500 with Arduino Uno R3 has limited space, Ram Rom resources until developing to support SSL is more difficult than Nodemcu Esp8266 Esp32, so the shop developed the system. Send notifications via Line Notify. The working principle is as shown in the picture below.

![](https://do.lnwfile.com/_/do/_raw/rr/em/8j.png)
In a simple summary, the device will contact AB-Maker's Server first, and then send Server Forword to Line Notify's server again. The information is not too big. And save resources of the Uno R3 as well, making it not fall. er, when used for a period of time

The form of sending information for the shop is using Methol Get, which is easier to develop a program than sending in Methol Post format for newbies.

Url format for service to customers of AB-maker shop for further development with other devices such as Module Sim900, Module Sim800, Module Sim808, esp8266, esp32, Nodemcu can shoot URL Methol Get as follows

> http://103.233.194.42/~line/line.php?token= (token) &mes= (message) &tel= (phone number)
>
> or
>
> http://line.ab-maker.com/line.php?token= (token) &mes= (text) &tel= (phone number)

Can be further developed with other Module devices such as Module Sim900, Sim800, Sim808, Module ethernet enc28j60, W5100, W5500 and many other devices that support Internet connection

**The equipment that will be used in today's testing is as follows:**

- Uno R3 (can use other devices, unlimited)

- Shield W5100 or you can use ENC28J60 depending on your aptitude.

- Switch for sending Logic High or Low for testing

- Other equipment such as wires, test boards, etc.

**Let's get started**

First of all, as before, we have to create a Token from Line Notify first. Today, we will not talk about how to request a Token from Line Notify. You can read it in the article. **Notification system for login to the server via Line Notify** .

**Start the first step, go to create Line Notify first.**

> <https://notify-bot.line.me/>

**go to my page**

![](https://do.lnwfile.com/_/do/_raw/xr/p3/wv.png)

**Issue Access Token (For Developer) Select Issue Token.**

![](https://do.lnwfile.com/_/do/_raw/oi/xk/ue.png)

Create your bot's name and choose a method to receive messages. You can choose to receive one-on-one notifications. or notify the desired group can be the same

![](https://do.lnwfile.com/_/do/_raw/vz/aj/kv.png)

You will get a token that you can write down or copy and use in our code.

![](https://do.lnwfile.com/_/do/_raw/fo/7g/1q.png)

**Circuit connection as follows:**

![Arduino + W5100 send notification to LINE](https://do.lnwfile.com/_/do/_raw/od/a8/v9.png)

![Arduino + W5100 send notification to LINE](https://do.lnwfile.com/_/do/_raw/xt/2q/w8.png)

**in the code section **

|  | #include &lt;SPI.h> |
| --- | --- |
|  | #include &lt;Ethernet.h> |
|  |  |
|  | const char* token = "....."; // Token ที่ได้จาก Line Notify |
|  | const char* mes = "Hello%20World"; //ข้อความที่ต้องการให้แสดง |
|  | const char* tel = "0995232344"; //เบอร์โทรศัพท์ของลูกค้า |
|  |  |
|  | const int buttonPin = 2; // Pin ของปุ่มกด |
|  | byte mac[] = { |
|  | 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED |
|  | }; |
|  |  |
|  | IPAddress ip(192, 168, 1, 177); // IP ของ Arduino |
|  | IPAddress myDns(8, 8, 8, 8); // DNS แนะนำให้ใช้ 8.8.8.8 เป็นของ Google |
|  |  |
|  | EthernetClient client; |
|  |  |
|  | //char server[] = "line.ab-maker.com"; //เชื่อมต่อแบบ DNS |
|  | IPAddress server(103,233,194,42); //เชื่อมต่อแบบ IP |
|  |  |
|  | unsigned long lastConnectionTime = 0; |
|  | const unsigned long postingInterval = 10L * 1000L; |
|  |  |
|  | void setup() { |
|  | Serial.begin(9600); |
|  | pinMode(buttonPin, INPUT); |
|  | while (!Serial) { |
|  | } |
|  | delay(3000); |
|  | Ethernet.begin(mac, ip, myDns); |
|  | Serial.print("My IP address: "); |
|  | Serial.println(Ethernet.localIP()); |
|  | } |
|  |  |
|  | void loop() { |
|  |  |
|  | if (client.available()) { |
|  | char c = client.read(); |
|  | Serial.write(c); |
|  | } |
|  |  |
|  | if (digitalRead(buttonPin) == HIGH) { //เช็คการกดปุ่ม D2 |
|  | if (millis() - lastConnectionTime > postingInterval) { |
|  | httpRequest(); |
|  | } |
|  | } else { |
|  | delay(500); |
|  | Serial.print("."); |
|  | } |
|  | } |
|  |  |
|  | void httpRequest() { |
|  | client.stop(); |
|  | if (client.connect(server, 80)) { |
|  | Serial.println("connecting..."); |
|  | client.print("GET /~line/line.php?token="); |
|  | client.print(token); |
|  | client.print("&mes="); |
|  | client.print(mes); |
|  | client.print("&tel="); |
|  | client.println(tel); |
|  | client.println(" HTTP/1.1"); |
|  | client.println("Host: www.arduino.cc"); |
|  | client.println("User-Agent: arduino-ethernet"); |
|  | client.println("Connection: close"); |
|  | client.println(); |
|  | lastConnectionTime = millis(); |
|  | } else { |
|  | Serial.println("connection failed"); |
|  | } |
|  | } |

[**view raw**](https://gist.github.com/AB-Project/34e8e6ebc0e0811d8152c3ce4dbef57b/raw/eb9e0d7ca177a925445cd99200fb8bca043cdf1f/line%20notify%20Arduino%20uno%20R3.ino)[**line notify Arduino uno R3.ino **](https://gist.github.com/AB-Project/34e8e6ebc0e0811d8152c3ce4dbef57b#file-line-notify-arduino-uno-r3-ino)hosted with ❤ by [**GitHub**](https://github.com/)

**Notice the red letters. It's something we have to fix.**

> const char* token = "..."; // Token obtained from Line Notify
> const char* mes = "Hello World"; //Text to be displayed
> const char* tel = "0995232344"; // phone number registered with the shop

---

Source: https://maker.wiznet.io/teddy/projects/arduino-uno-r3-w5100-send-notification-to-line/
