IoT Systems - ThisSmartHouse/mobile-command GitHub Wiki

IoT Systems

It wouldn't be This Smart RV unless it was loaded with smart IoT devices to make the RV as efficient and enjoyable as possible!

Core IoT System

The core IoT system is powered by a Raspberry Pi 4 installed into the RV, with a standard 7" touchscreen interface mounted on the wall. This RPi serves as the central hub for all IoT things and includes:

  • Home Assistant (the interface for the smart devices)
  • An MQTT server (the data bus for all the smart devices)
  • A kiosk browser for the touch screen (provides interface to Home Assistant

Note this RPi is a dedicated machine and is not in any way connected to any other RPi I might mention (i.e. for the media center).

This RPi, and for that matter all IoT devices, are powered off of the 12V electrical system using a buck converter to bring the voltage down to an acceptable level for the device in question.

Boot up / Shut down procedure

In addition to the touch screen display the RPi has attached to it a physical button (attached to a GPIO pin) and two off the shelf 5V activated relays. These relays are wired into the power for the lighting system and sensor systems respectively.

The reason this is done is because, from a power consumption perspective, it makes no sense to have the sensors powered unless the RPi and it's MQTT server are booted and running. Thus, on boot once the RPi is ready to go it activates this relay and turns on all the sensors in the RV.

Likewise for the lights, which are also controlled via MQTT. However unless the sensors, the reason the lights are on a separate relay is because there is a bypass switch that can power the lights without the RPi being booted. This is to ensure you can always at least turn on the lights (when they first turn on they always turn on bright white).

The physical switch is the RPi's shutdown / power on switch, which can be used to turn off the IoT system cleanly before disconnecting the RV 12V operational system (see the electrical system explaination) when not in use.

Lighting System

The primary lights of the rig are low-profile custom made recessed LED lighting. Each consists of 83 5050 full color individually controlled Leds, a ESP8266 with external antenna, and a 12V->5V power converter to power them. They run my LED Light Firmware that is compatible with home Assistant and communicate over MQTT and WiFi with the Core RPi hub. As I mentioned earlier, when they first power on they automatically turn on to full brightness, so even if the MQTT server or WiFi wasn't working the bypass on the RPi's relay will allow you to use the lighting.

Sensors

There are a lot of various sensors built for the RV. All of them are based on the ESP8266 WiFi MCU chip and run some version of a custom firmware based on my CoogleIOT ESP8266 framework. They all run on 12V DC that is stepped down appropriately, and that 12V power supply is controlled by a relay commanded by the RPi Hub.

A/C Sensors

Attached to various points in the A/C system are sensors that can detect if the particular Hot/Neutral line in question is charged or not. This can be useful to knowing if we are running on Shore power (30A? 50A?) or generator power (for example) by reporting that back to the hub.

Temp and Humdity Sensors

There is both an indoor, and outdoor temp and humidity sensor. It's pretty standard IoT sort of device and just reports some data

Water Compartment Sensor

In the Water Systems section I described that my water storage compartment is equipped with temperature monitoring and a 12V heater designed to keep the compartment above freezing. This sensor basically consists of a relay and a temp/humidity sensor and has the ability to turn on/off the heater in the compartment. This allows the RV to alert us if the compartment is at risk of freezing, automatically turn on the heater, and/or warn us that even with the heater on we're still not warm enough and need to take additional action.

Solar Lux Sensor

On the roof of the RV is a sensor to detect the amount of light hitting the roof, which can be useful for keeping track of the efficiency of your solar panels. A sudden drop in power production from the panels for the same amount of light could mean your panel is going bad or something is covering it.

Media Center

Since you don't always have access to decent Internet, the RV has a separate RPi that serves as a Media Center. Specifically it runs RetroPie with the Kodi entertainment center plugin. This RPi is plugged into the RV's TV via HDMI and includes a 2.5" hard drive to store movies, TV shows, ROMs, or whatever else I want to bring with me to watch or play when Internet isn't otherwise available.

This RPi can be thought of as a "slave" to the hub RPi. As such, when the hub RPi begins the process of shutting down it informs this one via MQTT to also shut down so it doesn't get corrupted when the power is cut.

Audio

A nice Bluetooth speaker provides general audio/music to the RV beyond what is available from the head unit of the truck portion itself (which also has speakers that can play music all the way in the back of the RV).

Voice Control

An Echo Input is installed in the RV, connected to the aforementioned Bluetooth speaker and the RPi Hub to provide voice control of the RV when decent Internet is available. I will probably connect the Echo Input to a relay controlled by the RPi hub so that it can automatically turn off the device when it can't ping an outside IP (to prevent it from complaining it can't connect to the Internet if I accidently say something that sounds like "Alexa").

WiFi and Internet

Eventually I intend on installing a ToGo Roadlink WiFi system on the roof of the RV. In the meantime, I have a Asus router running DD-WRT firmware and connected to an off-the-shelf cellular modem. The DD-WRT firmware allows me to share the cell modem's Internet access over WiFi to the entire RV seamlessly. I am still looking into options for making a strong connection to any shore WiFi available via repeater of some sort.

⚠️ **GitHub.com Fallback** ⚠️