Project in progress

# Arduino Star Trek Tricorder (BETA) © GPL3+

Working Star Trek tricorder, including a temperature sensor, and multiple other show-like scanning features.

• 2,964 views
• 6 respects

## Components and supplies

 Arduino Mega 2560
×1
 LED (generic)
×4
 Resistor 10k ohm
×5
 Buzzer
×1
 Adafruit Standard LCD - 16x2 White on Blue
×1
 Thermistor
×1

## Necessary tools and machines

 Soldering iron (generic)

I was looking at my Star Trek tricorder one day, and I thought "I wonder if I could build this using an Arduino". I searched the internet for weeks trying to find someone else who had built one, but I couldn't even find ONE Arduino tricorder!

So, I decided to venture out, and try and build one of my own.

I began by soldering the LEDs.

Once I did that, I soldered the buzzer.

Then, I built a temporary case for everything out of cardboard.

A few days later, I decided to also add in a thermister, so that I could "scan" for the temperature. Rather than soldering the thermistor, I just used a rail from a breadboard. And, I also added a "pocket" for the 9V battery.

And then, I added a front panel to make it look more user-friendly.

## Code

##### Star Trek TricorderArduino
```#include <LiquidCrystal.h>
#include <math.h>

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

int lastState = 0;

void setup() {
//Set the characters and column numbers.
lcd.begin(16, 2);
//Print default title.
clearPrintTitle();
}

double Thermister(int RawADC) {  //Function to perform the fancy math of the Steinhart-Hart equation
double Temp;
Temp = 1 / (0.001129148 + (0.000234125 + (0.0000000876741 * Temp * Temp ))* Temp );
Temp = Temp + 273.15;              // Convert Kelvin to Celsius
Temp = (Temp * 9.0)/ 5.0 + 32.0; // Celsius to Fahrenheit - comment out this line if you need Celsius
return Temp;
}

void loop() {
}

//State = 0 every loop cycle.
int state = 0;
//Refresh the button pressed.
//Set the Row 0, Col 0 position.
lcd.setCursor(0,0);

//Check analog values from LCD Keypad Shield
if (x < 100) {
//Right
} else if (x < 200) {
//Up
state = 1;
} else if (x < 400){
//Down
state = 2;
} else if (x < 600){
//Left
} else if (x < 800){
//Select
state = 3;
}

//If we are out of bounds on th menu then reset it.
}

//If we have changed Index, saves re-draws.
if (state != lastState) {
if (state == 1) {
//If Up
} else if (state == 2) {
//If Down
} else if (state == 3) {
//If Selected
}
//Save the last State to compare.
lastState = state;
}
//Small delay
delay(5);
}

//Display Menu Option based on Index.
switch (x) {
case 1:
clearPrintTitle();
lcd.print ("Bio Scan");
break;
case 2:
clearPrintTitle();
lcd.print ("Firmware Scan");
break;
case 3:
clearPrintTitle();
lcd.print ("Temperature Scan");
break;
case 4:
clearPrintTitle();
lcd.print ("Geo Scan");
break;
case 5:
clearPrintTitle();
lcd.print ("General Scan");
break;
}
}

//Print a basic header on Row 1.
void clearPrintTitle() {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Starfleet");
lcd.setCursor(0,1);
}

void scanMode() {
lcd.clear();
lcd.setCursor(0,0);
}

void ledDelay(){
const int buzzerPin1 = 26;
//led pins (in order): 22 23 24 25
digitalWrite(22, HIGH);
delay(100);
digitalWrite(22, LOW);
digitalWrite(23, HIGH);
delay(100);
digitalWrite(23, LOW);
digitalWrite(24, HIGH);
delay(100);
digitalWrite(24, LOW);
digitalWrite(25, HIGH);
delay(100);
digitalWrite(25, LOW);
digitalWrite(22, HIGH);
delay(100);
digitalWrite(22, LOW);
digitalWrite(23, HIGH);
delay(100);
digitalWrite(23, LOW);
digitalWrite(24, HIGH);
delay(100);
digitalWrite(24, LOW);
digitalWrite(25, HIGH);
delay(100);
digitalWrite(25, LOW);
tone(buzzerPin1, 700);
delay(70);
noTone(buzzerPin1);
delay(70);
tone(buzzerPin1, 700);
delay(70);
noTone(buzzerPin1);
}

void ledDelay2(){
const int buzzerPin1 = 26;
//led pins (in order): 22 23 24 25
digitalWrite(23, HIGH);
digitalWrite(24, HIGH);
delay(200);
digitalWrite(23, LOW);
digitalWrite(24, LOW);
delay(150);
digitalWrite(22, HIGH);
digitalWrite(25, HIGH);
delay(200);
digitalWrite(22, LOW);
digitalWrite(25, LOW);
delay(150);
digitalWrite(23, HIGH);
digitalWrite(24, HIGH);
delay(200);
digitalWrite(23, LOW);
digitalWrite(24, LOW);
delay(150);
digitalWrite(22, HIGH);
digitalWrite(25, HIGH);
delay(200);
digitalWrite(22, LOW);
digitalWrite(25, LOW);
tone(buzzerPin1, 700);
delay(70);
noTone(buzzerPin1);
delay(70);
tone(buzzerPin1, 700);
delay(70);
noTone(buzzerPin1);
}

//Show the selection on Screen.

int scanResults = random(6, 1000);
int a = 0;
int scanResults2 = random(0, 3);

switch (x) {
case 1:
scanMode();
lcd.print ("Bio scan ");
lcd.setCursor(0,1);
lcd.print("initiated");
ledDelay();
lcd.print(".");
ledDelay();
lcd.print(".");
ledDelay();
lcd.print(".");
ledDelay();
scanMode();
lcd.print ("Bio scan ");
lcd.setCursor(0,1);
lcd.print("completed");
ledDelay();
scanMode();
lcd.print ("Life signs: ");
lcd.setCursor(0,1);
lcd.print(scanResults);
lcd.setCursor(1,1);
lcd.print(".");
lcd.setCursor(2,1);
lcd.print(scanResults);
//Call the function that belongs to Option 1
break;
case 2:
while (a == 0){
/*scanMode();
lcd.print ("Firmware scan ");
lcd.setCursor(0,1);
lcd.print("initiated");
ledDelay2();
lcd.print(".");
ledDelay2();
lcd.print(".");
ledDelay2();
lcd.print(".");
ledDelay2();
scanMode();
lcd.print ("Firmware scan ");
lcd.setCursor(0,1);
lcd.print("completed");
ledDelay2();*/
ledDelay2();
scanMode();
lcd.setCursor(0,1);
lcd.print(scanResults);
lcd.setCursor(1,1);
lcd.print(".");
lcd.setCursor(2,1);
lcd.print(scanResults);

}
//Call the function that belongs to Option 2
break;
case 3:
while (a == 0) {
digitalWrite(22, HIGH);
delay(100);
digitalWrite(22, LOW);
digitalWrite(23, HIGH);
delay(100);
digitalWrite(23, LOW);
digitalWrite(24, HIGH);
delay(100);
digitalWrite(24, LOW);
digitalWrite(25, HIGH);
delay(100);
digitalWrite(25, LOW);
digitalWrite(22, HIGH);
delay(100);
digitalWrite(22, LOW);
digitalWrite(23, HIGH);
delay(100);
digitalWrite(23, LOW);
digitalWrite(24, HIGH);
delay(100);
digitalWrite(24, LOW);
digitalWrite(25, HIGH);
delay(100);
digitalWrite(25, LOW);
scanMode();
int val;                //Create an integer variable
double temp;            //Variable to hold a temperature value
val=analogRead(15);      //Read the analog port 0 and store the value in val
temp=Thermister(val);   //Runs the fancy math on the raw analog value
lcd.setCursor(0,0);
lcd.print("Temperature:");
lcd.setCursor(0,1);
lcd.print(temp - 900);   //Print the value to the serial port
lcd.setCursor(6,1);
lcd.print("(F)");
delay(100);
}
break;
case 4:
scanMode();
lcd.print ("Geological scan ");
lcd.setCursor(0,1);
lcd.print("initiated");
ledDelay();
lcd.print(".");
ledDelay();
lcd.print(".");
ledDelay();
lcd.print(".");
ledDelay();
scanMode();
lcd.print ("Geological scan ");
lcd.setCursor(0,1);
lcd.print("completed");
ledDelay();
scanMode();
lcd.print ("Dilithium: ");
lcd.setCursor(0,1);
lcd.print(scanResults);
lcd.setCursor(1,1);
lcd.print(".");
lcd.setCursor(2,1);
lcd.print(scanResults);

//Call the function that belongs to Option 4
break;
case 5:
scanMode();
lcd.print("Location");

//Call the function that belongs to Option 4
break;
}
}
```

• 1 project
• 1 follower

#### Published on

February 15, 2017

#### Members who respect this project

and 2 others

See similar projects
you might like

#### Laser, Robe, Star Wars?! - Versalume + Adafruit Gemma

Project tutorial by Kitty Yeung

• 3,236 views
• 11 respects

#### Android App-Based Home Automation System Using IOT

Project tutorial by Team Autoshack

• 49,267 views
• 141 respects

#### Control 8 x 8 LED Matrix with Only Two Shift Registers

Project showcase by Jegqamas

• 6,743 views
• 1 comment
• 15 respects

#### Marduino Party 1

Project tutorial by Arduino “having11” Guy

• 1,949 views
• 2 respects

#### Arduino - PV MPPT Solar Charger

Project tutorial by Abhi Verma

• 25,713 views