![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg1.png)
PyPortal Wake-Up Light Alarm Clock
Created by Isaac Wellish
Last updated on 2021-03-17 01:18:26 PM EDT
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg2.png)
2
3
3
3
6
10
11
11
12
15
15
16
17
17
18
18
18
22
24
25
26
27
30
30
34
36
36
36
37
37
37
38
38
39
39
39
40
42
42
44
Guide Contents
Guide Contents
Overview
Prerequisite guides
Parts
Other parts
Other materials
Connect Electronics
Connect without soldering
Connect by soldering:
Install CircuitPython
Set up CircuitPython Quick Start!
PyPortal Default Files
PyPortal CircuitPython Setup
Adafruit CircuitPython Bundle
Internet Connect!
What's a secrets file?
Connect to WiFi
Requests
HTTP GET with Requests
HTTP POST with Requests
Advanced Requests Usage
WiFi Manager
Code PyPortal With CircuitPython
CircuitPython Code
Downloading the libraries
Using the Wake-Up Light
Here's an example of the wake-up light in use (for a late riser...)
Before wake-up time
During wake-up time
After wake-up time
How it works
Displaying text
Text position
Font
Text color
Initializing wake-up times
Main loop
Affixing the Strip
Attaching strip to bed frame or other furniture
Adding features
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 2 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg3.png)
Overview
Do you suffer from a lack of natural sunlight in your room? Does the lack of sunlight make it almost
impossible to get out of bed when you hear a dreadful alarm?
Yes, windows would be nice, but we live in New York City and who needs those when you got a PyPortal
and a NeoPixel strip?
In this project, you can wake up to a soft white light fading into your consciousness! You could get a
consumer grade sunrise alarm clock (https://adafru.it/FqP) that may solve your problem but you can also
do it yourself!
Using a PyPortal, and a NeoPixel strip, make a sunrise alarm clock that wakes you up with light! Program
the PyPortal with CircuitPython to set your wake-up times and the strip will begin to brighten 30 minutes
before your wake-up time.
Prerequisite guides
This project may require some soldering depending on the NeoPixel strip you get. Here's a great guide on
soldering if it's your first time or you need some refreshing!
Adafruit Guide To Excellent Soldering (https://adafru.it/dxy)
Parts
You can pick up an Adafruit PyPortal and a USB cable (if needed). If you like, you can mount the PyPortal
in the Adafruit laser-cut acrylic stand. All these parts are bundled in AdaBox 011 if you'd like to buy them
together.
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 3 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg4.png)
AdaBox011 - PyPortal
Reach out beyond your desk - to the stars and beyond - with PyPortal! This ADABOX features a new,
easy-to-use IoT device that allows you to customize and create your...
Out of Stock
Instead of AdaBox 011, you can buy parts separately:
Out of
Stock
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 4 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg5.png)
Adafruit PyPortal - CircuitPython Powered Internet Display
PyPortal, our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in
minutes. Make custom touch screen interface...
Out of Stock
Out of
Stock
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 5 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg6.png)
USB cable - USB A to Micro-B
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your
Metro, Feather, Raspberry Pi or other dev-board or...
$2.95
In Stock
Adafruit PyPortal Desktop Stand Enclosure Kit
PyPortal is our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in
minutes. Create little pocket...
$9.95
In Stock
Other parts
You only need 1m of neopixel strip (https://adafru.it/FqQ):
Your browser does not support the video tag.
Adafruit NeoPixel Digital RGBW LED Strip - White PCB 30 LED/m
What is better than smart RGB LEDs? Smart RGB+White LEDs! These NeoPixels now have 4 LEDs in them
(red, green, blue and white) for excellent lighting effects. These LED...
$89.75
In Stock
Add to Cart
Add to Cart
Add to Cart
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 6 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg7.png)
STEMMA JST PH 3-Pin to Male Header Cable - 200mm
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" male
header plugs on the end. We're carrying these to match up with our...
Out of Stock
Out of
Stock
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 7 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg8.png)
Breadboarding wire bundle
75 flexible stranded core wires with stiff ends molded on in red, orange, yellow, green, blue, brown, black
and white. These are a major improvement over the "box of bent...
$4.95
In Stock
Small Alligator Clip Test Lead (set of 12)
Connect this to that without soldering using these handy mini alligator clip test leads. 15" cables with
alligator clip on each end, color coded. You get 12 pieces in 6 colors....
$3.95
In Stock
Add to Cart
Add to Cart
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 8 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bg9.png)
Hook-up Wire Spool Set - 22AWG Stranded-Core - 6 x 25ft
This is a box of six 25ft spools of stranded-core wire. Stranded-core wire is best used for wiring jigs where
there's...
Out of Stock
Out of
Stock
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 9 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bga.png)
Premium Female/Female Jumper Wires - 40 x 6"
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires
approximately 6" (150mm) long and come in a 'strip' of 40 (4 pieces...
Out of Stock
5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering singleboard computers like Raspberry Pi, BeagleBone or anything else that's power...
$7.50
In Stock
Other materials
single-sided tape
foam tape
hot glue gun and sticks
a bed frame or dresser to attach NeoPixel strip to
Out of
Stock
Add to Cart
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 10 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bgb.png)
Connect Electronics
First we'll connect the electronics before we add the code and attach the strip to a bed frame (or another
piece of furniture).
Because these specific NeoPixel strips (https://adafru.it/FqQ) come in 5 meter reels, if you order 1m of reel
you may get a piece of reel in the middle and thus may have to solder to the pads of the strip. Here are
the two possibilities of strip end you may get and how to connect to the PyPortal with each.
Connect without soldering
If the data in end of your neopixel strip looks like this, connect
wires the following way.
The data in end of a NeoPixel strip is the end where the arrows on the strip are pointing away from.
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 11 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bgc.png)
Attach the JST connector to D3 on the back of the
PyPortal.
Plug the white and black cables into the corresponding
inputs on the NeoPixel strip.
Connect the alligator clips from the red JST cable to the
red NeoPixel cable.
Connect by soldering:
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 12 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bgd.png)
Here's a great guide to soldering (https://adafru.it/dxy) for your reference.
If the data in end of your NeoPixel strip looks like this,
connect wires the following way.
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 13 of 45
![](/html/11/1121/1121cd25c77e8fe605636b5637d0cb881fe9c7e893f3dccf5a2554b8132cc95f/bge.png)
Prep 3 wires, preferable a red, black and white.
Solder red to 5V, white to Din and black to GND on the
neopixel strip.
Attach the JST connector to D3 on the back of the
PyPortal.
Connect the female breadboard cables from the
PyPortal to the NeoPixel strip.
© Adafruit Industries https://learn.adafruit.com/pyportal-wake-up-light Page 14 of 45