IMPROVING MINI FAN USING MAKER’S PRODUCT AND ARDUINO

Let's improve the existing product to be more creative?

INTRODUCTION

This tutorial is to show on how to improve the existing product in the market, like mini fan using Maker’s product and Arduino. The improvement is focusing on its functionality. Maybe, you can apply this concept of idea on Reka Bentuk dan Teknologi form 3 subject.

VIDEO

This video will show you how to improve the mini fan using Maker product and Arduino.

Untuk versi Bahasa Melayu, sila rujuk video dibawah.

HARDWARE PREPARATION

Below is the list of the items used in the video.

Wiring connection table.

Maker UNOLM35Maker DriveBatteryMini Fan
5VVin
GNDGNDGND
Pin A0Data
Pin 3Pin M1A
Terminal VB+Positive
Terminal VB-Negative
Terminal M1ABlack Wire
Terminal M1BRed Wire

SAMPLE CODE

/*
* Projek: Controlling mini fan in manual and auto mode
* using Arduino
* Board: Maker UNO (Arduino Uno)
*/
#define NOTE_C4 262
#define NOTE_D4 294
#define NOTE_E4 330
#define NOTE_F4 349
#define BUTTON 2
#define M1A 3
#define PIEZO 8
#define LM35 A0
#define LED5 5
#define LED6 6
#define LED7 7
int fanMode = 0;
int ledState = LOW;
long previousMillis = 0;
int interval = 500;
int celsius = 0;
enum {
STOP,
SPEED1,
SPEED2,
SPEED3,
AUTO
};
void setup()
{
pinMode(BUTTON, INPUT_PULLUP);
pinMode(M1A, OUTPUT);
pinMode(PIEZO, OUTPUT);
pinMode(LM35, INPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
for (int pin = 9; pin < 14; pin++) {
pinMode(pin, OUTPUT);
}
Serial.begin(9600);
Serial.println("Reka Bentuk dan Teknologi Tingkatan 3");
Serial.println("Projek: Naik Taraf Kipas Mini");
}
void loop()
{
if (digitalRead(BUTTON) == LOW) {
fanMode++;
if (fanMode > 4) {
fanMode = 0;
}
if (fanMode == STOP) {
Serial.println("Kipas berhenti.");
for (int pin = 8; pin < 14; pin++) {
digitalWrite(pin, LOW);
}
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
analogWrite(M1A, 0);
}
else if (fanMode == SPEED1) {
tone(PIEZO, NOTE_C4, 100);
delay(100);
noTone(PIEZO);
digitalWrite(LED5, HIGH);
analogWrite(M1A, 150);
Serial.println("Kipas berpusing: Kelajuan 1.");
}
else if (fanMode == SPEED2) {
tone(PIEZO, NOTE_D4, 100);
delay(100);
noTone(PIEZO);
digitalWrite(LED6, HIGH);
analogWrite(M1A, 200);
Serial.println("Kipas berpusing: Kelajuan 2.");
}
else if (fanMode == SPEED3) {
tone(PIEZO, NOTE_E4, 100);
delay(100);
noTone(PIEZO);
digitalWrite(LED7, HIGH);
analogWrite(M1A, 255);
Serial.println("Kipas berpusing: Kelajuan 3.");
}
else if (fanMode == 4) {
tone(PIEZO, NOTE_F4, 100);
delay(100);
noTone(PIEZO);
Serial.println("Kipas automatik.");
previousMillis = millis();
}
while (digitalRead(BUTTON) == LOW);
delay(500);
}
if (millis() - previousMillis > interval &&
fanMode == AUTO) {
ledState = !ledState;
digitalWrite(LED5, ledState);
digitalWrite(LED6, ledState);
digitalWrite(LED7, ledState);
int adc = analogRead(LM35);
celsius = 0.488 * adc;
Serial.print("Suhu (celsius): ");
Serial.println(celsius);
fanAutomatic(celsius);
previousMillis = millis();
}
}
void fanAutomatic(int c)
{
for (int pin = 9; pin < 14; pin++) {
digitalWrite(pin, LOW);
}
if (c < 28) {
analogWrite(M1A, 0);
}
else if (c < 29) {
digitalWrite(9, HIGH);
analogWrite(M1A, 150);
}
else if (c < 30) {
for (int pin = 9; pin < 11; pin++) {
digitalWrite(pin, HIGH);
}
analogWrite(M1A, 175);
}
else if (c < 31) {
for (int pin = 9; pin < 12; pin++) {
digitalWrite(pin, HIGH);
}
analogWrite(M1A, 200);
}
else if (c < 32) {
for (int pin = 9; pin < 13; pin++) {
digitalWrite(pin, HIGH);
}
analogWrite(M1A, 225);
}
else {
for (int pin = 9; pin < 14; pin++) {
digitalWrite(pin, HIGH);
}
analogWrite(M1A, 255);
}
}
view raw KipasMiniPintar.ino hosted with ❤ by GitHub

REFERENCES

  1. Reka Bentuk dan Teknologi Form 3 Text Book.

Thanks for reading this tutorial. If you have any technical inquiry, please post at Cytron Technical Forum.

2 thoughts on “IMPROVING MINI FAN USING MAKER’S PRODUCT AND ARDUINO”

  1. Assalamualaikum dan salam sejahtera..boleh tak kita buat kipas pintar tanpa menggunakan maker drive? Tetapi hanya menggunakan maker uno started kit sahaja?

Leave a Comment

Your email address will not be published.

Share this Tutorial

Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest
Share on facebook
Share on whatsapp
Share on email
Share on print
Share on twitter
Share on pinterest

Latest Tutorial

Send Data to Firebase Using Arduino Uno WiFi Rev2
Simple Alarm System Using Maker Nano
Program Cucumber ESP32-S2 Using CircuitPython
Face Recognition Using OpenCV on Raspberry Pi 400
Turned Your Tablet as a Display for the Raspberry Pi 400
Scroll to Top