Any Ideas on how to read serial data and output to DMD

The Dot Matrix Display (DMD) is a 32x16 array of high-brightness LEDs for visually striking effects. [Product Page]
Post Reply
specialblend
Posts:2
Joined:Sun Aug 11, 2013 12:13 pm
Any Ideas on how to read serial data and output to DMD

Post by specialblend » Mon Sep 23, 2013 12:06 pm

Hi All,

I'm getting solar panels with an SMA inverter installed in my house soon and I was thinking about outputting the realtime KWh produced (or total produced for the day) to the DMD.

1) I'd have to get a rs485 to usb converter.
2) I'd have to read the incoming string and output the data (that i'm interested in) to the DMD.

Any ideas? Should I datalog the incoming string to a SD card, get the arduino to read off it and output it to the DMD? It'd be a nice project to share.

angusgr
Freetronics Staff
Freetronics Staff
Posts:853
Joined:Tue Apr 09, 2013 11:19 pm
Location:Melbourne, Australia
Contact:

Re: Any Ideas on how to read serial data and output to DMD

Post by angusgr » Mon Sep 23, 2013 10:28 pm

Hi specialblend,

Can you share any more details about the output options from the inverter?

If the inverter outputs RS485, then you can get RS485 shields such as this one which would allow you to read the data directly into your Arduino/Eleven/etc board, and then display it on the DMD.

- Angus

vishalgupta1991
Posts:9
Joined:Fri Oct 30, 2015 12:02 pm

Re: Any Ideas on how to read serial data and output to DMD

Post by vishalgupta1991 » Fri Dec 18, 2015 12:35 pm

I'm also intresting to know how to read serial data and output to DMD. Actually i'm using ESP8266-01 wifi module and arduino uno and getting url response from uart which is i want to give this output to DMD. Thanks in advance.

vishalgupta1991
Posts:9
Joined:Fri Oct 30, 2015 12:02 pm

Re: Any Ideas on how to read serial data and output to DMD

Post by vishalgupta1991 » Fri Jan 01, 2016 12:45 pm

Hi guyzz, i have made an attempt to get data from esp8266-01 module and print on dmd. But actually some data is been loss during in the process of reading from buffer and print on dmd. So can you guyzz help me what i have done wrong in my code.
Any help is much appriciated.

Code: Select all

#include <DMD.h> 
#include <SPI.h> 
#include <TimerOne.h> 
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#define DISPLAYS_ACROSS 12
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN); 


char serIn[100]; 

void ScanDMD() 
{ 
  dmd.scanDisplayBySPI();
}

void setup()
{

   Timer1.initialize( 5000 );          
   Timer1.attachInterrupt( ScanDMD );    
   dmd.clearScreen( true );   

   Serial.begin(115200);

}

void loop()
{

if(Serial.available()) {  
int chars_in = 0;  
 //  void serialFlush(){
   while (Serial.available()>0 && chars_in<99){
      serIn[chars_in] = Serial.read();      
       Serial.write( byte(serIn[chars_in]));
       chars_in++;
   }
  
   serIn[chars_in+1] = '\0';
 
}

  dmd.clearScreen( true );
  dmd.selectFont(Arial_Black_16);

     dmd.drawString(0, 0, serIn, 100, GRAPHICS_NORMAL );
     
  delay(10000);

}

User avatar
stryker
Posts:282
Joined:Sat Jan 14, 2012 2:44 pm

Re: Any Ideas on how to read serial data and output to DMD

Post by stryker » Fri Jan 01, 2016 1:42 pm

Please give some examples of what's occuring

vishalgupta1991
Posts:9
Joined:Fri Oct 30, 2015 12:02 pm

Re: Any Ideas on how to read serial data and output to DMD

Post by vishalgupta1991 » Sat Jan 02, 2016 5:05 am

When i comment the below line in the program then i got the whole string without any loss of data, but it cannot print on dmd only get it on console of arduino. And when i uncomment this line of code then it will print with loss of actual data.
So give me any suggestion what would i do for print on dmd.

Code: Select all

Timer1.attachInterrupt( ScanDMD );

The data i passed from esp8266 to uart of arduino uno is given below and it continously updated every time in the given form:
12345 UDHNA DANAPUR EXPRESS 01:00 A 02
And i getting it correctly but when i upload the program of the dmd, every time it actually loss some data like shown below:
1234 UDHPUR EXPRESS 01:00 A 5
12345 UDHNA DEXPRESS 01:00 A
12345 UDHNA DANAPURPRESS 0 A 5
Please help regarding this.Thank u for helping me out. :)

Post Reply