As I have hinted in other threads I have been working on an automation and control system for the van. The 3 phases of this project are:
1. Single pane of glass control of all devices (to include vehicle controls as well)
2. Sensor and data collection; local and internet
3. Automate various tasks based on sensor data
Step 1 involves turning most of your disparate 'dumb' devices into relays which can be controlled by the MCUs. Some things like the MaxFan and the CnC AC are pretty straight-forward. I haven't started on the Espar yet, but I imagine I'm in for a load of fun. As for vehicle controls, they're pretty well documented, and for the most part I will render the physical vehicle controls inoperable. This also includes relay controls for lighting, pnematics, and really anything else that needs a power switch.
Step 2 is gathering the values which will be needed to make the automation workflows. Throughout the van there will be sensors that I will install such as temp/pressure/contacts/lidar/ultrasonics, etc. In addtion, the CerboGX has a ton of data on the electrical system, and there are also various APIs I can pull from online, such as weather data. I also have OBD-II data feed and the vehicle status outputs from the High Specification Vehicle Interface Connector.
Step 3 is the fun part. Most of automation will revolve around lighting and environmental controls. I will be able to write logic using any of the sensor data collected to make these tasks as intelligent as possible. For example, the solar panels might only extend if the vehicle is off, distance sensors detect no obstructions, the weather report says winds are less than 50 mph, and the system SOC is less than 90%.
All of this is accomplished with various MCUs around the vehicle collecting sensor data and controlling relays. This data is all sent to an MQTT server where other MCUs can act on the information. This is a fairly common and well documented method of DIY automation. I'm using Teensy 4.1s because of the built-in ETH PHY along with the extremely beefy (for an MCU) hardware specs. For example my panel code is already using 200 Kb of RAM whereas your standard Arduino Uno only has 2 Kb of RAM max.
The panel is an 800x480 capacitive touchscreen and is essentially stateless like all the other MCUs. I'm making a few more at the moment for the inside and rear of the van. On powering up it pulls all the MQTT topics which describe relay status and other variables and is able to immediately represent the status of the system. This happens anytime the topic values are updated, whether it's another panel changing something or automation code.
As with everything in the van, the current status is "temporary working example". I'm not particularly fond of the GUI I came up with, but I did just refactor all the backend code to make additions to the system very easy. It's really down to building proto-boards at this point in order to bring everything up.
BONUS pic of electrical system...
1. Single pane of glass control of all devices (to include vehicle controls as well)
2. Sensor and data collection; local and internet
3. Automate various tasks based on sensor data
Step 1 involves turning most of your disparate 'dumb' devices into relays which can be controlled by the MCUs. Some things like the MaxFan and the CnC AC are pretty straight-forward. I haven't started on the Espar yet, but I imagine I'm in for a load of fun. As for vehicle controls, they're pretty well documented, and for the most part I will render the physical vehicle controls inoperable. This also includes relay controls for lighting, pnematics, and really anything else that needs a power switch.
Step 2 is gathering the values which will be needed to make the automation workflows. Throughout the van there will be sensors that I will install such as temp/pressure/contacts/lidar/ultrasonics, etc. In addtion, the CerboGX has a ton of data on the electrical system, and there are also various APIs I can pull from online, such as weather data. I also have OBD-II data feed and the vehicle status outputs from the High Specification Vehicle Interface Connector.
Step 3 is the fun part. Most of automation will revolve around lighting and environmental controls. I will be able to write logic using any of the sensor data collected to make these tasks as intelligent as possible. For example, the solar panels might only extend if the vehicle is off, distance sensors detect no obstructions, the weather report says winds are less than 50 mph, and the system SOC is less than 90%.
All of this is accomplished with various MCUs around the vehicle collecting sensor data and controlling relays. This data is all sent to an MQTT server where other MCUs can act on the information. This is a fairly common and well documented method of DIY automation. I'm using Teensy 4.1s because of the built-in ETH PHY along with the extremely beefy (for an MCU) hardware specs. For example my panel code is already using 200 Kb of RAM whereas your standard Arduino Uno only has 2 Kb of RAM max.
The panel is an 800x480 capacitive touchscreen and is essentially stateless like all the other MCUs. I'm making a few more at the moment for the inside and rear of the van. On powering up it pulls all the MQTT topics which describe relay status and other variables and is able to immediately represent the status of the system. This happens anytime the topic values are updated, whether it's another panel changing something or automation code.
As with everything in the van, the current status is "temporary working example". I'm not particularly fond of the GUI I came up with, but I did just refactor all the backend code to make additions to the system very easy. It's really down to building proto-boards at this point in order to bring everything up.
BONUS pic of electrical system...