Close
0%
0%

PelletMon

Monitor pellet boiler status via CAN bus, measure fuel level using ultrasound distance sensor

Similar projects worth following

WHAT AND WHY?

Our old boiler was previously connected to my IoT system. After replacing the boiler with a new one, we no longer have this option. So why not introduce it to a new boiler?

THE TARGET

The goal of the project is to reverse engineer the CAN communication of the new boiler and expose real-time data to the IoT. By the way, the HC-SR04 sensor will measure the fuel level in the tank.

DESIGN

The project will have its own PCB. Communication with the outside world will be carried out using ESP32 and fuel level measurement using HC-SR04. The SN65HVD230 chip will be used as the CAN transceiver. The software will be written in the Arduino environment in C ++ and will be powered with my IoT framework - ksIotFrameworkLib.

SOURCES

  • 1 × ESP32-WROOM-32U 2-cores MCU with WiFi, Bluetooth and integrated CAN controller
  • 1 × AMS1117-3.3 LDO / Voltage Regulators
  • 1 × SN65HVD230 CAN transceiver
  • 1 × Tact push switch
  • 1 × 10 uF tantalum capacitor /1206

View all 15 components

  • Hello NodeRED! Hi, dashboards!

    h4rdc0der03/15/2021 at 08:16 0 comments

    I recently added dashboards. The whole thing works in the IBM cloud (bluemix) and is accessible from anywhere.

  • Fixed and working!

    h4rdc0der03/06/2021 at 10:36 0 comments

    After removing the terminating resistor, the problems with the boiler disappeared. The device has been working continuously for several days without any problems.

    Final mounting - transparent enclosure, SMA antenna:


  • Bad things happened

    h4rdc0der03/03/2021 at 21:31 0 comments

    It looks like with 120 ohm resistor, I have introduced excessive termination that led to errors in CAN transmissions. I had to unsolder termination resistor from my board and trim my cables to work properly as CAN stub.

    Enclosure arrived today, so I have mounted everything inside.

    It requires more testing this time, but I hope that issue is fixed.

  • Testing

    h4rdc0der02/28/2021 at 20:44 0 comments

    Today I prepared the cables and prototype software to retrieve data, then connected everything to the heating boiler CAN-bus and communication with MQTT worked properly.

    Example dasbhoard:

    Testing connection and current consumption.


    What's next?

    I need to route everything properly, get an enclosure and add fuel level sensor. It will take few days as I have to order cable organizers etc.

  • Tests done, everything works!

    h4rdc0der02/26/2021 at 12:56 0 comments

    Before connecting my device to the boiler, I made sure that all interfaces were working. 

    There was a problem with the R1 resistor, which made the CAN bus not working, but it turned out that it was enough to correct the weld. There is working two-way communication between the two PCBs. The fuel level sensor leads have also been tested and everything is fine.

    Now all that's left is programming and installation on the boiler :)

  • PCBs assembled

    h4rdc0der02/24/2021 at 20:02 0 comments

    Unfortunately, I had to wait over a month for the package, but it eventually arrived. Soldering was quick, without hot-air gun.

    Anyway, a lot of optimizations have been introduced into my iot framework - ksIotFrameworkLib.

    I hope to have some time to launch this board at the destination place in my basement, but it will not happen this week :)

  • PCBs in production!

    h4rdc0der01/03/2021 at 18:33 0 comments

    Since all experiments were successful, it's time to order a PCB. 
    All parts were ordered together with the board.

    As usual, I used the JLCPCB service, combining the order with LCSC. Unfortunately, according to the announcement, the option to combine orders will be withdrawn soon.

  • Experiment 3 - Better approximation

    h4rdc0der01/02/2021 at 19:44 0 comments

    I decided to improve the temperature conversion. Here's where the curve fitting software come in.
    One of them is Curve Expert - can be bought at https://www.curveexpert.net/order, but trial is also available.

    After a few tweaks, the polynomial curve fitting method turned out to be the best (5th degree).

    double calctemp(short x)
    {
        double a = 1.445633283634090E+02;
        double b = -1.386947619796149E-01;
        double c = 9.837913934334235E-05;
        double d = -4.486094388070098E-08;
        double e = 1.076415627857750E-11;
        double f = -1.066640689001453E-15;
    
        return a + b * x + c * pow(x, 2) + d * pow(x, 3) + e * pow(x, 4) + f * pow(x, 5);
    }

    It turned out that all temperatures are transferred in the same way, so this function can be used to calculate different temperatures - e.g. domestic hot water.

  • Experiment 2 - Hacking all I CAN

    h4rdc0der01/01/2021 at 21:20 0 comments

    I previously established that my boiler uses the CAN bus to transfer data between the controller and the touch panel. The controller is somewhere inside and the touchpad is on the front as you can see ...

    The CAN port is on the back - it looks like an ARK connector. There are also CANL, CANH, GND and optional 12V, so the external module (Estyma VideNET) does not require a separate power supply.

    So, let's start hacking...

    I quickly realized that I did not have the right tools to analyze CAN traffic, since I had only ESP32 and CAN transceiver module based on SN65HVD230 chip.

    I tried several internet solutions to send data to Wireshark, but the messages were still difficult to analyze.

    I found a program on the Internet that I can use to suit my needs - CAN-Monitor-3000 github repository. I ended up writing a program in Arduino to emulate one of it's supported adapters.

    Visit my Canmon-Sniffer repository!

    Troubles with temperature...

    After searching the data stream, I found no interesting temperature value.
    Then noticed message 0x2D6... it changes when temperature changes!

    I figured out that I could send the crafted data to the bus. I had to add support for sending data to the CAN bus to the sniffer. 

    I was in trouble when I sent the wrong frame. The boiler reported a sensor failure and turned off.

    But eventually after few hours of headache, I ended with this small lookup table:

    Approximate for the win!

    I entered the given values on one of the pages for the function approximation. Then I put the given function into the test program.

    CRAZY!

    After uploading the program to ESP32, I got an approximate temperature reading.

    There is still a lot of work ahead of me, but this adventure was really interesting.

  • Experiment 1 - HC-SR04 to monitor fuel level

    h4rdc0der12/28/2020 at 16:16 0 comments

    Experiment 1

    I've bought HC-SR04 distance sensor and connected it to ESP32 devkit. I was curious if it would return reasonable value, because the fuel has no smooth / flat surface.

    Result - suprise! It works!

    This is a cool project base then, so I can research further :)

View all 10 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates