So, I've been attempting to hook up an old BGMicro/IEE 2x20 VFD (of case modding infamy from the early 2000's) to my ESP8266, running some tests with Blynk and a DH11 temperature sensor. Everything seems to work at first, but as I manually refresh the display (using a Blynk button that clears the display and prints the values) I find missing characters and random characters in the displayed data. If I press the button enough times, the display just freezes up - which leads me to believe a control code value was sent somehow.
The VFD is connected via serial, running through a MAX232, and - I'm wondering if this is the problem - I'm drawing 5v off of the Vin pin, using a 2A USB charger to power the entire setup. The datasheet for the VFD is online at: http://www.bgmicro.com/pdf/acs1375.pdf
My code looks basically like this:
#include <SoftwareSerial.h>
#define VFDtx 4 // What digital pin the VFD is connected to (serial out)
#define VFDrx 3 // What digital pin the VFD is connected to (serial in)
#define VFDctrl 12 // What digital pin the VFD is connected to (Control Pin)
SoftwareSerial VFDSerial = SoftwareSerial(VFDrx, VFDtx);
void setup()
{
VFDSerial.begin(9600);
VFDSerial.write(0x0E); // Turn off cursor
VFDSerial.write(0x15); // Clear & Home cursor
VFDSerial.write(0x11); // Vertical scroll mode
VFDSerial.println("VFD Initialized!");
}
//Runs on Blynk button press
BLYNK_WRITE(V2)
{
VFDSerial.write(0x15); //Clear & Home cursor
VFDSerial.print("Humidity: ");
VFDSerial.println(h);
VFDSerial.print("Temperature: ");
VFDSerial.print(t);
VFDSerial.flush();
}
Any thoughts would be greatly appreciated!