Streetlight Controlling Using Dragino LC01 LoRaWAN
by edwin chen in Circuits > Wireless
48 Views, 0 Favorites, 0 Comments
Streetlight Controlling Using Dragino LC01 LoRaWAN


In this project, you will learn how to wirelessly control a STREETLIGHT using LoRaWAN (Long Range Wide Area Network) technology. We demonstrate this by using the Dragino LC01 LoRaWAN relay module, which acts as a remotely controlled switch. The project walks you through the setup process, including how to connect the LC01 relay to a the streetlight, configure it to communicate over a LoRaWAN network, and send control commands through a network server (such as The Things Stack v3). By the end of this tutorial, you will be able to turn an appliance on or off remotely using a low-power, long-range wireless connection.
LC01 LoRaWAN relay
The Dragino LC01 is a LoRaWAN®-enabled relay controller designed for smart control of electrical appliances and lighting. Ideal for remote switching and status monitoring, the LC01 is built to deliver reliable performance in demanding environments.
Key Features:
- Wide Voltage Support: Compatible with appliances operating from 80–275V AC, with a maximum resistive load of 15A.
- Dual Terminal Design: Equipped with two input and two output terminals for easy power connection.
- LoRaWAN® Class C: Operates in Class C mode for low-latency communication and continuous listening.
Built-In Protection & Durability:
- Advanced Safety: Integrated protection against overcurrent, overvoltage, short circuits, and temperature rise, helping reduce the risk of damage from lightning strikes.
- Rugged Enclosure: Made from fireproof PC material with UV-resistant additives, ensuring long-term durability without discoloration.
Plug & Play Connectivity:
- Preloaded Credentials: Comes with a unique DevEUI, AppEUI, and AppKey, enabling fast and secure registration on any LoRaWAN network.
- Auto Join Capability: Automatically connects to the pre-registered network once powered on.
Longer Life with Zero-Crossing Trigger:
- The LC01 includes a patented zero-crossing trigger, which minimizes electrical stress and extends the device’s operational life.
Supplies
- Dragino LC01 LoRaWAN Relay
- 230V AC LED Streetlight
- Mains plug with a 3-core or 2-core wire
Identifying LC01's Terminals

The LC01 has four terminals. Two terminals for input and two terminals for output. These terminals accept AC voltage between 80-275:
Caution: Do not supply voltage beyond the maximum voltage range.
Terminal Description (LC01)
IN
- L – Input Live (L)
- N – Input Neutral (N)
OUT
- L – Output Live (L)
- N – Output Neutral (N)
LED Streetlight Connections

- 1 – Live (L) - brown
- 2 – Neutral (N) - blue
- 3 – Earth (E) - green/yellow mixed
Connect the Mains Plug to the LC01

Strip about 1 inch of the outer insulation from the cable. Then, strip the insulation from the blue and brown wires. The green wire is not used.
Using a Phillips head screwdriver (make sure it matches the size of the screws), loosen the two IN L and N screws by turning the screwdriver counterclockwise. Do not over-loosen the screws, as this may cause them to fall out of the terminal. As you loosen the screws, you will notice a widening gap between the plastic housing and the metal terminal.
- Connect the other end of the LIVE wire (usually brown) to the terminal IN (L). Then, using the screwdriver, tighten the screw clockwise.
- Connect the neutral wire (usually blue) to the terminal IN (N). Don’t tighten the screw yet because this terminal share the both input and output.
Connect the LED Streetlight to the LC01 Output Terminal


- Connect its live wire (usually brown) to terminal OUT (L). Then tighten the screw clockwise using the screwdriver.
- Connect its neutral wire (usually blue) to terminal 4 (Output Neutral). Now tight the screw to secure both neutral wires.
If your device has an earth/ground wire, connect it to the earth/ground wire of the plug cable. Use a connector rated for AC power to join the wire ends.
After connecting both the power code and the street light (or any other appliance), your wiring connections should look something like this (see the left image).
The following diagram shows the full wiring diagram (see the right image).
Configuring the Things Stack - 1

We use The Things Stack as the LoRaWAN Network Server to register our LC01 LoRaWAN relay. We assume there is a The Things Network community providing LoRaWAN coverage in your area. If not, you can create LoRaWAN coverage by registering one of our LoRaWAN gateways with The Things Stack.
If you haven't already, create a new account with The Things Stack (Sandbox) and log in to the console. First, we will create a new application in the Things Stack.
- On the home screen, click the + Add application button.
Configuring the Things Stack - 2

- On the Create application page, enter an Application ID to identify your application within The Things Stack and provide an Application name. Read https://thethingsindustries.com/docs/integrations/adding-applications for more information on how to do that.
- Click the Create application button.
Configuring the Things Stack - 3

- After creating the application, you will be redirected to the Application overview page.
- On the Application overview page, click the + Register end device button.
Configuring the Things Stack - 4

- We use Over The Air Activation (OTAA) to activate LC01 with The Things Stack. OTAA is the most secure way of activating an end device with a LoRaWAN network server.
- On the Register end device page, select the ‘Enter end device specifics manually’ option under the input method.
- Select the correct Frequency plan and LoRaWAN version. The Regional parameters version will appear automatically based on the LoRaWAN version.
The Frequency plan should match the frequency of the LC01.
- Make sure the Over the air activation (OTAA) is selected by default.
- Select Class C (Continuous) from the Additional LoRaWAN class capabilities dropdown list.
Configuring the Things Stack - 5

- Using the registration information sheet that comes with the LC01,
- Fill the JoinEUI. The LC01 uses AppEUI instead of JoinEUI. You can enter it in the JoinEUI text box. Then click the Confirm button.
- Enter the DevEUI and AppKey.
- Enter an End device ID that can be used to identify your LC01 within this application.
Click the Register end device button.
Configuring the Things Stack - 6

- After the end device is created, you will be redirected to the Device overview page.
Configuring the Things Stack - 7

- Click the Live data tab. You can see a few entries as shown in the image below.
Configuring the Things Stack - 8

Now plug the power cord into the wall outlet. The diamond-shaped RESET button on the LC01 will blink once. You can also see the status of the join request processing on the network server side under the Live data tab.
Testing the LC01 Relay With a Downlink Command




Now we are going to control the LED Street light from The Things Stack.
- Click the Messaging tab.
- Make sure the Schedule downlink tab is selected.
- We use FPort 1 for sending downlinks.
- Ensure Bytes is selected as the Payload type.
- To turn on the LED street light, enter the payload 06 01 (in HEX) in the payload field.
Then, click the Schedule downlink button.
- You should see the LED street light turn on within a few seconds. (Some delay is expected with LoRaWAN downlinks.)
If you are in an area with poor LoRaWAN network coverage, the network might not be able to deliver the downlink to your device.
- To turn off the LED street light, enter the payload 06 00 (in HEX) in the payload field.
- Then, click the Schedule downlink button.
- You should see the LED street light turn on within a few seconds.
Integrating With ThingsBoard / ThingsEye
The same instructions are applied to both ThingsBoard and ThingsEye.
will be added soon.
Using Payload Formatters (Optional)


LoRaWAN uplink and downlink payloads are encoded. To understand the data, you need a small script to decode them. We use a JavaScript function for this. It is called a payload formatter. It reads the payload and extracts useful information, such as relay status, event type, and timestamp. We have written a JavaScript function to decode uplinks from the LC01 device. Here is an example of a decoded payload:
Payload: 00 00 00 06 03 00
After decoding:
To add an uplink payload formatter code to The Things Stack, follow the steps below:
- Go to your LC01 device page and click Payload formatters.
- Click, Uplink.
- Select ‘Custom Javascript formatter’ from the ‘Formatter type’ drop-down list.
- Now copy the Uplink Formatter code from here: dragino-end-node-decoder/LC01/LC01_V1.0.0_TTN_Decoder.txt at main · dragino/dragino-end-node-decoder · GitHub
- Then paste it in the ‘Formatter code’ box:
You can now test the formatter code with a sample payload.
- Enter 00 00 00 06 03 00 in the ‘Byte payload’ box.
- Change the FPort to 2 (because our payload formatter only accepts uplinks from FPort 2).
- Click the ‘Test decoder’ button.
The payload will be decoded into the following JSON object and shown in the Decoded test payload box.
To save the payload formatter, click the ‘Save changes’ button.
After applying the uplink payload formatter, you can see that all uplink payloads shown in the Live Data section are decoded into fields. See the screenshot below.
Conclusion
This project demonstrates how LoRaWAN technology can be effectively used for remote control of electrical appliances, enabling long-range, low-power wireless communication. By integrating the LC01 LoRaWAN relay with an appliance and configuring it through a LoRaWAN network server, you have created a simple yet powerful IoT solution. This setup is ideal for smart home applications, industrial automation, and energy-efficient remote switching in areas with limited internet connectivity. With this foundational knowledge, you can now expand the system to control multiple devices, schedule tasks, or integrate with cloud-based dashboards for monitoring and control.