Behind today’s door is a potentiometer. You can use it to transfer analogue messages to the Blynk app. To do this, you need to build the circuit according to the picture.

Das Poti benutzt heute die untere Leitung für die Verbindung mit A0
The potentiometer uses the lower wire for the connection to A0

Things can get a bit tight when constructing with the MicroUSB cable. So that everything connects, you first have to disconnect the board from the cable and place the jumpers to be as flat as possible. You also need to be aware that this time the VCC is not applied to the track at the bottom of the image; instead, the track is intended for the connection at Pin A0.

The sketch: A16_P07_Blynk3_AnalogIn.ino
/*
Blynk3: AnalogIn

Change ssid, password and token
*/

char ssid[] = "YourSSID";
char password[] = "YourPassword";
char token[] = "YourToken";

//#define BLYNK_DEBUG
#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <ESP8266_SoftSer.h>
#include <BlynkSimpleShieldEsp8266_SoftSer.h>

// Set ESP8266 Serial object
#include <SoftwareSerial.h>
SoftwareSerial EspSerial(11, 12); // RX, TX

ESP8266 wifi(EspSerial);

void setup()
{
  // Set console baud rate
  Serial.begin(19200);
  EspSerial.begin(19200);

  Blynk.begin(token, wifi, ssid, password);
}

void loop()
{
  //Analog read and LED toogle are done here automatically by Blynk
  //No need for special programming
  
  Blynk.run();
}

(The former Arduino Create embed is no longer available; the code is taken from the download of all sketches.)

You can import the Blynk interface as usual with the QR code. You’ll find the programme above. Don’t forget to enter the new token and your WLAN data before you upload the programme to the NanoESP board.

Die heutige OberflächeThe measured data are now received approx. once a second and shown in the graph widget. You can affect the measured values by turning the potentiometer. Note that the maximum value is 1023. The reason is that the NanoESP reads the voltage with a resolution of 10 bits. These are formed from a voltage range between 0 and +5 V. The potentiometer acts as a voltage divider in this process, so that voltages between 0 and 5 V can be adjusted at the centre pin.

Today's interface