Set Temperature, Actuator Responds ā Arduino LCD Shows Live Temp & Status
In this Visuino project, you will learn how to control a linear actuator automatically based on temperature (or humidity) readings using a DHT11 sensor, an I2C LCD display, and an L298N DC Motor Driver. Set your desired temperature threshold, and the actuator will open when the temperature is higher or equal, and close when itās lower. The LCD shows the current temperature (or humidity) and clearly displays the actuator status as Open or Closed ā all without writing a single line of code!
This project is great for opening a window or door automatically based on the temperature, making it perfect for home automation, greenhouses, or any environment control application.
This tutorial is perfect for learning how to:
Read temperature and/or humidity from a DHT11 sensorControl a linear actuator using an L298N DC Motor DriverDisplay live sensor readings and actuator status on an I2C LCDCreate automated environment control projects with Visuino Visual ProgrammingBuild practical projects like vents, windows, or humidity/temperature-controlled devices
Download the Visuino project file at the bottom
Watch the Video!
Ā
Step 1: What You Will Need
Ā
Ā
Ā
Ā
Ā
Arduino UNO (Or any other Arduino)Linear ActuatorDHT11 Temperature and Humidity sensorLCD I2C Display (Optional)LN298N DC Motor DriverJumper wiresPower Supply or batteriesVisuino program: Download VisuinoĀ
Ā
Ā
Step 2: The Circuit
Ā
Connect Power supply (batteries) pin (gnd) to motor driver controler pin (gnd)Connect Power supply (batteries) pin (+) to motor driver controler pin (+)Connect Power supply (batteries) pin (+) to Arduino pin (VIN)Connect GND from Arduino to motor driver controler pin (gnd)Connect digital pin(3) from Arduino to motor driver pin (IN1)Connect digital pin(4) from Arduino to motor driver pin (IN2)Connect Linear Actuator to the motor driver as you can see on the schematic
Ā
Connect LCD Display pin [SCL] to Arduino pin [SCL]Connect LCD Display pin [SDA] to Arduino pin [SDA]Connect LCD Display pin [VCC] to Arduino pin [5v]Connect LCD Display pin [GND] to Arduino pin [GND]
Ā
Connect DHT11 sensor pin[S] to Arduino digital pin[2]Connect DHT11 sensor pin[-] to Arduino ground pin[GND]Connect DHT11 sensor pin[+] to Arduino positive pin[5V]
Ā
Step 3: Start Visuino, and Select the Arduino UNO Board Type
Ā
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 4: In Visuino Add Components
Ā
Ā
Ā
Ā
Add "Humidity and Thermometer DHT11/21/22/AM2301" componentAdd "Analog Value" componentAdd "Compare Analog Value" componentAdd "Detect Edge" componentAdd "Text Value" componentAdd "Speed and Direction To Speed" componentAdd "Dual DC Motor Driver Digital and PWM Pins Bridge (L9110S, L298N)" componentAdd "Liquid Crystal Display (LCD) - I2C" component
Ā
Step 5: In Visuino Set Components
Ā
Ā
Ā
Ā
Ā
Select "AnalogValue1" and in the properties window set "Value" to 1
Ā
Step 6: In Visuino Connect Components
Ā

Ā

Ā
Ā
Connect "HumidityThermometer1" pin[Temperature] to "Compare1" pin[In]Connect "HumidityThermometer1" pin[Temperature] to "LiquidCrystalDisplay1" > "Analog Field1" pin[In]Connect "HumidityThermometer1" pin[Sensor] to Arduino digital pin[2]Connect "AnalogValue1" pin [Out] to "SpeedAndDirectionToSpeed1" pin [Speed]Connect "Compare1" pin [Out] to "DetectEdge2" pin [In]Connect "Compare1" pin [Out] to "DetectEdge1" pin [In]Connect "Compare1" pin [Out] to "SpeedAndDirectionToSpeed1" pin [Reverse]Connect "DetectEdge1" pin [Out] to "TextValue1.Elements.Set Value1" pin [In]Connect "DetectEdge2" pin [Out] to "TextValue1.Elements.Set Value2" pin [In]Connect "SpeedAndDirectionToSpeed1" pin [Out] to "DualMotorDriver1.Motors.Item[0]" pin [In]Connect "LiquidCrystalDisplay1" pin [I2C Out] to "Arduino.I2CChannels.I2C" pin [In]Connect "DualMotorDriver1" > [Motors.Item[0].Direction] pin [Out] to "Arduino" pin Digital pin [4]Connect "DualMotorDriver1" > [Motors.Item[0].Speed] pin [Out] to "Arduino" pin Digital > Analog PWM pin [3]
Ā
Ā
Step 7: Generate, Compile, and Upload the Arduino Code
Ā
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 and the Linear Actuator will start to move according to your settings for the temperature, and the display will show the current Temperature and Actuator status.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this tutorial, you can download it here and open it in Visuino: https://www.visuino.eu






































