• Arduino,  Hardware,  Software

    Making a cheap pedestal fan smarter

    What more can you ask from a fan? They give us air in hot summers, and they don’t ask for much in return… Compared to the typical air conditioner, which consumes hundreds of watts, even more than a thousand, a pedestal fan is happy with less than 100, usually . Does it make sense to make them smart? Does it at least make more sense than the fact that I am writing this in the middle of January, when this same fan is already stored until summer comes again?

    As they say, “everything has already been invented”… There are already fan models with Wi-Fi that can be connected to your home automation system. Simple, you could pay from 70 to 100 euros and boom, you would already have a smart fan. But that’s not how things are done here at El Programador Ibérico 😏.

    Let’s start by disassembling the fan and seeing how it works. The front button panel has one input wire (which comes from the live wire) and three output wires, and when each of the buttons is pressed, the circuit between the input cable and one of the output cables is closed, leaving the rest unconnected. We will have to replicate this same operation: receive an order from the home automation server and activate one of 3 outputs, depending on the speed we want, deactivating the others.

  • Logo avisador de timbre
    Arduino,  Hardware

    Homemade doorbell notifier


    Every house has a doorbell. Maybe old, maybe basic… But we don’t always notice when someone rings it. Maybe we are in the exactly opposite side of the house, maybe we are listening to music a bit too high, maybe we are doing some noisy repairs, or because this, our marvelous auditive system was on vacation, and it didn’t pick up the sounds of your doorbell when the Amazon delivery guy rang it.

    Adding push notifications to your phone could be the best solution here (and if you have a smartwatch too, even better, because it is even more difficult to not notice the notification). I have not searched a whole lot, but I am sure there are at least a couple of market models of smart doorbells out there, with their fancy melodies and useless apps for your phone, but why should I change my beloved unbranded totally generic classic doorbell? I don’t need an app specifically for the doorbell. I could use PushBullet, which I am already using for my washing machine and will use it for future projects too.

    Why not design a homemade solution then? Let’s go 🙂

    My basic doorbell receives an AC 230v line when the push button is pressed, not being powered while it is not in use, so the first thing we will need is to detect that 230v signal, as securely as we can, so a fault does not fry our small microcontroller. Talking about them, we will need one with WiFi connection, so why not the same ESP-01 we have used for the previous projects? It is cheap, small and easy to use.

  • Arduino,  Hardware

    Making my air conditioner smarter – Epilogue

    Making some maintenance in my house, I decided to fix the air conditioner in my living room, a Johnson MGE-30-BC, which has been non-working for a long time.

    I bought my house two years ago, and the air conditioner wasn’t working by then. I have always been delaying that repair project because I was expecting the worst possible outcome (maybe the gas escaped and I would have to find the leak, fix it and refill the circuit? maybe the compressor was broken, and I would have to replace it (and also empty and refill the circuit too), maybe more than one thing is faulty and I would have to replace the whole machine?… You know, that kind of repairs, which are not cheap), but… it turned out to be the easiest repair in a long time: the multi-wire cable that connects the inside and outside units has wires of the same color, and two of those wires were connected wrong.

    I don’t understand how that would happen… ¿the person who installed it didn’t try it? Maybe he/she thought it was faulty? Why didn’t he/she go to the store to retrieve his/her money? Was he/she just lazy? The only thing that I know is that I have a working aircon in the living room now 😂.

    Now that it is working, and being the owner of another aircon in my bedroom which I can control with my phone, I thought the living could not be less, and started once again decoding the remote IR codes, as I did some months ago with my bedroom unit.

  • Arduino,  Hardware

    Making my air conditioner smarter – Part 3

    << Continuation of Part 2

    Time to end this project and start thinking about the next one 😄.

    In the previous post, we ported our code to control the air conditioner to our small ESP-01. Now we need to install everything inside the air conditioner and make it work.

    First, we need the small board to power our ESP-01 and connect it to our IR LED. We do not need much: a small voltage regulator (in our case an LM317), a couple of resistors to configure it to 3.3v, a 2×4 female pin connector and a couple of resistors to put the ESP-01 into normal boot mode. The small schematic I came up with is below:

    Everything looks ok, let’s assemble it. The easiest and fastest is to use a perfboard, but in the future we try etching them with acid 😊

    What to do when you don’t have the exact resistor you need? You stack them in series 😊
  • Banner
    Arduino,  Hardware

    Making my air conditioner smarter – Part 2

    << Continuation of Part 1

    I come back from the shadows to continue my “smart air conditioner” 😄

    In the previous post, we got working a small test sketch that let us control our air conditioner with an arduino mega. Now it is time to port that sketch to an ESP-01 to make use of its WiFi connection and compact size, which is not much inside the air conditioner unit.

    As in my smart washing machine (that keeps working a year and a half later 😊), the idea here is to use MQTT for the communication between my small IoT server which has OpenHAB installed. For this MQTT communication, we will need the PubSubClient library.

    #include <ESP8266WiFi.h>
    #include <WiFiClient.h>
    #include <PubSubClient.h>
    void reconnect() {
      // Loop until we're reconnected
      while (!client.connected()) {
        // Attempt to connect
        if (client.connect(mqttClientId, mqttUser, mqttPassword)) {
          // Once connected, resubscribe
        } else {
          // Wait 5 seconds before retrying

    For managing the WiFi connections, I found a library that lets us configure a new WiFi connection, in case we change our WiFi password, without having to reprogram our board, which is great. It is called WiFiManager. In this case, we choose to open a protected WiFi connection in case of not being able to connect to the saved WiFi connection, and retry after 3 minutes (180 seconds).

  • Arduino,  Hardware

    Making my washing machine smarter – Part 5

    << Continuation of Part 4

    The time is now .It is time to connect the new guts to my washing machine, and check if everything works as expected. Well, almost… I just remembered that when I prepared my washing machine for the modifications (part 1), I didn’t prepare the start button, which will be pressed using our relay, and this way, will start the washing program.

    The modification should be simple. To solder a couple of wires to the start button. We will see how it turns out 🙂

    First, we will open the top lid of the washing machine and find the way to unmount and disconnect the control panel. In my case, it was secured with four screws and some plastic clips. After disconnecting the cable connectors, I had the whole panel in my hands.

    Factory fingerprints included in the price
  • Arduino

    Making my washing machine smarter – Part 4

    << Continuation of Part 3

    Time to start coding the software part of this project. If you remember, the requirement seems to be simple: To make the washing machine send a notificacion when the washing cycle ends (when the door unlocks).

    To send these notifications, we could choose one of many routes: e-mail, SMS, push notifications, using a custom app also designed by us… To save time, I decided to use pushbullet, a third party push notification service.

    Pushbullet allows us among other things, to send small text notifications to all the devices linked to the service. We could then, from the microcontroller, send a notification and receive it in my phone and my smart watch. I have a small IoT server in my home: an orange PI PC with OpenHAB, which I use to control my smart power outlets. What if I connect my washing machine to that server and make it send the notifications for me? That way, I could check the washing machine state and send a command to start the washing machine cycle, all remotely.

    Let’s start with the way of communications, which will have the ESP-01 miccrocontroller with my IoT server. In this case, I decided to use MQTT, for its simplicity: You define channels of communication (topics), the receiver will subscribe to those topics and the sender will publish messages to them. The PubSubClient library will help us use MQTT with ESP8266 microcontrollers.

  • Arduino,  Hardware

    Making my air conditioner smarter – Part 1

    What’s better than working on a project for improving an electronic device (see Making my washing machine smarter)? Working on two projects!

    I have a Daitsu air conditioner in my bedroom. It is an old model, the DSG-07HRN2. My plans are: I want to control it from my phone, and be able to program it accoring to X criteria in the future (temperature, month of the year, if I’m at home or not…). I could use OpenHAB for this of course, as I did with my washing machine, but first, I need to connect my air conditioner to my OpenHAB server, which, being an old non-smart model, is not possible without modifications.

    I could use some king of magical (and probably expensive) thingy that externally sends the commands using infrared and uses a proprietary APP to control it (I know of their existance), but… where’s the fun there? 😜. My idea is to use another ESP-01 microcontroller, and send the infrared commands from inside the air conditioner unit itself. I’m sure this is going to be interesting 😊.

    First, let’s investigate which kind of protocol does the original remote use, I used the IRrecvDumpV2 example sketch from the Arduino-IRRemote library, created by Ken Shirriff and other contributors.

    When I tested my remote on my arduino MEGA, I was surprised it said the protocol used was SAMSUNG, which has nothing to do with Daitsu. Interesting.

    Samsung? Daitsu? Do they use the same protocol? Or is it an error from the sketch? Will we find out?
  • Arduino,  Hardware

    Making my washing machine smarter – Part 3

    << Continuation of Part 2

    Let’s start assembling the board that will control the state of the washing machine cycle. Four things are needed: the microcontroller, its power supply (the microcontroller works at 3.3 volts, and the power adapter we’re using works at 5v), the door lock detector and the actuation over the “start washing cycle” button.

    As stated above, the ESP-01 needs 3.3 volts to work, a ground connection and needs to have pulled high (using a resistor, like a 10kohm one for example) the GPIO0 and GPIO2 pins in order to boot correctly. Apart from that, an output pin will actuate the start button and an input pin will detect the door lock state.

    The 3.3 volts power can be obtained using, for example, an LM317T, a famous classic voltage regulator that, using a couple of resistors allows us to get a specific voltage. Using one of the many online calculators, we can calculate which resistors we need. In my case, I used this one.

  • Arduino,  Hardware

    Making my washing machine smarter – Part 2

    << Continuation of part 1

    Guts. Time to talk about guts. Electronics guts of course…

    Which microcontroller should we use for this project? The first requirement is it hast to have WiFi, since it will be the way its way of sending notifications to my phone. About number of general purpose input/outputs (GPIO), two would be enough (one for detecting the door lock state and another one for actuating the cycle start button remotely). I could use a classic Arduino UNO, with a WiFi shield:

    This one is known by most makers out there. It supports thousands of libraries, which you can make tons of things with, but… It has like 20 pins between digital and analog, and even though the WiFi shield uses some of them, I still think it’s overkill for my project. Two pins would be enough.

Esta web utiliza cookies propias y de terceros para su correcto funcionamiento y para fines analíticos. Al hacer clic en el botón Aceptar, acepta el uso de estas tecnologías y el procesamiento de tus datos para estos propósitos. Ver