Monitor done the right way

Currently I am working to finish the platform’s mounting hardware. I do not have the drilling tools needed to mount the metal plate (where all the electronics are placed). I can get the job done at the school shop, but I will have to squeeze some time out for that. In the mean time I finished mounting the LCD and buttons on the monitor. Hot glue was my friend.

LCD and buttons



The buttons (three of them) used one analog pin on the arduino through the use of a simple voltage divider (three 680 Ohm resistors). I wired them on the buttons to save space. A lot of hot glue was used to hold the buttons as the enclosure was slightly curved there and the buttons could not be mounted flush.
Buttons
Buttons



Now the hardware aspect of the monitor is pretty much done! I still need to find a better way to mount the transceiver inside but the current tape setup is pretty sturdy.
Enclosure
Enclosure



Resistors have slight tolerances and will not give you perfect voltage dividers. I find it easier to just code the arduino to display the voltage readings so I know what each button of the series corresponds to what voltage. The following code does just that. Now I know that my top button is 1023, then 652, then 324. No multimeter required.


#include
const int LCDRSpin = 5; // lcd
const int LCDENpin = 7;
const int LCD11pin = 9;
const int LCD12pin = 10;
const int LCD13pin = 11;
const int LCD14pin = 12;
int sensorPin = A1; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
LiquidCrystal lcd(LCDRSpin, LCDENpin, LCD11pin, LCD12pin, LCD13pin, LCD14pin);
void setup() {
// set up the LCD’s number of columns and rows:
lcd.begin(20, 4);
// print a message to the LCD.
lcd.print(“Button Test”);
}
void loop() {
// read the value from the sensor:
sensorValue = analogRead(sensorPin);
lcd.clear();
lcd.setCursor(0, 1);
lcd.print(“R = “);
lcd.print(sensorValue);
delay(50);
}



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s