How to use an Arduino temperature sensor
The current document provides some useful information about temperature sensors. With an Arduino temperature sensor, you can measure temperature of your enviroment with a fairly high accuracy. The document contains the basics of how the temperature sensor works, then you will be able to learn how you can use the temperature sensor with your Arduino and control it from your computer with Ozeki 10.
What is a temperature sensor?
Temperature sensors (Thermistors) are variable resistors that change their resistance with temperature. They are classified by the way their resistance responds to temperature changes.
How does a temperature sensor work?
In Negative Temperature Coefficient (NTC) thermistors, resistance decreases with an increase in temperature. In Positive Temperature Coefficient (PTC) thermistors, resistance increases with an increase in temperature. NTC thermistors are the most common, and that’s the type we’ll be using in this tutorial. NTC thermistors are made from a semiconducting material (such as a metal oxide or ceramic) that’s been heated and compressed to form a temperature sensitive conducting material.
The conducting material contains charge carriers that allow current to flow through it. High temperatures cause the semiconducting material to release more charge carriers. In NTC thermistors made from ferric oxide, electrons are the charge carriers. In nickel oxide NTC thermistors, the charge carriers are electron holes.
Arduino temperature sensor wiring diagram
How to use an Arduino temperature sensor in Ozeki
Measures or sets the temperature. Data can be transferred between the temperature controller device and any selected Ozeki connection. This data can be a command to the temperature controller or an event from it. For example, you can set the desired temperature with a command and after that your Ozeki 10 can get events of the current temperature and heater state. To use the Temperature sensor in Ozeki, you first need to download Ozeki Robot Developer. Ozeki Robot Developer will install the Arduino libraries needed to use this sensor efficiently.
After Ozeki Robot developer is installed, you need to upload the Temperature sensor control code to your Arduino. You can find the code and download instructions on the following pages. The upload process includes two steps: first you need to format the EEPROM of the arduino, then you need to upload the control code. The procedure is very simple, it only takes a few seconds.
Upload the Temperature sensor code to Arduino Uno
Upload the Temperature sensor code to Arduino Mega 2560
Upload the Temperature sensor code to Arduino Nano
The arduino sensors and Ozeki will communicate over the USB port using the Ozeki Temperature sensor protocol. This protocol makes it possible for you to use the sensor directly on your PC. You will be able to control this sensor through the web based user interface or you will be able to communicate with it using Ozeki Chat. You can read more about chat control on the following page.
How to communicate with the Temperature sensor using chat
It is important to understand chat control, because when you build a robot, the way you wish to control this sensor is by sending and receiving messages. If you open the Ozeki Robot Developer app, you will see, who you can write a C#.Net program to work with this sensor.
Connection steps
- Wire the Temperature sensor to the Arduino by following the wiring diagram
- Connect the Arduino board to your computer
- Check the COM portin Windows device list
- Open the Arduino application on your computer
- Upload example code to the Arduino
- Open https://localhost:9515 in your browser
- Select the connection of Temperature sensor
- Test the sensor by measuring the temperature of an object
System overview
The system we suggest consists of a temperature sensor, that is wired to the analog port of your Arduino. The Arduino will be responsible for reading data from this device in real-time. The brain of the system will be running on a PC (Figure 2). On the PC, Ozeki 10 will be able to manage the communication. You can easily run Ozeki 10 using a webbrowser
Prerequisites
- NTC Thermistor
- 10 uF capacitor and 4.7kΩ resistor
- Ozeki 10 installed on your computer
- Programmable board (Arduino Mega/Nano/Uno)
- USB cable between the board and your computer
Step 1 - Wire the temperature sensor to your Arduino
You can see how to wire the NTC Thermistor to any of the following boards:
After wiring, please plug the board to your computer!
Step 2 - Upload code to the microcontroller
Step 3 - Start Ozeki 10 to try the temperature sensor
Step 4 - Configure the temperature sensor in Ozeki 10
To be able to configure your temperature sensor (attached to your Arduino) in Ozeki 10, that is installed on your computer, you need to open the graphical user interface (GUI) of Ozeki 10. You can open the GUI by entering the URL of the computer into your webbrowser. For example, if our PC has an IP address of 192.168.1.5, we would enter http://192.168.1.5:9513 into our webbrowser.
Step 5 - Understand the temperature sensor protocol
The Temperature Controller can communicate with Ozeki through the following protocol.
References:
https://www.create.arduino.cc
https://www.circuitbasics.com
More information
- Arduino sensors and actuators
- How to use an analog sensor in arduino
- How to use a button controller in arduino
- How to use a buzzer in arduino
- How to use dc motors in arduino
- How to use a dht sensor in arduino
- How to use an EEPROM Manager in arduino
- How to use a gyroscope sensor in arduino
- How to use id manager in arduino
- How to use IR transceiver in arduino
- How to use an analog joystick in arduino
- How to use a keyboard in arduino
- How to use an LCD display in arduino
- How to use an NFC Reader in arduino
- How to use an optical gate in arduino
- How to use a register in arduino
- How to use an RF 433 MHz transceiver
- How to use an RF 2.4 GHz transceiver
- How to use an RGB LED in arduino
- How to use an RGB sensor in arduino
- How to use a rotary encoder in arduino
- How to use a servo motor in arduino
- How to use a stepper motor in arduino
- How to use a switch in arduino
- How to use a temperature sensor in arduino
- How to use a timer in arduino
- How to use an ultrasonic sensor in arduino