Linear drive for a child's bed

Mon 17 May 2021

Arduino, Elektronik, Mechanik

Translations: DE

We will take a look on a electromechanically driven children’s bed which should help children find their sleep.

The finished bed


As many children pass through phases with their sleep cycles varying vastly from the ones of the general public, they deprive their parents from sleep.

The calming effect of rocking motions on children (and some adults) has been is known to mankind literally forever. The cribs or cots for infants have been in use for centuries.

A crib form wayback when (Public Domain)

But these mechanical contraptions use either the motions of a tossing and turning child or the parents muscles. This in turn is again not really helpful to the parents sleep budget. Also they limit the infants size as they take some room and children beyond a certain size (like our two yearold) will not quite fit the models available.

But it would be a welcome addition to a toddlers home to be comforted similar to what used to be a crib.

Modern technology that was meant to be used in 3D-Printers and CNC machines comes to a rescue! The ubiquity of this kind of machinery leads to its components being quite reasonable priced.


The mechanical structure is based on standardized aluminium profiles to make the assembly easier and provide sufficent stiffnes in the resulting construction. Also it remains moderately lighweight and it does not suffer from deformations due to environmental changes like wood does.

All self-designed parts, mostly used to fit standard parts (guide-rails, spindles, etc.) to the profiles, are 3D printed. These could also be produced using a mill.

Frame without the bed installed

Our son’s bed is mouted on top of a two frames connected with linear bearings. One part is situated on the floor, this one is built using 45mm aluminium profile with a 10mm groove. M12 feed allow levelling the whole contraption, compensating the four centimeter height difference in our old house.

Bed with frames and bearings

The second part, consisting of a bit smaller 30mm profile with 8mm groove. It is fixed to the bed using four M8 screws.

Both parts are connected using SBS20 linear guides and SBS20LUU bearings. These enable a smooth travel sideways.

Drive using using motor, pulley and spindle

The motion is enabled using a ball circulating spindle known as SFU1605-3. This is driven by a stepper motor (23HS2430), 1.8 degrees/step, 4.8V rated voltage, max. 3A/phase, via a belt/pulley system.

Motor vibrations are decoupled from the frame using a rubber damper, reducing the motor noise significantly.

Endstops are relaized using two reed contacts sitting on 3D-(mis)prints. Those sit underneath the spindle housing in the groove of the profile on the floor. The magnets are glued to the spindle housing. By moving the reed contacts on the floor profile makes the maximal travel adjustable reasonable easily.


In this project I took mostly modules to reduce the amount of things to worry about. An Arduino Nano provides the CPU.

A TMC5160 module drives the stepper motor, the chip the module is based upon enables a rather quiet fractional stepping. Normally PWM used in fractional stepping makes the motors howl and scream discomforting. It seems to use a kind of vector modulation scheme with spread spectrum, rendering the modulation noise virtually non-existant.

Unfortunately this does not mean you cannot hear the (partial-)steps, the motion control circuit does interpolation but this is still not totally silent. Therefore rubber damper were used on the mechanical side to bring down the noise.

Preliminarily assembled electronics

A standard case houses the controller and power supply, using DB-9 connectors for the endstops and XLR-5 for motor connection are rather robust and should be able to withstand the harsh environment of a child’s room. The power cord is affixed by a screwed cable grommet and should therefore and should therefore not pose a safety risk.


Currently, software is still quite early in its development. Especially the user interface is still non-existent but should be both enable sleep deprived parents to operate the device safely and not draw too much of the infants attention.

As of now, the motion control seems to be working reliably. Upon startup, the controller will move the bed to both endstops.

In rocking mode the travel can be limited to fractions of the maximal amount, leading to an increase in rocking frequency by keeping the maximal travel speed constant. Near the changeover points the speed is ramped up and down to avoid hard reversal. This would be both unpleasant for the unpleasant and noisy for the youngster and can also cause the motor to stall due to inertia resulting in disgusting noise.

The bed starts rocking with about 25 percent of the total travel, slowly reducing both travel and top speed over the course of two hours. This way the rocking slowly ceases and the sleep may come.


The frame, bearing, spindles and adapters have been sketched up in Solvespace. Please note, all the models are just a raw drafts. Things have evolved since drawing, so some profiles have been trimmed to fit the real world.

Also the drive train (motor, pulleys, belts) have not been modelled.

So, just for an inspiration and not the faint of heart you can find the designs here.