This post will provide a good starting point for adding an LCD display (using Arduino Uno and a typical 16x2 LCD).
I have made a minor hardware mod to the Geiger Counter board, according to Jeff. This will allow the geiger board to operate on 5 volts instead of 3 volts, which will make the serial output of the geiger board compatible with the Arduino Uno. The mod is as follow:
1. Change R6 to 1K ohm
2. Change R11 to 330 Ohms
After you make the resistor changes above the next step is wiring the Arduino to both the LCD and the geiger board.
Power & Ground
1. Connect +5v from Arduino to Geiger PCB Pulse J6 pin 1.
2. Connect GND from Arduino to Geiger PCB Pulse J6 pin 3
Serial Data
1. Connect Arduino D10 to Geiger PCB Serial J7 pin 5
LCD
See the Attached Diagram, Note you will need a 10K pot for contrast control, wire the LCD as shown in the attachement image.
Arduino Sketch for displaying CPS, CPM, uSv/hr and Mode (S=Slow,F=Fast,I=INST). Note the mode will show up on the second line of the 16x2 LCD in the last position on the right as (S,F,I).
Code: Select all
#include <SoftwareSerial.h>
#include<LiquidCrystal.h>
SoftwareSerial mySerial(10, 11); // RX, TX
LiquidCrystal LCD(9,8,5,4,3,2);
char readBuffer[64];
String readString;
int commaLocations[6];
void setup()
{
Serial.begin(9600);
mySerial.begin(9600);//Set up Software Serial Port
LCD.begin(16,2);
LCD.print("Geiger Counter");
delay(1000);
LCD.clear();
}
void loop() // run over and over
{
if (mySerial.available())
{
mySerial.readBytesUntil('\n',readBuffer,64);
readString = readBuffer;
FindCommaLocations();
PrintToLCD();
}
}
void FindCommaLocations()
{
commaLocations[0] = readString.indexOf(',');
commaLocations[1] = readString.indexOf(',',commaLocations[0] + 1);
commaLocations[2] = readString.indexOf(',',commaLocations[1] + 1);
commaLocations[3] = readString.indexOf(',',commaLocations[2] + 1);
commaLocations[4] = readString.indexOf(',',commaLocations[3] + 1);
commaLocations[5] = readString.indexOf(',',commaLocations[4] + 1);
}
void PrintToLCD()
{
String line1 = "CPS:";
line1 += readString.substring(commaLocations[0] + 1,commaLocations[1]);
line1 += " CPM:";
line1 += readString.substring(commaLocations[2] + 1, commaLocations[3]);
line1 += " ";
LCD.setCursor(0,0);
LCD.print(line1);
String line2 = "uSv/hr:";
line2 += readString.substring(commaLocations[4] + 1, commaLocations[5]);
line2 += " " + readString.substring(commaLocations[5] + 1, commaLocations[5] + 3);
LCD.setCursor(0,1);
LCD.print(line2);
}
Good Luck,
Any questions let me know,
-Tony