Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

SSR(Solid State Relay) Interfacing with Arduino: Auto AC(Air Conditioner) ON/OFF Switch

By EG Projects June 27, 2019

This tutorial is about interfacing SSR(Solid State Relay) with arduino uno. An auto air conditioner on off switch is made as a diy project. Lets start with with what is SSR? SSR stands for Solid State Relay. Now whats the difference between normal relay and ssr? Normal relays are mechanical relays where as ssr is not mechanical. SSR uses opto-isolator mechanism to switch high power loads. Like mechanical relays the ssr provides electrical isolation between two circuits and opto-isolator(optocoupler) acts like a switch between two circuits. SSR have some advantages over mechanical relays. They can be switched on with much lower dc voltage and current. SSR can be switched on with minimum 3 volts dc. SSR can control much high power loads than mechanical relays. Switching speed of ssr is much greater than mechanical. Since their is no mechanical part in ssr so they produce no sound during switching.  
SSR are offered by many companies. Some top companies are Broadcom, Crydom, IXYS, Omron, Panasonic, Phoenix Contact, Scneider Electric, TE Connectivity, Teledyne, Vishay. I am going to use Crydomssr in the project below.  

AC auto ON/OFF on Temperature

I am going to measure the temperature of the room and depending on temperature i will make the switch the AC on or off. DHT22 1-wire temperature sensor is interfaced with the arduino to measure the temperature of the room. 

DHT22 Temperature Sensor

The DHT22 is a basic, low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air. It outputs a digital signal on the data pin. Its simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it after every 2 seconds. DHT22 is an up gradation to DHT11. DHT22 is bigger temperature and humidity range also its more precise than dht11.

Solid state relay with arduino – Project Circuit Diagram

Project circuit is simple connect the DHT22 digital pin with the digital Pin#2 of arduino. Between the dht22 vcc and data pin insert a 10k pull up resistor. Ground the gnd pin of dht22. I powered the dht22 with the arduino +5 volt output. For SSR(Solid State Relay) i used the digital Pin#7. Connect the input +positive end of ssr directly to Pin#7 of arduino. Make the other pin ground. Insert a 10k pull dpwn resistor between the inputs of SSR. This resistor will tighten the ssr pinnot to float. On the other ends of the ssr connect the mains line of electricity. 
Circuit diagram of the project is given on the right hand side. Arduino is powered through an external +12 volt power supply. 
Crydom SSR(Solid state relay) interfacing with arduino and dht22 temperature sensor

Crydom SSR(Solid state relay) interfacing with arduino and dht22 temperature sensor

SSR with microcontroller and transistor

SSR with microcontroller and transistor

The upper configuration worked for me. Running the ssr directly from digital pins of arduino. The crydom ssr given in the above pic that i used requires 3 to 32 volts dc to switch on the other circuit. At output side you can connect a maximum load of 240 volts ac and up to 40 amperes of current. Crydom ssr’s are nice and i used them in many of mine projects. I even purchased the used SSR’s from eBay and used them in my projects and i never received any complainants. 
Some people said that this configuration did not worked for them I think it might be due to the input dc voltage required. May be the SSR’s they are using require more voltage and current at input side. So i recommend to used a transistor to switch on the ssr, instead of directly switching on the ssr with microcontroller gpio(General Purpose Input/Output) pin. The transistor configuration is gien on the left hand side. An NPN transistor is used to switch on the ssr with +12 volts. 
The base of the transistor is controlled by the microcontroller. I recommend to use this configuration as it ensures that voltage will not drop below 3 volts.Their are also other alternatives to SSR and we can control high power loads with them. I wrote a good tutorial on it.​  

Control Heavy Loads with Microcontrollers

Coming to the code portion. I first included the dht temperature sensor library in the code. The library is valid for DHT11, DHT21 and DHT22 temperature sensor means we can use the three sensors with the same library. I am using DHT22 so i passed the DHT22 as reference to DHT class. Than i declared the ssr controlling pin arduino Pin#7 as output and begin the dht sensor reading.

Note: If you do not have DHT22 with you. You can connect any DHT11 or DHT21 sensor with the same configuration for DHT22. Just replace the DHT22 with DHT11 or DHT21.

I am using DHT22 as only a centigrade/Celsius temperature though it can also output Fahrenheit temperature. I am also not using its humidity value. I am switching the ac on off on the centigrade temperature. If the temperature is less than 22 degree centigrade the ssr remains off. It the temperature increases from 22 degree centigrade the ac automatically switches on. Between each reading i also inserted the 2 seconds delay to ensure that the DHT22 sensor has updated his reading and its not the same as previous one.   
I controlled my home ac with the same configuration given above. The only problem that i faced is that the ssr gets too hot when the temperature increases 30 degree centigrade. So i installed a nice big heat sink with the ssr. It still heat up when the temperature goes above 33 but not as much hot as it was heating before heat sink installation.

Download the project code. Folder contains arduino .ino project file. Please give us your feed back on the project. If you have any queries please write them below in the comments section.

Project Folder/Code


Filed Under: Arduino Projects, Microcontroller Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • MCU identification?
  • GanFet power switch starts burning after 20 sec
  • problem identifying pin purpose on PMA5-83-2WC+ amplifier
  • AC amplifier, transistor with bias network
  • modelsim not run the clock long enough

RSS Electro-Tech-Online.com Discussions

  • LED circuit for 1/6 scale diorama
  • Can I use this charger in every country?
  • Electronic board faulty?!?
  • using a RTC in SF basic
  • An Update On Tarrifs

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • Fischer connector system adds ratchet locking system designed for 300g shock resistance
  • Littelfuse introduces tactile switch with enhanced bracket peg design for mounting strength
  • Infineon releases GaN switch with monolithic bidirectional design
  • Sienna Semiconductor data converters feature sample rates from 20 to 250 Msps
  • Delta’s 5,500 W power supplies achieve 97.5% energy efficiency for AI servers

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronics Projects and Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe