Hello, n00b engineering student here. I'm trying to set up a strain gauge to measure different pressures on the back side of an aluminum plate. I set up a quarter wheatstone bridge years ago for Uni but never having trouble getting this to work.
I have an Arduino Micro (better size for my project) and a 1.8" TFT screen that currently spits out the readings from two analog inputs. One is supposed to be for a thermocouple, and the other is for a strain gauge reading.
It looks like I need to get a wheatstone bridge set up with an amplifier circuit (which confuses me, because I'm an ME and took basic electricity 4 years ago) in order to use A0 to read strain. So I have a breadboard with an LM324 from radio shack and the micro, but I couldn't get any readings from my strain gauge.
This code seems to work, spitting out random numbers on screen when nothing is plugged into A0 or A1.
#include <TFT.h> // Arduino LCD library
#include <SPI.h>
// pin definition for the MICRO
#define cs 7
#define dc 0
#define rst 1
TFT TFTscreen = TFT(cs, dc, rst);
// char array to print to the screen
char strainPrint[4];
char thermoPrint[4];
void setup() {
// Put this line at the beginning of every sketch that uses the GLCD:
TFTscreen.begin();
// clear the screen with a white background
TFTscreen.background(255, 255, 255);
// write the static text to the screen
// set the header font color to black
TFTscreen.stroke(0, 0, 0);
// set the font size
TFTscreen.setTextSize(2);
// write the text to the top left corner of the screen
TFTscreen.text("Sensor Values :\n ", 0, 0);
// ste the font size very large for the loop
TFTscreen.setTextSize(4);
}
void loop() {
// Read the value of the strain sensor on A0
String strainVal = String(analogRead(A0));
// Read the value of the thermo sensor on A1
String thermoVal = String(analogRead(A1));
// convert the readings to char arrays
strainVal.toCharArray(strainPrint, 4);
thermoVal.toCharArray(thermoPrint, 4);
// set the font color for strain output to blue
TFTscreen.stroke(255, 0, 0);
// print the strain sensor value
TFTscreen.text(strainPrint, 0, 20);
// set the font color for thermo output to red
TFTscreen.stroke(0, 0, 255);
// print the thermo sensor value
TFTscreen.text(thermoPrint, 0, 60);
// wait for a moment
delay(250);
// clear screen
TFTscreen.stroke(255, 255, 255);
TFTscreen.text(strainPrint, 0, 20);
TFTscreen.text(thermoPrint, 0, 60);
}
Does anybody know how to set up a wheatstone bridge with just one strain gauge and read it into A0? Sort of stuck where we're at, no configuration we've tried gets anything but random numbers on the TFT.
Thanks!
Joe