Noshirt
ITALY • + Follow
Edit Project
Components
|
ARDUINO UNO REV3 |
x 1 | |
|
2-Channel Relay |
x 1 | |
|
IR ReceiverNewark
|
x 1 | |
|
IR Remote (generic) |
x 1 | |
|
HLK-PM01HI-LINK(海凌科)
|
x 1 |
Tools, APP Software Used etc.
|
arduino IDEArduino
|
|
|
Soldering iron |
Description
IR Remote for Fan
So, I found this little Fan (it should be at least 10 years old), which was powered by some buttons and I had to get up from my bed/chair/whatever I was sitting on just to turn it on/off or to change speed (it has 3 speed).
So I came up with this idea of turning it off/on and changing speed with a simple IR Remote, obtaining a lot of comfort during hot summer days and nights.
So, I think that was a very nice idea and everything works properly.
Obviosuly, you can use that approach for every household appliance you have in your home, hope you will find it useful!
Have a nice day :)
Just one thing: YOU'RE WORKING WITH 220V, SO BE VERY VERY VERY VERY VERY CAREFUL BECAUSE YOU COULD SERIOUSLY HARM YOURSELF.
Code
Remote.ino
C/C++
#include <IRremoteInt.h>
#include <IRremote.h> // use the library
int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results;
void setup()
{
Serial.begin(9600); // for serial monitor output
irrecv.enableIRIn(); // Start the receiver
pinMode(5, OUTPUT); //IN1 of first Relay
pinMode(6, OUTPUT); //IN2 of first Relay
pinMode(7, OUTPUT); //IN1 of second Relay
}
void loop()
{
if (irrecv.decode(&results)) // have we received an IR signal?
{
Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal
irrecv.resume();// receive the next value
}
//Check if other Relays are OFF before turning ON the one selected.
// 0x"YOURCODE1" will turn into something like
// 0xABCDEFX after reading the remote value
// Same for YOURCODE2/3/4
if (results.value == 0x"YOURCODE1"){
if (digitalRead(6) == LOW && digitalRead(7) == LOW) {
digitalWrite(5, HIGH);
}
else if(digitalRead(6) == HIGH || digitalRead(7) == HIGH) {
digitalWrite(6, LOW);
digitalWrite(7, LOW);
delay(1000); //Wait a sec just to be sure of not causing a short circuit
digitalWrite(5, HIGH);
}
}
if ( results.value == 0x"YOURCODE2"){
if (digitalRead(5) == LOW && digitalRead(7) == LOW) {
digitalWrite(6, HIGH);
}
else if(digitalRead(5) == HIGH || digitalRead(7) == HIGH) {
digitalWrite(5, LOW);
digitalWrite(7, LOW);
delay(1000);
digitalWrite(6, HIGH);
}
}
if ( results.value == 0x"YOURCODE3"){
if (digitalRead(5) == LOW && digitalRead(6) == LOW) {
digitalWrite(7, HIGH);
}
else if(digitalRead(5) == HIGH || digitalRead(6) == HIGH) {
digitalWrite(5, LOW);
digitalWrite(6, LOW);
delay(1000);
digitalWrite(7, HIGH);
}
}
// Put here your code for turning off the Fan
if ( results.value == 0x"YOURCODE4"){
digitalWrite(5, LOW);
digitalWrite(6, LOW);
digitalWrite(7, LOW);
}
}
Decoder.ino
C/C++
#include <IRremoteInt.h>
#include <IRremote.h> // use the library
int receiver = 11; // pin 1 of IR receiver to Arduino digital pin 11
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results;
void setup()
{
Serial.begin(9600); // for serial monitor output
irrecv.enableIRIn(); // Start the receiver
pinMode(9, OUTPUT); // Pin 9 output
}
void loop()
{
if (irrecv.decode(&results)) // have we received an IR signal?
{
Serial.println(results.value, HEX); // display it on serial monitor in hexadecimal
irrecv.resume();// receive the next value
}
}
Schematic and Layout
Jun 17,2022
519 views
IR Remote for Fan
Turn on/off your fan without getting up, just by using an IR remote.
519
0
0
Published: Jun 17,2022
Purchase
Donation Received ($)
PCBWay Donate 10% cost To Author
Copy this HTML into your page to embed a link to order this shared project
Copy
Under the
Attribution-ShareAlike (CC BY-SA)
License.
- Comments(0)
- Likes(0)
Upload photo
You can only upload 5 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP
0 / 10000
It looks like you have not written anything. Please add a comment and try again.
You can upload up to 5 images!
Image size should not exceed 2MB!
File format not supported!
View More
View More
VOTING
0 votes
- 0 USER VOTES
0.00
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Design
1/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Usability
2/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Creativity
3/4
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Content
4/4
More by Noshirt
- IR Remote for Fan So, I found this little Fan (it should be at least 10 years old), which was powered by some buttons ...
- Arduino Weather Station v1.0 (BMP280) First version of a very simple weather station made with an Arduino UNO, a BMP280 sensor and a LCD.I...
- Wi-Fi Controlled Relay One day I woke up. I thought, why can't my windows be opened from my pc?! Why I have to get up from ...
- Start/Stop Chronometer Me and my friend are always in competition for something, in every sports, from ski to run, to MTB. ...
- Arduino Keyboard V2.0 That's an update for the older version of the project!Now you can play the keyboard on the keys from...
- Arduino Keyboard Didn't know what to do as my first Arduino Project, so i thought of starting out with something litt...
You may also like
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
154 1 1 -
-