Skip to main content

How we run Home Assistant on a Raspberry Pi in our camper van

To make life in our van just a little nicer we have a Home Assistant instance running on a Raspberry Pi 5. It’s nice to see how the van is doing at a glance, but it’s the automatons that are really great. Building it was not necessarily straightforward though, so here’s a list of all the sensors that we have connected at the moment.

XL9535 16 Channel Relay Board

This relay board allows switching up to 10 amps at 12 volt on each of the 16 relays. Switching lights, water pumps, etc. Technically you can even run multiple of these boards to control even more devices.

Communicates on I2C, runs directly on 5v from the pi.

Costs about €12.

DS18B20 Temperature Sensor Probes

Simple to run anywhere and calibrated at the factory. Multiple sensors can share the same data line (hence “one wire”). We have one at eye level so we have an accurate reading of the indoor temperature, and one is bolted to the frame of the van so we know the frame temperature.

Uses the one wire (w1) protocol, which the pi natively supports on GPIO4 if you add dtoverlay=w1-gpio to /boot/config.txt However, you need to put a pull-up 4,7K resistor between the data line and the 3,3v line.

Costs about €2.

VanTurtle fan controller

Of course we can’t skip the board we created ourselves, but we really do use it in our van. Allows direct control over our Maxxair fans which we automate with the temperature sensors. Please give it a look if your interested!

Works with the I2C bus. Runs on 3,3v or 5v.

Costs €19,99.

JSN-SR04T Waterproof Ultrasonic Sensor

Mounted inside the water tank, measures the distance between the sensor and the water level. You can then calculate the volume of water in the tank. Has a deadzone if the distance is less than 25cm, so anything between 80% and 100% is always reported as 100%.

Works by pulling the trigger wire high, and the sensor will then pull the echo wire high immediately. Echo goes low when the signal is received, you have to measure the time it took to get the distance. The echo is at 5v but the pi can only handle 3.3v as input, so you need to use two resistors to make a voltage divider.

Costs about €4.

MPU6050 Gyro + Accelerometer

The accelerometer in the MPU6050 detects which way is down which is super handy if you want to park the van level. It seems to be accurate enough to about one degree of rotation. As a bonus the gyro detects if the vehicle is in motion, great for triggering automatons.

Communicates on I2C, runs directly on the 3.3v from the pi.

Costs about €2.

BMP280 Humidity + Pressure Sensor

Gives accurate readings on humidity, pressure and temperature. Temperature is self explanatory, humidity is super important to know in winter to keep an eye on condensation. We use the pressure readings as an altimeter.

Communicates on I2C or SPI, runs directly on 3.3v or 5v from the pi.

Costs about €3.