---
title: "How to integrate the Altivar atv12 inverter into the Blynk IoT"
url: "https://maker.wiznet.io/WIZnet/projects/how-to-integrate-the-altivar-atv12-inverter-into-the-blynk-iot/"
markdown_url: "https://maker.wiznet.io/WIZnet/projects/how-to-integrate-the-altivar-atv12-inverter-into-the-blynk-iot/md"
type: "UCC: User Created Content"
author: "FUAD HASAN"
author_url: "https://puaks.blogspot.com/2019/08/cara-integrasikan-inverter-altivar.html"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "FUAD HASAN"
original_url: "https://puaks.blogspot.com/2019/08/cara-integrasikan-inverter-altivar.html"
published: "2023-06-05"
language: "en"
tags: ["Internet of Things"]
hardware: ["Arduino Mega 2560", "Arduino Ethernet Shield"]
likes: 0
views: 230
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# How to integrate the Altivar atv12 inverter into the Blynk IoT

> How to integrate the Altivar atv12 inverter into the Blynk IoT

Original author: FUAD HASAN (source: https://puaks.blogspot.com/2019/08/cara-integrasikan-inverter-altivar.html)

## Components

- **Arduino Mega 2560** x 1 ([docs](https://www.farnell.com/datasheets/1674878.pdf?_ga=2.12759806.871556650.1519619484-654667508.1508905608&_gac=1.209399078.1518779130.EAIaIQobChMI97my66Sq2QIV77ftCh01kgA_EAMYASAAEgKPyvD_BwE))
- **Arduino Ethernet Shield** x 1 ([docs](https://docs.arduino.cc/retired/shields/arduino-ethernet-shield-without-poe-module))
- Software: **Arduino IDE** ([docs](https://www.arduino.cc/en/software))
- Software: **Blynk** ([docs](https://blynk.io/))

## Article

#### Overview

This project describes how to develop UART to Ethernet convertor with Altivar inverter machine and Blynk app on Arduino Mega.

#### How to develop

This tutorial will show you how to develop a UART Data Inverter with a Blynk app using an Arduino Mega. You can follow these steps to integrate a UART Data Inverter with a Blynk app:

1. UART communication with the Arduino: Set up UART communication using the hardware serial port on the Arduino Mega. You can use the SoftwareSerial library for UART communication, or you can use the default UART port. If necessary, check the pin mapping of your Arduino Mega and configure the settings for serial communication accordingly.

2. Setting up the Blynk app: Install the Blynk app and create a new project. Configure the interface by selecting and placing the widgets available in the Blynk app. Select and configure the widgets you need to interact with the UART data inverter. For example, you can use a button widget to control the state of the inverter, or a text widget to display data.

3. Use the Blynk library: Install the Blynk library in the Arduino IDE and write Blynk-related code. The Blynk library manages communication with the Blynk server, and is responsible for the widget and data processing. You use the library to implement interaction between UART communication and your Blynk app. For example, you can receive UART data from the Arduino, send it to the Blynk app, or receive commands sent from the Blynk app to the Arduino to control the UART data inverter.

4. Develop the code: Open the development environment in the Arduino IDE and write the code for communication between the UART data inverter and the Blynk app. Write code to receive and interpret the UART data, write code to handle interaction with the Blynk widget, and make sure to set the UART communication rate, data format, etc. appropriately.

5. Test and debug: Upload your code to an Arduino Mega and test it with the Blynk app. The interaction between the UART data inverter and the Blynk app should work correctly.

#### Code Ref.

Make sure to replace **"YOUR_BLYNK_AUTH_TOKEN"** with your actual Blynk authentication token. Also, adjust the RX_PIN, TX_PIN, and BAUD_RATE values according to your setup.

This code uses the SoftwareSerial library to create a software serial port for UART communication. The received UART data is processed in the **loop()** function, and you can modify it based on your specific requirements. In this example, the received data is sent to virtual pin V1 in the Blynk app using the **Blynk.virtualWrite()** function.

```c
#include <SoftwareSerial.h>
#include <BlynkSimpleSerialBLE.h>
#define RX_PIN 10
#define TX_PIN 11
#define BAUD_RATE 9600

SoftwareSerial uart(RX_PIN, TX_PIN); // Create a software serial port
char receivedData; // Variable to store received UART data
char auth[] = "YOUR_BLYNK_AUTH_TOKEN"; // Replace with your Blynk auth token

void setup()
{
 Serial.begin(9600); // Start the hardware serial port
 uart.begin(BAUD_RATE); // Start the software serial port
 Blynk.begin(auth, uart); // Initialize Blynk with the software serial port
}

void loop()
{
 Blynk.run(); // Run Blynk
 if (uart.available()) // Check if there is incoming data from UART
 {
   receivedData = uart.read(); // Read the incoming data
   
   // Process the received data as needed
   // For example, you can send the received data to a Blynk virtual pin
   Blynk.virtualWrite(V1, receivedData); // Send the data to virtual pin V1 in Blynk app
 }
}
```

---

Source: https://maker.wiznet.io/WIZnet/projects/how-to-integrate-the-altivar-atv12-inverter-into-the-blynk-iot/
