Arduino Servo Motor Thermometer Gauge (with Visuino)

This tutorial was written by Ron as a guest post – check out more of his work on the Visuino website.

In this tutorial we will learn how to Display a temperature using a servo motor as a gauge and a DHT sensor connected to the Arduino board.

Watch the Video!

Step 1: What You Will Need

Arduino DHT11 Temperature Sensor Arduino Servo Motor Arduino UNO Board Arduino Jumper Wires Servo Motor Gauge Image Visuino Program

  • DHT11 sensor or any other DHT sensor
  • Arduino UNO (or any other board)
  • Servo motor
  • Jumper wires
  • Printed Gauge image
  • Visuino program: Download Visuino

Step 2: The Circuit

Circuit-Arduino-Servo-Motor-Thermometer-Gauge


You are learning how to use Arduino to build your own projects?

Check out Arduino For Beginners and learn step by step.

Get this course for FREE for 14 days! Just click on the link above.


  • Connect Servo motor “Orange” (signal) pin to Arduino Digital pin[3]
  • Connect Servo motor “Red” pin to Arduino positive pin[5V]
  • Connect Servo motor “Brown” pin to Arduino negative pin[GND]
  • Connect DHT11 positive pin + (VCC) to Arduino pin +5V
  • Connect DHT11 negative pin – (GND) to Arduino pin GND
  • Connect DHT11 pin (Out) to Arduino digital pin (2)

Step 3: Making of the Servo Motor Gauge

servo-temperature-gauge

  1. Print the attached Gauge picture.
  2. Attach the picture with some glue to the servo motor, to make it stronger you can use some small carton board at the back.

Step 4: Download Visuino Software

How to Download Visuino

Visuino is a Visual programming tool for Arduino and other boards.

You can easily make a project by simply Drag & Drop components and connecting them.

Go to https://www.visuino.eu and Download Free version or register for a Free Trial.

Step 5: Start Visuino, and Select the Arduino UNO Board Type

Visuino How to select a board Visuino board selection

Start Visuino as shown in the first picture. Click on the “Tools” button on the Arduino component (Picture 1) in Visuino. When the dialog appears, select “Arduino UNO” as shown on Picture 2.

Step 6: In Visuino Add, Set & Connect Components

Visuino add DHT11 sensorVisuino select DHT Type sensorVisuino Subtract from analog value component  Visuino Add Map Range Analog Component Visuino Add Servo Component

  • Add “DHT11” component
  • Add “Map Range Analog” component
  • Add “Subtract From Analog Value” component
  • Add “Servo” component

If you select HumidityThermometer1″ component you can select different DHT type sensors in the properties window (see the picture).

“Subtract From Analog Value” component will be used to reverse the direction of the servo rotating, so instead of rotating it from right to left we want to rotate it from left to right like a real gauge meter.

“Map Range Analog” component is used where we want to convert one range of values to another range of values, in our example we get temp values from the DHT11 sensor that can be from -30 to +60 but the servo motor input value can only be between 0 and 1 like (0.1 , 0.345, etc), so the “Map Range Analog” component will adjust this values for us.

  • Select “MapRange1” and in the properties window set “Input Range” Max to 40 and Min to 0

This means that we want to display a temperature between 0 and 40 C.

 

Visuino diagram How to Connect Components

  • Connect “HumidityThermometer1” pin [Sensor] to Arduino board digital pin[2]
  • Connect “HumidityThermometer1” pin [Temperature] to “MapRange1″pin[In]
  • Connect “MapRange1” pin [Out] to “SubtractFromValue1” pin [In]
  • Connect “SubtractFromValue1” pin [Out] to “Servo1” pin[In]
  • Connect “Servo1” pin [Out] to Arduino board digital pin [3]

Step 7: Generate, Compile, and Upload the Arduino Code

Visuino Compile & Upload the Project

In Visuino, at the bottom click on the “Build” Tab, make sure the correct port is selected, then click on the “Compile/Build and Upload” button.

Step 8: Play

If you power the Arduino module, The servo motor will rotate according to the temperature.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it and open it in Visuino: https://www.visuino.eu

Download Visuino File here: servo-temp

Did you find this tutorial useful?

Do you want to learn Arduino from scratch?

If yes, this course is for you:

Arduino For Beginners - Complete Course

>> Arduino Programming For Beginners <<

FREE for 14 days!

LEARN HOW TO PROGRAM ROBOTS

Did you find this tutorial useful?

Do you want to become better at programming robots, with Arduino, Raspberry Pi, or ROS2?

If yes, subscribe to receive exclusive content and special offers!