Campervan Technology

This page describes the electronics and monitoring technology that I created and fitted to the Coachmen Crossfit. The campervan electrical system is described on a separate page.

Updated 12/27/2023.

As built, the Coachmen Crossfit was not equipped with a system for monitoring power or battery levels. Additionally, as outlined in several blog posts, we had issues maintaining proper refrigerator temperature. To help monitor the refrigerator and to monitor and manage power utilization and battery levels, I created a monitoring system using custom firmware on ESP32 microcontrollers, and open-source software running on a Victron Cerbo GX. Most of that system is described in a series of technology related posts. This page will attempt to consolidate those posts into a single description of the various electronic systems.

An approximation of the current monitoring system

Monitoring Backend

All monitoring and control data/messages are forwarded to an MQTT instance running on the Victron Cerbo GX. Any logic necessary for the handling of the monitoring or control data/messages are handled by a Node-Red instance, running on the GX. The Node-Red instance both subscribes to and publishes MQTT messages as appropriate. All messages and data traverse the MQTT message bus at least once.

ESP-NOW messages to and from remote microcontrollers are received by an ESP32 that translates messages and data to and from the MQTT instance to the ESP-NOW wireless protocol, which forwards them to the other ESP32’s.

A description of the message bus as of Spring 2023 is here.

Monitoring Dashboards and Screens

All relevant data from any of the monitored devices is forwarded from the MQTT bus to each of a Blynk IoT dashboard and a Nextion touchscreen display. Data & messages to the Blynk dashboard are forwarded using the Blynk API. Data & messages to the Nextion display are forwarded using the ESP-NOW protocol. Messages are JSON formatted. The JSON messages are translated to Nextion commands using a dedicated ESP32 microcontroller.

Either can be used to configure the automatic refrigerator fans (described later).

Nextion touchscreen

An early version of the ESP32-Nextion system is described here.

Monitoring Transport

A combination of Bluetooth Low Energy (BLE), ESP-NOW and USB/Serial communications are used to forward data and control messages to and from the MQTT backend. Communications to/from the Blynk IoT dashboard is via Wi-Fi & the Internet. If Wi-Fi and the Internet are unavailable, the Blynk IoT dashboard will not be updated. The Nextion screen is not dependent on Wi-Fi or the Internet.

Refridgerator Monitoring

Internal refrigerator temperature is monitored using a Govee Bluetooth temperature sensor. The data from the sensor is forwarded to MQTT via an ESP32. Messages are formatted as JSON, embedded in ESP-NOW packets. Temperature below and above the refrigerator coils is monitored by DS18B20 sensors attached to an ESP32 microcontroller. The microcontroller controls the speed of the cooling fans above the refrigerator coils with a pulse-width modulated 12v DC signal. A failsafe is provided by a relay that automatically closes when the microcontroller is non-functional.

Fan speed is based on the temperature differential between the bottom and top of the air space around the coils. Several adjustable parameters allow for fine control of the fans sensitivity and speed.

Internal fridge temperature, coil temperature and fan speed status are forwarded to both the Blynk dashboard and Nextion touchscreen via ESP-NET, the MQTT instance, and Node-Red. The Blynk dashboard can send alerts to a cellphone when high or low temperature thresholds are met.

An early version of the fridge/fan controller system is described here.

Cabin Temperature Monitoring

Temperature inside the coach is monitored using another Govee sensor (placed in the wall alongside in-wall plumbing) and a Victron temperature sensor attached to the lithium battery terminal. The in-wall Govee is used to predict when plumbing might freeze, and the Victron sensor is used to determine battery compartment temperature. Data from each is forwarded to the MQTT instance. From the MQTT instance data is forwarded to the Blynk dashboard via the Node-Red instance, and to the Nextion screen via Node-Red and ESP-NET.

Battery and DC Power Monitoring

Lithium battery status is monitored using a Victron SmartShunt. Data from the SmartShunt is forwarded to MQTT via a Victron VE.Direct/USB cable to the Node-Red instance running on the Cerbo GX, which translates the data and forwards it to the MQTT instance. From the MQTT instance, data is forwarded to the Blynk dashboard and Nextion screen via the same Node-Red instance.

The Victron MPPT solar controllers are monitored using Victron VE.Direct/USB cables attached to the Cerbo GX. The Node-Red instance is used to read the VE.Direct/USB data from the controllers and forwards it to MQTT. The same Node-Red instance translates and forwards the messages/data from the MQTT instance to the Blynk dashboard and Nextion screen.

A single Thornwave shunt is used to monitor the voltage of the chassis and AGM batteries. This data is no longer being forwarded to MQTT. The Thorwave app must be used to read this data.

Github Code

  • ESP32 ESP-NOW/Govee code.
  • ESP32 ESP-NOW/Nextion code.
  • ESP32 ESP-NOW Fan control code.