Posting Analog Sensor Value into a MYSQL Database with Raspberry PI
Budget: $30 – $250 USD
I have some pressure sensors that I would like to store their intermittent pressure values in a mysql database with a time stamp.
I am reading the values of pressure sensors with an arduino. It will send via serial port a value of pressure and which sensor it is to Raspberry PI that will upload the values via (php perhaps?) to a MYSQL database for logging and realtime data manipulation.
Obviously, I have the raspberry Pi and the arduino in my possession, so would need you to write and test code, and I would install them on the devices. I already have that arduino code passing pressure value as such, below:
const float offset = .47;
float v, pressure ;
void setup() {
Serial.begin(9600);
}
void loop() {
v = analogRead(0) * 5.00 / 1024 ;
pressure = 100 * ((v+.36) -.50)/(4.5-.5);
Serial.print(v);
Serial.print("\t");
Serial.println(pressure);
delay(500);
}
So the arduino will send via serial port the pressure reading to something (Raspberry PI). Raspberry PI will then handle the data and post to MYSQL database.
I would then like a simple web page on my website to showcase the pressure on a graph over time (variable user chosen timeframes) as well as showing the most recent pressure reading.
I am reading the values of pressure sensors with an arduino. It will send via serial port a value of pressure and which sensor it is to Raspberry PI that will upload the values via (php perhaps?) to a MYSQL database for logging and realtime data manipulation.
Obviously, I have the raspberry Pi and the arduino in my possession, so would need you to write and test code, and I would install them on the devices. I already have that arduino code passing pressure value as such, below:
const float offset = .47;
float v, pressure ;
void setup() {
Serial.begin(9600);
}
void loop() {
v = analogRead(0) * 5.00 / 1024 ;
pressure = 100 * ((v+.36) -.50)/(4.5-.5);
Serial.print(v);
Serial.print("\t");
Serial.println(pressure);
delay(500);
}
So the arduino will send via serial port the pressure reading to something (Raspberry PI). Raspberry PI will then handle the data and post to MYSQL database.
I would then like a simple web page on my website to showcase the pressure on a graph over time (variable user chosen timeframes) as well as showing the most recent pressure reading.