Don’t know what to do with your spare time and itching for a grand DIY project? Why not try and make your own elevator using a $35 Raspberry Pi computer – following the instructions of someone who has already accomplished this, of course.
As it happens, a DIY enthusiast BorisDigital decided to try and design his own elevator using a Raspberry Pi 4, walking us through the entire process, from a pair of elevator control panels to a high-voltage control board for a hydraulic-powered lift system, in a YouTube video streamed on April 9.
Specifically, this engineer came up with a control panel in the elevator car featuring a Pi 4 inside, alongside a 5-inch display. He created the call-box that goes outside the elevator on each floor with a Raspberry Pi Pico 2W inside, and which communicates with the elevator panel using MQTT via WiFi.
The Pi elevator’s lift system is based on hydraulics, where mechanical movement is produced by a contained, pumped liquid. Instead of a big motor pulling the elevator car up, this version pumps fluid into a tube to push the elevator up, which is a popular lower-cost option for elevators for only a few floors.
Raspberry Pi elevator tools
To get started with his elevator project, Boris gathered together a water pump, some PVC pipes and tubing, and various fittings. Then he set about tinkering and hacking the parts together to eventually construct a prototype of a hydraulic elevator lift system.
He built a high-voltage board to control the hydraulics using another Pi Pico 2W microcontroller to power the relays that can switch 120 volts at up to 10 amps, which is more than enough for the hydraulic water pump and relief valve solenoid. It also communicates with the elevator car using MQTT over WiFi.
A tube for the piston which the elevator car rests on top of goes into a cylinder which, when pumped full of water under pressure from a reservoir, will cause the car to rise. To make the elevator go down, the relay turns off the pump and opens the relief valve, which causes the elevator to go down gently using its own weight.
Now, another motor is necessary for opening and closing the door. It can be connected to one of the other relays, and the control panel will handle running that motor as needed.
Raspberry Pi elevator assembly
Boris mocked up and breadboarded everything before his final build. On the mock-up of the main panel, he mounted the audio DAC and amplifier HAT under the display and connected them to the small stereo speakers. On the floor call panel, he placed the Pico microcontroller and buttons purchased from Adafruit.
He also used a piece of discarded plastic packaging with perfect depth to hold the buttons, as well as connected a 16×8 LED matrix display to the Pico via I2C. Then, Boris added the battery and the charging circuit. He also bought a plastic case for the main panel in just about the correct size. An alternative is to bolt two shorter ones together to make a larger one.
Instead of using the covers that came with the boxes and drilling holes in them, he decided to design and 3D-print custom covers. To make the panels look more like an elevator, he applied a very thin layer of sheet metal to the front of the units.
Assembly included soldering wires to the panel’s buttons and then attaching the front panel to the unit.
In the floor call button assembly, he placed the power switch and charging circuit with the battery underneath, mounting the matrix display on top. He then added the cover with the tinted plastic underneath and the Pico is visible at the very bottom of the case.
Finally, assembling the high-voltage board required using some very stiff wires and programming the main panel using Python.
Raspberry Pi elevator software
To help with the logic, Boris used a Python list to very loosely implement something called ‘the elevator algorithm’ which basically states to keep going in the same direction as long as possible and make every necessary stop along the way. He stepped through it over and over, skipping the steps that aren’t necessary, and repeating the current step over and over while the elevator is idle.
The main panel, the floor call buttons, and the high-voltage board all communicate with each other using MQTT, a lightweight network protocol for sending messages from one device to another. It requires software known as a ‘broker’ to route all the data packets where they need to go.
He used the broker called Mosquitto, which runs in a container along with all the other software in the panel, and all the containers running on the Pi are visible from an IoT management dashboard called balena.
A browser container runs a web browser in kiosk mode on the 5-inch display, showing a custom page from the container, which is a simple Express web server. The data on the page is updated in real-time using JavaScript.
There’s also an audio container that’s used to take care of routing audio and runs a PulseAudio server optimized for devices like the Pi.
All things considered, this is a cool project to show off. If you’d rather try your hand at something less demanding, you can embark on building your own Super Mario tune fidget toy, turning a pedal go-kart into an electric supercar for kids, making a plasma tube from a kombucha bottle, or making cheap light therapy gear.