ArduSiPM DISPLAY using M5STACK

The M5Stack BASIC is a development kit based on ESP32 chip available in online shopping sites (price around 30 EU). You can even program The M5Stack BASIC through Blockly, Arduino or MicroPython. The M5Stack BASIC equips the ESP32 with a TFT Color Display 320x240 Pixel a uSD card slot etc etc...

See:

http://www.m5stack.com/

http://www.m5stack.com/assets/docs/

The M5STACK is based on ESP32 very microcontroller the evolution of the ESP8266 (the wifi coprocessor used in ArduSiPM to connect the system to wifi) . The ESP32 is powerfull (240 MHz dual processor ,wi fi, bluetooth etc) and the M5STACK include a TFT monitor (320x240 pixel) and one uSD slot. It is obvious to use M5STACK not only as ArduSiPM wifi processor but also as DATA display without using any PC.

Display ArduSiPM counts data with M5Stack

Arduino code for M5STACK:

//

// Simple program

// M5STACK as ArduSiPM Data Display

//


// DATA DISPLAY

// Count (instantaneous count from ArduSiPM acquisition window)

// counts/sec (counts accumulated in a 60 Sec window)

// CPM (Count per minute of the previous 60 seconds window)

// Rate (rate in Hz of the previous 60 seconds window)

//

//

// Author:valerio.bocci@roma1.infn.it Sep2018

//

#include <Wire.h> // Only needed for Arduino 1.6.5 and earlier

#include <M5Stack.h>

// Stringhe

char character;

String Line,countstring;

int linenr,seconds,counts,CPM;

// remember:

// Println send data to the serial port as human-readable ASCII text

//followed by a

//carriage return character (ASCII 13, or '\r')

// and

// a newline character (ASCII 10, or '\n')


void setup() {

Serial.begin(115200);

Serial.println();

Serial.println();

//

M5.begin();

M5.Lcd.setTextSize(2);


M5.Lcd.println("");

M5.Lcd.println("");

M5.Lcd.println("");

M5.Lcd.println(" waiting ArduSiPM data");

M5.Lcd.println("");

M5.Lcd.println(" PLEASE CONNECT ");

M5.Lcd.println("");

M5.Lcd.println(" RX (M5STACK) ");

M5.Lcd.println("");

M5.Lcd.println(" to TX (ArduSiPM)");

M5.Lcd.println("");

M5.Lcd.println("");

M5.Lcd.println("");

M5.Lcd.setTextSize(1);

M5.Lcd.print(" Author:");

M5.Lcd.println("valerio.bocci@roma1.infn.it");

M5.Lcd.setTextSize(2);

}



void loop() {


if (Serial.available()) {

character=Serial.read();

switch (character)

{

case '$':

Line="";

character=' ';

break;

case '\r':

character='\r';

break;

case '\n':

character='\n';

seconds=seconds+1;

counts=counts+Line.toInt();//number of counts in

countstring=String(counts);

Line="\r\n\r\nArduSiPM Data (V.Bocci):\r\n\r\nCounts:"+Line+"\r\n\r\ncounts:"+String(counts)+"/"+String(seconds)+" Sec"+"\r\n\r\nCPM:"+String(CPM)+"\r\n\r\nRate:"+String(CPM/60.)+"Hz";

M5.Lcd.clear();

M5.Lcd.setCursor(0,0);

M5.Lcd.println(Line);

linenr=linenr+1;

if (linenr>0)

{

Line="";

linenr=0;

}

if (seconds==60)

{

seconds=0;

CPM=counts;

counts=0;

}

break;


case '-':

Line="";

break;

}


Line=Line+character;

}


}

Valerio Bocci September 2018 (Valerio.Bocci(())roma1.infn.it