Click here to Skip to main content
15,888,039 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As you would have assumed, I am a beginner to VB.

My objective is to create a rudimentary program to measure the temperature when you press a button.

What steps do I need to take in order to achieve my goal?

Redirect Notice[^]

(The sensor is connected to my computer via USB not through a microcontroller. I've installed the software allowing me to view a plot of the temperature change.)
Posted
Updated 24-Aug-16 22:17pm
v3

Usually you don't (the PC doesn't) communicate directly with the temperature sensor. A microcontroller is used to get data from the sensor and then to forward the measure to the PC (using, for instance, serial communication).
Of course it all depends on the 'sensor' you are using.

[Update]
Apparently your pyrometer uses serial communication.
Hence all you need is the SerialPort Class (System.IO.Ports)[^] and a good understanding of the device protocol (the documentation looks promising: examples are provided).
[/Update]
 
Share this answer
 
v2
Comments
Member 12292743 25-Aug-16 4:15am    
I've put up a link to info about the sensor (it's a list of commands)
CPallini 25-Aug-16 4:54am    
I've updated my answer.
Member 12292743 25-Aug-16 5:34am    
Many thanks
CPallini 25-Aug-16 5:42am    
You are welcome.
First steps:
- Find the maker and sensor model.
- Ask the maker for manual, may be an SDK, and/or code samples to read temperature.
- if you don't get something usable, search for a forum of customers to get help.
 
Share this answer
 
Comments
Member 12292743 25-Aug-16 4:15am    
I've put up a link to info about the sensor (it's a list of commands)
First, a temperature sensor (typically a thermocouple) is not controlled, it's read. It's a sensor and it thus responds with a changing signal that in some way may be related back to a measurement of what it is that it responds to.

A photo-cell, for example, could respond to light intensity; a baratron, to pressure.

It is necessary to have a conversion of some sort to translate the output of the device to a numerical value. A thermocouple, for example, might have voltage that is proportional to temperature; a photocell would have current proportional to light intensity. On some modern devices, they conversion circuitry may already be built into the sensor as part of what would better be described as a sensing device.

As per previous comments/answers, however, you will need to get the manufacturer's information for how to convert, perhaps including calibration curves, methods, an SDK, code examples.

IF NOT - you'll need to measure the voltage of your sensor [an analog signal] (across a suitable resistor and connected to an A/D converter). Then, using known temperature values, build your own calibration curve so you can covert the signal from voltage to temperature.
 
Share this answer
 
Comments
Member 12292743 25-Aug-16 4:15am    
I've put up a link to info about the sensor (it's a list of commands)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900