Remote control? air
Remote control? air
What I wanted to learn, and why it interested me: I want to control a fan on and off remotely.
Final outcome: I used two arduinos to communicate with each other. I used an ultrasonic ranger for the transmitter to measure object distance and a fan for receiver. When an object gets closer, the fan will be off.
Images of final creative/exploratory output
Final setup. Transmitter arduino is connecting to ultrasonic ranger. Recevier arduino is connecting to the fan.
As an object gets closer, the fan will stop.
Process images from development towards creative/exploratory output
During the technical exercise I learned to connect transmitter and receiver arduino.
I was having trouble connecting the fan. Eventually I learned to use a 12v power and transistor to properly connect it.
Process and reflection:
I first followed the technical exercise to build basic communication between 2 arduinos. When the LED is blinking that means the receiver arduino is receving signals from the transmitter. Then I added a potentiometer to the transmitter as input to control the LED brightness from the receiver. Then I wanted to use a fan as a creative output and ultrasonic ranger as an input. I learned to wire and code both of them in class. One of the bigger takeaway is that both arduinos need to be connected to the same power and ground!! The fan with ultrasonic input can be finicky sometimes since it can't always stop entirely when an object is close.
I definitely enjoy this small exercise since I have a lot of freedom and the pace is good enough for me to enjoy learning. I don't know what exactly I want to do for the second project yet but I am sure this exploration is helpful. I like using fan as an output a lot though!
Technical details
Schematic for connecting the two arduinos. Fan is using transistor to connect to arduino and powered by 12V external source. The two arduinos are connected via transmit and receive pins.
Receiver:
/*
60-223 Intro to Physical Computing, fall 2025
Domain-specific Skill Building exercise: remote control air
This is connected two arduinos. Transmiter with ultrasonic ranger input. Receiver with fan output.
Depends on the distance of an object, when the object is closer, the fan will stop. If the object distance is far,
the fan will continue to blow.
Pin mapping:
Arduino pin | role | details
------------------------------
9 output external fan
*/
int fanPin = 9;
int inVal = 0;
void setup() {
// put your setup code here, to run once:
pinMode(fanPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
while (Serial.available()) {
int inVal = Serial.parseInt(); // read the value as an integer
// int mapVal = map(inVal, 0, 50, 0, 255);
if (inVal < 10) {
analogWrite(fanPin, 0);
} else {
analogWrite(fanPin, 200);
}
}
}
Transimiter:
/*
60-223 Intro to Physical Computing, fall 2025
Domain-specific Skill Building exercise: remote control air
This is connected two arduinos. Transmiter with ultrasonic ranger input. Receiver with fan output.
Depends on the distance of an object, when the object is closer, the fan will stop. If the object distance is far,
the fan will continue to blow.
Pin mapping:
Arduino pin | role | details
------------------------------
9 input echo pin
10 output trigger pin
Code example credit: https://create.arduino.cc/projecthub/Isaac100/getting-started-with-the-hc-sr04-ultrasonic-sensor-036380
*/
const int trigPin = 10;
const int echoPin = 9;
float duration, distance;
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration*.0343)/2;
distance = constrain(distance,0,50);
Serial.print("Distance: ");
Serial.println(distance);
delay(100);
}