Skip to content
PekawayPekaway
Control MaxxFan via infrared

Control MaxxFan via infrared

The MaxxFan is installed in countless vehicles and reliably provides fresh air. If it is installed in the direction of travel, it can even be operated while driving. In short, it's a great thing! But how about if you could control it not only with the remote control, but also via a website from any device or our VAN PI system. In this tutorial, we'll explain how you can easily build your own remote control with the help of an Arduino.

What do you need?
- An Arduino e.g. Nano and an IR-LED e.g. the KY-005

For anyone who hasn't worked with an Arduino before, an Arduino is a small microcontroller that is intended for beginners and will teach you programming through a huge community and thousands of tutorials. However, we'll keep it a bit simple here and focus more on how you can recreate the whole thing.

https://create.arduino.cc/projecthub/yeshvanth_muniraj/getting-started-with-arduino-bcb879

1.Step Software

Download and install the Arduino IDE (development environment). You should then be able to program your Arduino. To do this, you need to select the right board (Nano, Uno, etc.) and the right serial port. Once you've done that, you can first install the "Blink" program to see if everything is working. Once the program has been installed, the LED on the board should be blinking happily. Your development environment is now ready.

2. Install the program.

In the attachments you will find our program, which you have to install. What does the program do now?

The program is quite simple. In the setup, the "IRledPin" is set and thus the signal pin for the LED is determined. Then the baud rate for serial communication (USB) is set to 115200.

After the setup, which runs every time the microcontroller is started, we go into the loop. This is where the actual program is. This program runs indefinitely in the "loop". Here it waits for a signal from the USB/serial interface and sends the IR code from the MaxxFan according to the signal. This happens by simply sending a character.

After you have installed the program, you can test it using the built-in serial monitor.

The serial monitor can be found under tools. Don't forget to set the baud rate to 115200. If you now simply send the letter "a" in the upper field, it should be received as confirmation.

So the Arduino is running and has just sent the signal to turn off the MaxxFan, or at least sent it out, the IR LED is still missing. Please just look in the code to see which letter or number sends which signal. You can do it ;-) After "case" comes the character and the function that is called.

"a" calls the function "IRsignal_Off();" this function now pulses the same signal that would come from the remote control on pin 9. To do this, all interrupts are switched off, as otherwise we cannot be sure that the signal is sent out properly. An interrupt is an interruption of the program for another "more important" activity.

Further down in the code are also the pulse times for the individual commands.

3. Connect IR LED.

To add the LED, simply connect signal to PIN 9 (or the pin you specified), ground and VCC 5V.

After that, your fan should be controllable via the serial interface.

You can see what it looked like for me here ;)

https://youtu.be/0QV2lB--kXo

4. Integration into the VANPI system.

It is now relatively easy to integrate the whole thing into the VANPI system, or Node-Red. We will have this built in for you in the next update (v1.1.0) and you will then be able to select the MaxxFan in the config for the USB ports. There will also be a ready-flashed module in the shop for anyone who doesn't want to tinker with it themselves.

Basically, all you have to do in Node-Red is send the commands to the Arduino using a serial node. This works on both Windows devices (COM) and Linux (ttyUSB).

https://flows.nodered.org/node/node-red-node-serialport

Link to MaxAir_TX.ino file:

https://share.12-s.de/s/KkDbwC4ZjPTbfwJ

Do you have any questions or requests? Feel free to write them in the comments.

Leave a comment

Your email address will not be published..

more tutorials

Open Source needs support

become Patron now

More projects, more tutorials and more supported devices. Our community is growing and would appreciate your support. So become a patron now to always receive the latest content and support the VAN PI project at the same time.

Become a Patron
Cart 0

Your cart is currently empty.

Start Shopping