Search This Blog

Translate

Thursday, 24 April 2014

Arduino with a LDR - PLX-DAQ Excel spreadsheet

Arduino circuit with an LDR to get an analogue value of light, prints data to Serial Monitor                                                  and PLX-DAQ Excel spreadsheet. 
Please let me know if you experience any problems with this code. Be sure to check back for more Arduino code.

                                                                   Schematic:



                                                                         Code:


 /*  
   
 Oliver Holden  
 Created 28/10/2014  
   
 Components:  
 * Arduino UNO  
 * LDR  
 * 10K resistor  
   
 - Gets an analogue value of Light from an LDR  
   
 Prints the data to the Serial Monitor  
   
 Data is sent to an Excel spreadsheet through data   
 acquisition software, PLX-DAQ, Download http://www.parallax.com/downloads/plx-daq  
   
 Schematic for this project is on  
 http://electrical-teen.blogspot.co.uk/  
   
 */  
   
 int LDRPin= A2;   // LDR Reading Pin  
   
 int LDRReading = analogRead(LDRPin);   // Reading analogue value from LDR  
   
 int x = 0;   // For PLX-DAQ  
 int row = 0;   // For PLX-DAQ  
     
 void setup()  
 {  
   Serial.begin(9600);   // Opening serial connection at 9600bps    
  Serial.println("Light");   //Printing Serial Monitor header  
  Serial.println("LABEL, Time, LDR");   // Setting headers of colums in PLX-DAQ spreadsheet     
  Serial.println("\n-----------------");  
   
 }  
   
 void loop() {  
   
 Serial.println(LDRReading);   // Printing data to Serial Monitor   
   
 row++;   // For PLX-DAQ  
 x++;   // For PLX-DAQ  
   
 delay(1000);   // Printing data once a second  
 }  
   

Thursday, 17 April 2014

Arduino with a LDR

Arduino circuit with an LDR to get an analogue value of light, prints data to Serial Monitor. 
Please let me know if you experience any problems with this code. Be sure to check back for more Arduino code.

Schematic:


Code:

 /*  
   
 Oliver Holden  
 Created 28/10/2014  
   
 Components:  
 * Arduino UNO  
 * LDR  
 * 10K resistor  
   
 - Gets an analogue value of Light from an LDR  
   
 Prints the data to the Serial Monitor  
   
 Schematic for this project is on  
 http://electrical-teen.blogspot.co.uk/  
   
 */  
   
   
 int LDRPin= A2;   // LDR Reading Pin  
   
 int LDRReading = analogRead(LDRPin);   // Reading analogue value from LDR  
     
 void setup()  
 {  
   Serial.begin(9600);   // Opening serial connection at 9600bps    
  Serial.println("Light");   //Printing Serial Monitor header  
  Serial.println("\n-----------------");  
   
 }  
   
 void loop() {  
   
 Serial.println(LDRReading);   // Printing data to Serial Monitor   
   
 delay(1000);   // Printing data once a second  
 }  
   

Arduino with a thermistor to get temperature - PLX-DAQ Excel spreadsheet


Simple Arduino circuit to get temperature from a thermistor, prints data to Serial Monitor and PLX-DAQ Excel spreadsheet.
Please let me know if you experience any problems with this code. Be sure to check back for more Arduino code.

Schematic:


Code:

 /*  
   
 Oliver Holden  
 Created 28/10/2014  
   
 Components:  
 * Arduino UNO  
 * Thermistor  
 * 10K resistor  
   
 - Gets Temperature form a Thermistor  
   
 Prints the data to the Serial Monitor  
   
 Data is sent to an Excel spreadsheet through data   
 acquisition software, PLX-DAQ, Download http://www.parallax.com/downloads/plx-daq  
   
 Schematic for this project is on  
 http://electrical-teen.blogspot.co.uk/  
   
 */  
   
   
 int ThermistorPin = A0;   // Thermister Reading pin  
   
 int x = 0;   // For PLX-DAQ  
 int row = 0;   // For PLX-DAQ  
   
 void setup()   
 {  
 Serial.begin(9600);   // Opening serial connection at 9600bps  
 Serial.println("Thermistor temperature measurement:");   // Printing Serial Monitor header  
 Serial.println("LABEL, Time, Vo, Rt, T (C)");   // Setting headers of colums in PLX-DAQ spreadsheet  
 Serial.println("\n      Vo      Rt      T (C)");  
 }  
   
 void loop() {  
    
 int Vo;   
   
 float R = 9870.0;   // Fixed resistance in the voltage divider   
 float logRt,Rt,T;  
 float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;  
   
 Vo = analogRead(ThermistorPin);   // Reading voltage of Thermistor Reading pin  
   
 Rt = R*( 1023.0 / (float)Vo - 1.0 );  
   
 logRt = log(Rt);  
   
 T = ( 1.0 / (c1 + c2*logRt + c3*logRt*logRt*logRt ) ) - 273.15;   // Convertion to get temperature from thermistor  
   
 Serial.print("     "); Serial.print(Vo);   // Printing data to Serial Monitor  
   
   
 Serial.print("     "); Serial.print(Rt);  
   
   
 Serial.print("     "); Serial.println(T);  
   
 row++;   // For PLX-DAQ  
 x++;   // For PLX-DAQ  
   
 delay(1000);   // Printing data once per second  
 }  

Thursday, 10 April 2014

Arduino with a thermistor to get temperature


Simple Arduino circuit to get temperature from a simple thermistor, prints data to Serial Monitor. 
Please let me know if you experience any problems with this code. Be sure to check back for more Arduino code.

Schematic:



Code:


 /*  
   
 Oliver Holden  
 Created 28/10/2014  
   
 Components:  
 * Arduino UNO  
 * Thermistor  
 * 10K resistor  
   
 - Gets Temperature form a Thermistor  
   
 Prints the data to the Serial Monitor  
   
 Schematic for this project is on  
 http://teenengineer.blogspot.co.uk/  
   
 */  
   
   
 int ThermistorPin = A0;   // Thermister Reading pin  
   
 void setup()   
 {  
 Serial.begin(9600);   // Opening serial connection at 9600bps  
 Serial.println("Thermistor temperature measurement:");   // Printing Serial Monitor header  
 Serial.println("\n      Vo      Rt      T (C)");  
 }  
   
 void loop() {  
    
 int Vo;   // Integer value of voltage reading  
   
 float R = 9870.0;   // Fixed resistance in the voltage divider  
 float logRt,Rt,T;  
 float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;  
   
 Vo = analogRead(ThermistorPin);   // Reading voltage of Thermistor Reading pin      
   
 Rt = R*( 1023.0 / (float)Vo - 1.0 );  
   
 logRt = log(Rt);  
   
 T = ( 1.0 / (c1 + c2*logRt + c3*logRt*logRt*logRt ) ) - 273.15;   // Convertion to get temperature from thermistor  
   
 Serial.print("     "); Serial.print(Vo);   // Printing data to Serial Monitor  
   
   
 Serial.print("     "); Serial.print(Rt);  
   
   
 Serial.print("     "); Serial.println(T);  
   
 delay(1000);   // Printing data once per second  
 }  
   

Contact Form

Name

Email *

Message *