Skip to content

PicoSleep is a program that runs on raspberry pico and aims to help you fall asleep.

License

Notifications You must be signed in to change notification settings

laurentalacoque/picosleep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

picosleep - Raspberry pico sleep aid device

In brief

PicoSleep is a program that helps you fall asleep.

It runs on the raspberry pico platform and pulses the onboard led (or a soldered RGB led) with a slowly decreasing frequency.

Synchronize your breathing with the led pulses to decrease your heart and breathing rates and help yourself fall asleep.

Click to see it in action:

picoSleep with an RGB led and a star origami in action

Do yours!

Table of content

1. Get your raspberry pico and set it up

raspberry pico are inexpensive computing platforms that interact with the world.

See the official raspberry site to get one and set it up.

Here's a very brief and simple way to do it:

  • Buy a raspberry pico board (~ $4)
  • Download the official micropython UF2 image from raspberry.org (or directly here)
  • Connect it to a PC in media mode
    • connect the USB cable to your pico board
    • hold down the pico board BOOTSEL switch while you're plugin it to your PC
    • release the bootsel button when the pico board appears as a drive
    • drop the UF2 file you dowloaded on the drive and eject it
  • Install Thonny and configure it for the raspberry pico

2. Upload the source to your pico

There are several ways to do this, please refer to the official doc to understand how.

Keep in mind that you should upload two files on your raspberry:

  • pulseled.py (a helper module to deal with leds and pulsing)
  • main.py (the main program)

Once this is done, you can disconnect the pico and plug it again to a power source : the onboard green led should now be pulsing

picoSleep pulsing onboard led

Done : you can enjoy your sleep aid platform :)

3. Not satisfied ? Improve the PicoSleep with an RGB led

Get your RGB led

RGB Leds are inexpensive devices that can produce a colored light.

Try to find a LED reseller somewhere and keep in mind that you want a 4 pins led.

Here's what they look like:

RGB leds

The most important thing to note is that the longest pin is the ground and it should be soldered to a pico GND pin.

Insert your RGB led on the pico

  • At first, no need to solder anything, just insert your freshly bought RGB led in the pico holes labeled GP13 - GND - GP14 - GP15. The longest pin should go into the GND hole.

  • Make a slight change to main.py program by changing

    • USE_RGB_LED = False to
    • USE_RGB_LED = True
  • Disconnect and reconnect your pico : you should see the led change color at each breathing cycle

Satisfied ? Just solder the led to your pico board and voilà :)

Origami led cover

Although your PicoSleep is finished now, you may want to cover the led with a cover to contain and smoothen the led's light

I made an origami star led cover, see this tutorial for how to do it:

Origami led cover

Note: I used a 1.5 cm x 30 cm band of plain paper for the cover.

4. Tune things up

Most important parameters are at the top of main.py file, here's a description for them:

Breathing parameters

  • BREATHING_FREQ = (11, 5) controls the breathing rate at (start, end) of the experience. They're set to 11 breathing per minute at start down to 5 breathing per minute at end
  • DURATION = 10 controls the duration of the experience (10 mn by default)

Monochromous led parameters

  • LED_PIN = 25 the pin that controls the led (by default, this is the onboard led but you can solder any led between GND and GPxx and put the xx number here)
  • MAX_LIGHT = 255 the led maximum power in the range [1 - 255]

RGB led parameters

  • RGB_PINS = (13,14,15) the GPIOs where you soledered (respectively) the led's Red, Green and Blue pins

  • MAX_RGB_VALUE = 0.6 the maximum light power for the RGB led in the range [0 - 1.0]. Use this to tune the intensity of the RGB led.

  • MAX_RGB_LIGHT = (255,210,160) this is a preset of the relative power of each led and depends on the led maker and model and acts as a color balance. If you feel that the colors lack of Red, Green or Blue, try to change each channel intensity here (lack of blue ? increase the value 160 to 180. Too much green ? decrease the 210 value to 190...)

  • USE_RGB_LED = False whether to use the soldered RGB led (set this to True) or the onboard monochromous led (leave this to False)

About

PicoSleep is a program that runs on raspberry pico and aims to help you fall asleep.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages