---
title: "Visuino: Use the Adafruit IO MQTT to remotely access and control Controllino MEGA PLC"
url: "https://maker.wiznet.io/irina/projects/visuino-use-the-adafruit-io-mqtt-to-remotely-access-and-control-controllino-mega-plc/"
markdown_url: "https://maker.wiznet.io/irina/projects/visuino-use-the-adafruit-io-mqtt-to-remotely-access-and-control-controllino-mega-plc/md"
type: "UCC: User Created Content"
author: "Boian Mitov"
author_url: "https://www.instructables.com/Visuino-Use-the-Adafruit-IO-MQTT-to-Remotely-Acces/"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Boian Mitov"
original_url: "https://www.instructables.com/Visuino-Use-the-Adafruit-IO-MQTT-to-Remotely-Acces/"
published: "2025-11-28"
language: "en"
likes: 0
views: 1260
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Visuino: Use the Adafruit IO MQTT to remotely access and control Controllino MEGA PLC

> Controllino is an industry-ready Arduino PLC supported by Visuino. With MQTT via Adafruit IO, you can quickly build and deploy powerful automation projects.

Original author: Boian Mitov (source: https://www.instructables.com/Visuino-Use-the-Adafruit-IO-MQTT-to-Remotely-Acces/)

## Article

## Author

![](https://maker.wiznet.io/upload/ckeditor5/1071063041%5F1764322875%2Epng)

---

## Project Overview

![](https://maker.wiznet.io/upload/ckeditor5/1071063041%5F1764323557%2Epng)

This UCC introduces the Controllino PLC—an industry-ready, open-source Arduino-based controller available in MINI, MAXI, and MEGA versions. Unlike typical Arduino boards, Controllino provides certified, robust features such as built-in RTC, relay outputs, RS485, and Ethernet, making it a practical low-cost PLC solution for industrial use.

Visuino fully supports Controllino, and the combination of industrial-grade hardware with visual programming enables rapid development of complex automation projects. After adding MQTT support to Visuino, the author created a tutorial using Controllino and Adafruit IO as the MQTT server. Users must create an Adafruit IO account and set up two MQTT feeds—“onoff” and “photocell.” The only recommended change is to set the “photocell” feed’s maximum value to 100 instead of 1024.

---

## Project Description

## Step 1: Components

1. One **Controllino MEGA** PLC

2. One **Photoresistor** Sensor module I got from this cheap 37 sensors set

3. **3 Female-Female** jumper wires

![Step 1: Components](https://www.visuino.com/wp-content/uploads/2025/07/FQE9FQUISXQVIV1.jpg)

## Step 2: Connect the Photoresistor Sensor to Controllino MEGA

1. Connect **Ground**(**Black wire**), **Power**(**Red wire**), and **Signal**(**Gray wire**) to the **Photoresistor Module**

2. Connect the other end of the **Power wire**(**Red wire**) to the **5V **power pin of the **Controllino MEGA **

3. Connect the other end of the **Ground wire**(**Black wire**) to the **Ground **pin of the **Controllino MEGA**

4. Connect the other end of the **Signal wire**(**Gray wire**) to the **Analog pin 0** of the **Controllino MEGA **

5. You can see the **Controllino MEGA** Pinout here – http://controllino.biz/wp-content/uploads/2016/02/CONTROLLINO-MEGA-PINOUT-09-02-16.pdf

| ![Step 2: Connect the Photoresistor Sensor to Controllino MEGA](https://www.visuino.com/wp-content/uploads/2025/07/FT9UBCJISXQVIWB.jpg) | ![Step 2: Connect the Photoresistor Sensor to Controllino MEGA](https://www.visuino.com/wp-content/uploads/2025/07/FT9G1BXISXQVJ0J.jpg) |
| --- | --- |
| ![Step 2: Connect the Photoresistor Sensor to Controllino MEGA](https://www.visuino.com/wp-content/uploads/2025/07/FAEQ55ZISXQVJ3K.jpg) | ![Step 2: Connect the Photoresistor Sensor to Controllino MEGA](https://www.visuino.com/wp-content/uploads/2025/07/F4JLLKNISXQVJ5O.jpg) |
| ![Step 2: Connect the Photoresistor Sensor to Controllino MEGA](https://www.visuino.com/wp-content/uploads/2025/07/F7YRFO9ISXQVJ7S.jpg) |  |

## Step 3: Start Visuino, and Select the Arduino Board Type

The **Visuino** also needs to be installed.

1. Start **Visuino** as shown in the first picture

2. Click on the “**Tools**” button on the **Arduino** component (**Picture 1**) in **Visuino**

3. When the dialog appears, select **Controllino MEGA** as shown in **Picture 2**

![Step 3: Start Visuino, and Select the Arduino Board Type](https://www.visuino.com/wp-content/uploads/2025/07/FR6O503IRGZXPWA.png)
![Step 3: Start Visuino, and Select the Arduino Board Type](https://www.visuino.com/wp-content/uploads/2025/07/FH1BPGMISXQVDMI.png)

## Step 4: In Visuino: Configure the Ethernet, and Add Client Socket for the MQTT

First we need to assign MAC address to the Ethernet controller, and add a TCP/IP Client socket so we can connect to the Adafruit IO trough MQTT:

1. In the Object Inspector expand the “**Modules**” property, then its “**Ethernet**” sub-property, and set the value of the “**Mac Address**” sub-property to some MAC address. I used “**DE-AD-BE-EF-FE-ED**“, but you should probably use a MAC generator.

2. In the Object Inspector, click on the “**…**” button next to the value of the “**Sockets**” sub property of the “**Ethernet**” property (**Picture 2**)

3. In the Sockets editor select “**TCP/IP Client**”, and then click on the “**+**” button (**Picture 2**) to add one (**Picture 3**)

4. In the Object Inspector set the value of the “**Host**” property to “**io.adafruit.com**” (**Picture 4**)

5. In the Object Inspector set the value of the “**Port**” property to “**1883**” (**Picture 4**)

6. Close the “**Sockets**” dialog

![Step 4: In Visuino: Configure the Ethernet, and Add Client Socket for the MQTT](https://www.visuino.com/wp-content/uploads/2025/07/FYO7IG6ISXQVDWW.png)
![Step 4: In Visuino: Configure the Ethernet, and Add Client Socket for the MQTT](https://www.visuino.com/wp-content/uploads/2025/07/FCONBG5ISXQVDX0.png)
![Step 4: In Visuino: Configure the Ethernet, and Add Client Socket for the MQTT](https://www.visuino.com/wp-content/uploads/2025/07/FCJBD20ISXQVDX3.png)
![Step 4: In Visuino: Configure the Ethernet, and Add Client Socket for the MQTT](https://www.visuino.com/wp-content/uploads/2025/07/F303LTMISXQVDX6.png)
![Step 4: In Visuino: Configure the Ethernet, and Add Client Socket for the MQTT](https://www.visuino.com/wp-content/uploads/2025/07/FI0DZ9HISXQVDX9.png)

## Step 5: In Visuino: Add and Connect MQTT Client Component

Next we need to add and connect MQTT component:

1. Type “**mqtt**” in the Filter box of the Component Toolbox then select the “**MQTT Client**” component (**Picture 1**), and drop it in the design area

2. Connect the “**Out**” output pin of the “**Modules.Ethernet.Sockets.TCP Client1**” element of the “**Controllino MEGA**” component to the “**In**” input pin of the **MQTTClient1 **component (**Picture 2**)

3. Connect the “**Out**” output pin of the **MQTTClient1 **component to the “**In**” input pin of the “**Modules.Ethernet.Sockets.TCP Client1**” element of the “**Controllino MEGA**” component (**Picture 3**)

4. Connect the “**Connected**” output pin of the “**Modules.Ethernet.Sockets.TCP Client1**” element of the “**Controllino MEGA**” component to the “**Connected**” input pin of the **MQTTClient1 **component (**Picture 2**)

5. Connect the “**Disconnect**” output pin of the **MQTTClient1 **component to the “**Disconnect**” input pin of the “**Modules.Ethernet.Sockets.TCP Client1**” element of the “**Controllino MEGA**” component (**Picture 3**)

![Step 5: In Visuino: Add and Connect MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FGR3JSNISXQVDXV.png)
![Step 5: In Visuino: Add and Connect MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FD9WXJNISXQVESC.png)
![Step 5: In Visuino: Add and Connect MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FK16JFNISXQVDY8.png)
![Step 5: In Visuino: Add and Connect MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FILTBDEISXQVDZ5.png)
![Step 5: In Visuino: Add and Connect MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FW91H5YISXQVDWH.png)

## Step 6: In Visuino: Configure the MQTT Client Component to Connect to Your Adafruit.IO Account

We need to specify the User Name and Password(Key) for the MQTT. We will copy them from the Adafruit IO account, so the Controllino can connect to it:

1. Follow the instructions at “**Where to find your adafruit.io key**” from **this Adafruit tutorial** to find your **Adafruit.IO Key**, and **copy** it (**Picture 1**)

2. In the Object Inspector **paste** the **Key** as a value of the “**Password**” property (**Picture 2**)

3. In the object inspector set the value of the “**User Name**” property to your **Adafruit User Name** (**Picture 3**)

![Step 6: In Visuino: Configure the MQTT Client Component to Connect to Your Adafruit.IO Account](https://www.visuino.com/wp-content/uploads/2025/07/FNA7Y5UISYZYLS3.png)
![Step 6: In Visuino: Configure the MQTT Client Component to Connect to Your Adafruit.IO Account](https://www.visuino.com/wp-content/uploads/2025/07/FSBHW45ISY3QJ8N.png)
![Step 6: In Visuino: Configure the MQTT Client Component to Connect to Your Adafruit.IO Account](https://www.visuino.com/wp-content/uploads/2025/07/FAGELL3ISY3QJBJ.png)

## Step 7: In Visuino: Add and Configure 2 Text Topics to the The MQTT Client Component

Next we need to add 2 Topics to the MQTT Client for the **2 Adafruit.IO feeds** – **photocell** and **onoff**:

1. Click on the “**Tools**” button of the **MQTTClient1**component

2. In the “**Topics**” editor select the “**Text**” element, and then click **2 times** on the “**+**” button on the left (**Picture 2**) to add **2 Text Topics**

3. Select the first Topic element

4. In the Object Inspector for the value of the “**Topic**” property, enter your **Adafruit User Name**, followed by the “**/feeds/onoff**”

5. Select the second Topic element

6. In the Object Inspector for the value of the “**Topic**” property, enter your **Adafruit User Name**, followed by the “**/feeds/photocell**”

7. Close the “**Characteristics**” editor

![Step 7: In Visuino: Add and Configure 2 Text Topics to the The MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FAKHQ2QISY3QJPP.png)
![Step 7: In Visuino: Add and Configure 2 Text Topics to the The MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FV8SBN1ISXQVEZZ.png)
![Step 7: In Visuino: Add and Configure 2 Text Topics to the The MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/F53BBL9ISY3QK51.png)
![Step 7: In Visuino: Add and Configure 2 Text Topics to the The MQTT Client Component](https://www.visuino.com/wp-content/uploads/2025/07/FKXQ6SLISY3QK41.png)

## Step 8: In Visuino: Add and Connect Compare Text Value Component

The Adafruit IO MQTT sends “ON” and “OFF” strings through the “onoff” feed. We need to convert it to digital signal. To do this we will use a “Compare Text Value” component to compare the text with “ON”:

1. Type “**compare**” in the Filter box of the Component Toolbox then select the “**Compare Text Value**” component (**Picture 1**), and drop it in the design area

2. In the Object Inspector, set the value of the “**Value**” property of the **CompareTextValue1 **component to “**ON**”

3. Connect the “**Out**” pin of the “**Topics.Text Topic1**” element of the **MQTTClient1** (**Picture 3**) to the “**In**” pin of the **CompareTextValue1 **

4. Connect the “**Out**” output pin of the **CompareTextValue1 **to the “**Digital**” input pin of the “**Digital[ 2 ]**” channel of the **Controllino MEGA **component

![Step 8: In Visuino: Add and Connect Compare Text Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FP6NKGRISXQVF8N.png)
![Step 8: In Visuino: Add and Connect Compare Text Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FCCX5WFISXQVF8Q.png)
![Step 8: In Visuino: Add and Connect Compare Text Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FNPVXT7ISXQVF94.png)
![Step 8: In Visuino: Add and Connect Compare Text Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FXD55S8ISXQVF97.png)
![Step 8: In Visuino: Add and Connect Compare Text Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FM0JF0KISXQVF8A.png)

## Step 9: In Visuino: Add and Connect Analog Snapshot, and Clock Generator Components

We don’t want to send data through MQTT all the time. This can overwhelm the network. Instead we will take a snapshot of the data once a second, with an “Analog Snapshot” component:

1. Type “**snapshot**” in the Filter box of the Component Toolbox then select the “**Analog Snapshot**” component (**Picture 1**), and drop it in the design area

2. Connect the “**Out**” output pin of the **AnalogSnapshot1** component to the “**In**” input pin of the “**Topics.Text Topic2**” element of the **MQTTClient1** component (**Picture 2**)

3. Type “**clock**” in the Filter box of the Component Toolbox then select the “**Clock Generator**” component (**Picture 3**), and drop it in the design area

4. Connect the “**Out**” output pin of the **ClockGenerator1** component to the “**Snapshot**” input pin of the **AnalogSnapshot1** component (**Picture 4**)

![Step 9: In Visuino: Add and Connect Analog Snapshot, and Clock Generator Components](https://www.visuino.com/wp-content/uploads/2025/07/F2C3EKIISXQVFO1.png)
![Step 9: In Visuino: Add and Connect Analog Snapshot, and Clock Generator Components](https://www.visuino.com/wp-content/uploads/2025/07/FOBNU2PISXQVFOX.png)
![Step 9: In Visuino: Add and Connect Analog Snapshot, and Clock Generator Components](https://www.visuino.com/wp-content/uploads/2025/07/FPXLM11ISXQVFNN.png)
![Step 9: In Visuino: Add and Connect Analog Snapshot, and Clock Generator Components](https://www.visuino.com/wp-content/uploads/2025/07/FP1Y3RXISXQVFO0.png)

## Step 10: In Visuino: Add, Connect and Configure Multiply by Value Component

The Analog 0 channel provides data between 0.0 and 1.0. It is better to convert it to values between 0 and 100 for the Adafruit.IO, so we will multiply it by 100:

1. Type “**multip**” in the Filter box of the Component Toolbox then select the “**Multiply By Value**” component (**Picture 1**), and drop it in the design area

2. In the Object Inspector, set the value of the “**Value**” property to “**100**” (**Picture 2**)

3. Connect the “**Out**” output pin of the **MutiplyByValue1** component to the “**In**” input pin of the **AnalogSnapshot1** component (**Picture 3**)

4. Connect the “**In**” input pin of the **MutiplyByValue1** component (**Picture 4**) to the “**Out**” output pin of the “**Analog[ 0 ]**” channel of the **Controllino MEGA** component (**Picture 5**)

![Step 10: In Visuino: Add, Connect and Configure Multiply by Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FLN00XUISXQVG53.png)
![Step 10: In Visuino: Add, Connect and Configure Multiply by Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FYLB6TYISXQVG50.png)
![Step 10: In Visuino: Add, Connect and Configure Multiply by Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FT9VYQWISXQVG57.png)
![Step 10: In Visuino: Add, Connect and Configure Multiply by Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FVOY420ISXQVG5B.png)
![Step 10: In Visuino: Add, Connect and Configure Multiply by Value Component](https://www.visuino.com/wp-content/uploads/2025/07/FH8UIA8ISXQVG5P.png)

## Step 11: Generate, Compile, and Upload the Arduino Code

In Visuino, at the bottom click on the “**Build**” Tab, make sure the correct port is selected, then click on the “Compile/Build and Upload” button.

![Step 6: Generate, Compile, and Upload the Arduino Code](https://www.visuino.com/wp-content/uploads/2025/07/arduino-img_684d2c187de35.jpg)

## Step 12: And Play…

**Congratulations!** You have completed the project.

From a computer or a mobile device start a web browser, login to your **Adafruit IO** account, and then navigate to open the stream that you have created following **this Adafruit IO tutorial** (**Picture 1**)

On the **Video** you can see the **Controllino MEGA**‘s **LED** being controlled, and the value of the **Photoresistor** displayed through a web browser on a **PC** and **Android Tablet**..

As shown in the **Video**, you can control the **LED** on the **Digital 2** pin with the **On/Off Switch**, and monitor the values from the **Photoresistor** on the **Gauge**.

On **Picture 2** you can see the connected **Controllino MEGA** controlled by an **Android Tablet**.

On **Picture 3 **you can see the complete **Visuino** diagram.

Also attached is the **Visuino** project, that I created for this Tutorial. You can download and open it in **Visuino**.

![Step 12: And Play...](https://www.visuino.com/wp-content/uploads/2025/07/FTZCOWEISXQVDRG.png)
![Step 12: And Play...](https://www.visuino.com/wp-content/uploads/2025/07/FXNHYCEISXQVHTL.jpg)
![Step 12: And Play...](https://www.visuino.com/wp-content/uploads/2025/07/FTQ34CLISXQVDTH.png)
**Download Visuino File: **[**ControllinoMEGA_Adafruit_IO_MQTT_Tutorial.zip**](https://content.instructables.com/FR3/L7UN/ISZ67PAT/FR3L7UNISZ67PAT.zip)

[Embedded media](https://www.youtube.com/embed/jTy2lBjhJds)

Visuino: <https://maker.wiznet.io/irina/resellers/visuino/>

---

Source: https://maker.wiznet.io/irina/projects/visuino-use-the-adafruit-io-mqtt-to-remotely-access-and-control-controllino-mega-plc/
