Disable device sleep

Good afternoon.
The problem with sleep is still very relevant, especially for homemade DIY devices. Can anyone help without interfering with the firmware, is there a solution?