Arduino & C# – LM35 Temperature sensor C# Application arduino (OPEN SOURCE)

Hello world! Today i made a Windows C# Application to read the temperature from a LM35 Temperature sensor.
The source is open to modify and included in description.
The code is very simple and can read any sensor data written from arduino to serial, in this case Serial.println(tempC,1);
If you want to use fahrenheit just uncomment the arduino part in the code Serial.println(tempF,1); You should now see fahrenheit without doing anything in the C# App.
So, If you want to use another Arduino code that belongs to another Sensor all you need to do is print the value to serial and the app will read it. You might need to change the C# application a bit to fit the sensor data.

Files you modify in the C# source are the following. Form1.cs & Form.1Designer.cs To modify the look of the Application you simply double click on Form1.cs and the Form1.cs [Design] should pop up. You can now drag and drop buttons and whatever you want from the toolbox, and change background in the properties etc. If adding a button for example, double click the button to give it a function, Double clicking it will bring you to the part of the code that belongs to the button.

You can also change the about box by double clicking on the about box AboutBox1.cs, You can change background, font, colors etc. To change company name, version etc. you can double click Properties in the [solution explorer]. And then at [application] click on [assembly information], you can also modify AssemblyInfo.cs directly.

Below are the Schematic, arduino code, Parts list and C# source codes.

Schematic.

LM35 Temperature sensor C# Application arduino_bb
LM35 Temperature sensor C# Application arduino_bb

Just wire it up like the schematic which is very easy as you can see and upload the code.
Parts list.

 

  • Arduino uno
  • LM35 Temperature sensor.
  • Jumper wires.
  • Breadboard (optional).
  • Windows Application.
  • Visual Studio (for modifying the Application, not needed there is a pre-build application) (optional)

 

C# Source: Download here

Arduino code:

Good luck!

Buy sensors here! Arduinosensors.nl

Follow me on youtube!

facebook-profile-picture
Danny van den Brande

http://www.arduinosensors.nl

<p>I like to code electronics, do 3D Design, Webdesign and Graphic Design.</p>

3 thoughts on “Arduino & C# – LM35 Temperature sensor C# Application arduino (OPEN SOURCE)”

Leave a Reply

Your email address will not be published. Required fields are marked *