# Adafruit QT Py Activity Timer and Hydration Reminder

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/096/228/medium800thumb/leds_QT_Py_Timer_activity_timer_flip_to_start.jpg?1603728428)

It's easy to get focused on a task, and forget to take a break, or even eat lunch. Perhaps you find that you aren't drinking enough water throughout the day. Sometimes you simply need some assistance remembering things! This project is here to help.

This guide will show you how to build a customisable LED timer using the Adafruit QT Py, the LIS3DH accelerometer, and two NeoPixel LED rings. It's meant to be compact and sit on your desk. The rings light up to let you know the timer is running. Set it on its side to turn off the timers and the LEDs.

For the activity timer, you'll set a duration for two different activities, such as 120 minutes of work and a 15 minute break. Plug it in, start the timer and it will gently fade between two colors to let you know time is passing. When it reaches the end it stays at that color for a bit before blinking at you to remind you that you haven't moved to the next task. Flip it over to begin the second timer, and the process repeats.

For the hydration reminder, you set the interval you'd like to be reminded to drink water, such as once every 60 minutes. Plug it in, start the timer, and the process is the same as the activity timer. In this case, when you flip it over, it counts down the same amount of time.

## Parts

This build uses the 50mm long STEMMA QT cable listed below. The [100mm long STEMMA QT cable](https://www.adafruit.com/product/4210)would also work, but would require taming the extra cable length.

### Adafruit QT Py - SAMD21 Dev Board with STEMMA QT

[Adafruit QT Py - SAMD21 Dev Board with STEMMA QT](https://www.adafruit.com/product/4600)
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with our favorite lil chip, the SAMD21 (as made famous in our GEMMA M0 and Trinket M0 boards).

This time it comes with [our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C...

In Stock
[Buy Now](https://www.adafruit.com/product/4600)
[Related Guides to the Product](https://learn.adafruit.com/products/4600/guides)
![Animation of Adafruit QT Py with onboard NeoPixel in a rainbow swirl.](https://cdn-shop.adafruit.com/product-videos/640x480/4600-07.jpg)

### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
![Hand holding NeoPixel Ring with 16 x 5050 RGB LED, lit up rainbow](https://cdn-shop.adafruit.com/640x480/1463-00.jpg)

### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)
![Top down view of a Adafruit LIS3DH Triple-Axis Accelerometer.](https://cdn-shop.adafruit.com/640x480/2809-08.jpg)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
![Angled of of JST SH 4-Pin Cable.](https://cdn-shop.adafruit.com/640x480/4399-00.jpg)

### Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft

[Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft](https://www.adafruit.com/product/1311)
Perfect for bread-boarding, free wiring, etc. This box contains 6 spools of solid-core wire. The wire is easy to solder to and when bent it keeps its shape pretty well. We like to have a few spools of this stuff around which is why this set is quite nice! We suggest picking up wire strippers...

In Stock
[Buy Now](https://www.adafruit.com/product/1311)
[Related Guides to the Product](https://learn.adafruit.com/products/1311/guides)
![Hook-up Wire Spool Set in box with 6 colorful wires coming out](https://cdn-shop.adafruit.com/640x480/1311-04.jpg)

### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
![Angled shot of a coiled black, USB-C to USB-A cable.](https://cdn-shop.adafruit.com/640x480/4474-02.jpg)

# Adafruit QT Py Activity Timer and Hydration Reminder

## Assembly

![](https://cdn-learn.adafruit.com/assets/assets/000/096/188/medium800/leds_QT_Py_Timer_assembled_side.jpg?1603310376)

The following shows how the parts are wired together. Assembly of the timer involves some creative use of wire length to suspend the QT Py and LIS3DH between the two rings.

- **Data In on ring one** to **A3 on QT Py**
- **V+ on ring one** to **5V on QT Py**
- **Gnd on ring one** to **GND on QT Py**
- **Gnd on ring two** to **GND on ring one**
- **V+ on ring two** to **V+ on ring one**
- **Data In on ring one** to **Data Out on ring two**
- **LIS3DH** to **QT Py** using **STEMMA QT cable**

![leds_QT_Py_Activity_Timer_bb.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/162/medium640/leds_QT_Py_Activity_Timer_bb.jpg?1603224971)

![](https://cdn-learn.adafruit.com/assets/assets/000/096/189/medium800/leds_QT_Py_Timer_parts.jpg?1603310530)

## Assembly
Begin by soldering the three wires to each ring, using piece of wire 5-6 inches in length.

Solder the **blue wire** to **In (data input)**, the **black wire** to **G (power signal ground)**, and the **red wire** to **V+ (power 5V DC)** on both rings. Solder the data input wire first, and follow the pattern indicated in the second image where green indicates the through-hole to use to solder the wire, and red indicates a through-hole to skip.

Trim any excess wire sticking up above the LEDs.

Choose a ring to be ring one.

![leds_QT_Py_Timer_rings_soldered.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/190/medium640/leds_QT_Py_Timer_rings_soldered.jpg?1603310577)

![leds_QT_Py_Timer_ring_solder_pattern.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/199/medium640/leds_QT_Py_Timer_ring_solder_pattern.jpg?1603311606)

Bend the wires on ring one to match the locations of the pins on the QT Py, with enough wire to suspend the QT Py above the ring.

The **blue wire** should match **A3** , the **red wire** should match **5V** and the **black wire** should match **GND**.

Make sure the QT Py is parallel to the ring - if you lay the ring flat on your desk, the QT Py should also be horizontal.

Solder the wires to the QT Py.

![leds_QT_Py_Timer_ring_one_ready_for_board_top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/194/medium640/leds_QT_Py_Timer_ring_one_ready_for_board_top.jpg?1603310844)

![leds_QT_Py_Timer_ring_one_ready_for_board_angle.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/195/medium640/leds_QT_Py_Timer_ring_one_ready_for_board_angle.jpg?1603310885)

![leds_QT_Py_Timer_QT_Py_ready_to_solder.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/196/medium640/leds_QT_Py_Timer_QT_Py_ready_to_solder.jpg?1603310955)

On ring two, bend the signal (blue) and ground (black) wires around the ring so they match the Data Out and GND pins on ring one. You can hold the rings together to line up the wires and bend them until they are correct.

The red wire does not need to be bent and can connect directly from ring two to ring one.

Trim the wires so less than an inch is sticking up from the ring. The lengths should all be equal.

Solder ring two to ring one with the **blue wire** to **Out** **(data output)**, the **black wire** to **G (power signal ground)**, and the **red wire** to **V+ (power 5V DC)**.

Trim any excess wire sticking up above the LEDs.

![leds_QT_Py_timer_prep_ring_two.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/197/medium640/leds_QT_Py_timer_prep_ring_two.jpg?1603311045)

![leds_QT_Py_Timer_ring_two_ready.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/198/medium640/leds_QT_Py_Timer_ring_two_ready.jpg?1603311586)

![leds_QT_Py_Timer_solder_ring_two_side.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/200/medium640/leds_QT_Py_Timer_solder_ring_two_side.jpg?1603311894)

![leds_QT_Py_timer_solder_ring_two_top.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/201/medium640/leds_QT_Py_timer_solder_ring_two_top.jpg?1603311944)

Gather the soldered QT Py and ring assembly, the double-sided foam tape, the STEMMA cable and the LIS3DH.

Attach the double-sided foam tape to the QT Py. This version required layering two pieces of foam tape together.

Plug the LIS3DH into the QT Py using the STEMMA QT connectors and cable.

Wind the cable and the LIS3DH through the rings so the cable is to the side of the LIS3DH and QT Py.

Use double-sided foam tape to attach the LIS3DH to the back of the QT Py. The LIS3DH should also be parallel to the rings - when you set the timer on the front of either of the rings, the LIS3DH and QT Py should both be horizontal.

You're ready to start timing!

![leds_QT_Py_Timer_ready_LIS3DH.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/202/medium640/leds_QT_Py_Timer_ready_LIS3DH.jpg?1603312103)

![leds_QT_Py_Timer_foam_tape.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/205/medium640/leds_QT_Py_Timer_foam_tape.jpg?1603312413)

![leds_QT_Py_Timer_attach_LIS3DH_STEMMA_cable.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/206/medium640/leds_QT_Py_Timer_attach_LIS3DH_STEMMA_cable.jpg?1603312494)

![leds_QT_Py_Timer_wrap_STEMMA_cable.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/207/medium640/leds_QT_Py_Timer_wrap_STEMMA_cable.jpg?1603312569)

![leds_QT_Py_Timer_assembled_side.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/208/medium640/leds_QT_Py_Timer_assembled_side.jpg?1603312622)

## Optional Diffusers

NeoPixel LEDs are quite bright. It's possible to control the brightness using CircuitPython, but you may also want to add diffusers to the rings. Here is a simple way to add some physical diffusion to the LEDs on the timer.

Get some double-sided tape and a piece of white or similarly light colored card stock, or other thicker paper product.

Use a ring as a guide to cut two circles out of card stock. Cut two strips the same length as the diameter of the circles, and round the corners of the strips.

![leds_QT_Py_Timer_diffuser_parts.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/209/medium640/leds_QT_Py_Timer_diffuser_parts.jpg?1603312762)

Use a piece double-sided tape in the center of each strip to attach the strips to the circles.

Gently bend the strips away from the circles on each end to make two flaps on each diffuser.

![leds_QT_Py_Timer_diffusers_assembled.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/210/medium640/leds_QT_Py_Timer_diffusers_assembled.jpg?1603313005)

Slip the flaps inside the ring to attach the diffuser to the ring. Orient them so the flaps are not blocking the USB port on the QT Py.

That's it!

![leds_QT_Py_Timer_with_diffusers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/096/211/medium640/leds_QT_Py_Timer_with_diffusers.jpg?1603313126)

# Adafruit QT Py Activity Timer and Hydration Reminder

## CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## Set up CircuitPython Quick Start!

Follow this quick step-by-step for super-fast Python power :)

If you want to get started with your QT Py, and you have NOT soldered a chip to the back of it, download CircuitPython from the following link:

[Download the latest version of CircuitPython for your QT Py from CircuitPython.org](https://circuitpython.org/board/qtpy_m0/)
Warning: 

[Download the latest version of CircuitPython for your QT Py Haxpress from CircuitPython.org](https://circuitpython.org/board/qtpy_m0_haxpress/)
 **Click the link above and download the latest UF2 file.**

Download and save it to your desktop (or wherever is handy).

![adafruit_products_QT_Py_CP_download.png](https://cdn-learn.adafruit.com/assets/assets/000/095/209/medium640/adafruit_products_QT_Py_CP_download.png?1601397466)

Plug your QT Py into your computer using a known-good USB cable.

**A lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.**

Double-click the small **RST (reset)** button, and you will see the NeoPixel RGB LED turn green. If it turns red, check the USB cable, try another USB port, etc.

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

![adafruit_products_QT_Py_neopixel_green.png](https://cdn-learn.adafruit.com/assets/assets/000/095/210/medium640/adafruit_products_QT_Py_neopixel_green.png?1601397596)

You will see a new disk drive appear called **QTPY\_BOOT**.

&nbsp;

&nbsp;

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to&nbsp; **QTPY\_BOOT**

![adafruit_products_QT_Py_BOOT_drive.png](https://cdn-learn.adafruit.com/assets/assets/000/095/211/medium640/adafruit_products_QT_Py_BOOT_drive.png?1601400747)

![adafruit_products_QT_Py_drag_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/095/212/medium640/adafruit_products_QT_Py_drag_UF2.png?1601400759)

The red LED will flash. Then, the **QTPY\_BOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![adafruit_products_QT_Py_CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/095/213/medium640/adafruit_products_QT_Py_CIRCUITPY.png?1601400772)

# Adafruit QT Py Activity Timer and Hydration Reminder

## CircuitPython Libraries

The QT Py Activity Timer and Hydration Reminder requires some CircuitPython libraries to work. Complete the following steps to get your board ready.

## CircuitPython Library Bundle

You'll need to install the&nbsp;[Adafruit CircuitPython NeoPixel](https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel) and [Adafruit CircuitPython LIS3DH](https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH) libraries and their dependencies on your QT Py.

Carefully follow the steps to find and install these libraries from [Adafruit's CircuitPython Library Bundle](https://circuitpython.org/libraries).&nbsp; Our CircuitPython starter guide has [a great page on how to install libraries from the bundle](https://learn.adafruit.com/welcome-to-circuitpython/circuitpython-libraries).

You'll want to manually install the following libraries by copying the files to the **lib** folder on your **CIRCUITPY** drive:

- **adafruit\_bus\_device**
- **adafruit\_lis3dh.mpy**
- **adafruit\_pypixelbuf.mpy**
- **neopixel.mpy**

Before continuing make sure your board's **lib** folder or root filesystem has the **adafruit\_bus\_device** , **adafruit\_lis3dh.mpy** , **neopixel.mpy** , and&nbsp; **adafruit\_pypixelbuf.mpy** files copied over.

![leds_one_one_one.png](https://cdn-learn.adafruit.com/assets/assets/000/125/975/medium640/leds_one_one_one.png?1699565103)

## Library Install Troubleshooting

If you get an error indicating you have run out of space while copying files over, please refer to the [Prevent & Remove MacOS Hidden Files section of the Troubleshooting page](https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting#prevent-and-remove-macos-hidden-files-2978468-47) for information on resolving the issue.

# Adafruit QT Py Activity Timer and Hydration Reminder

## Activity Timer

![](https://cdn-learn.adafruit.com/assets/assets/000/096/220/medium800/leds_QT_Py_Timer_activity_reminder.jpg?1603319833)

The QT Py Activity Timer is meant to time two separate activities, such as working and taking a break. Flip it to begin timing the first activity, such as working for 120 minutes. The timer will count down by fading the LEDs from one color to another, at which point it gives you a moment to flip it before blinking at you to let you know you haven't moved onto the next activity. Flip it to begin timing the next activity, such as a 15 minute break. The process repeats. You can customise the colors and timing to fit your aesthetics and needs. Flip it on its side to stop both timers and turn off the LEDs. Let's get timing!

![](https://cdn-learn.adafruit.com/assets/assets/000/126/080/medium800/leds_one_one_one.png?1700078179)

## Code

Save the following to your **CIRCUITPY** drive as **code.py** :

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/QT_Py/QT_Py_Timer/QT_Py_Activity_Timer/code.py

## Settings and Customizations

The timer defaults to a 120 minute timer when facing up (LIS3DH on top), and 15 minutes when facing down (QT Py on top). Both timers begin green and fade to red, before entering Red Alert and beginning to blink.

If you're happy with the project as-is, you don't need to make any changes. If you'd like to customize it, you have the following options.

- `activity_one` - The length of time in minutes for the first activity. Defaults to 120 minutes (2 hours).
- `activity_two` - The length of time in minutes for the second activity. Defaults to 15 minutes.
- `red_alert_delay` - The length of time in minutes the timer shows the final color solid before blinking to remind you to move to the next activity. Defaults to 2 minutes. If you flip the the timer within this time, the blinking will not start.
- `color_begin` - The color the LEDs begin when the timer begins. Timer fades from `color_begin` to `color_complete` to indicate time passing.
- `color_complete` - The color the LEDs end when the timer ends. This is also the color that blinks during Red Alert. Timer fades from `color_begin` to `color_complete` to indicate time passing.
- `led_brightness` - The brightness of the LEDs. If you add a diffuser to the project, you may want to make them brighter. Must be a number between 0.0 and 1.0 where 0.0 is 0% (off), and 1.0 is 100% brightness, e.g. 0.3 would be 30% brightness.
- `red_alert_blink_speed` - This is the speed in seconds of the blinking during Red Alert. Defaults to blinking on and off every 0.5 seconds. If you'd like it to be faster, decrease this number. To slow it down, increase the number.

The z-axis values are used to determine the orientation of the timer. The thresholds used in the code assume the LIS3DH is mounted horizontally within the timer, and that the timer is sitting flat. As it doesn't weigh much, the USB cable can sometimes pull it on an angle. If you find the timer isn't running when you want it to because you can't get the timer oriented properly, you can alter these values based on the z-axis values you're getting.

- `down_threshold` - The z-axis value must be less than this for the timer to start when in the down orientation. Defaults to -8.
- `up_threshold` - The z-axis value must be greater than this for the timer to start when in the up orientation. Defaults to 8.

If you used the parts suggested in the guide, you do not need to change the following. But, in the event you're using a different form of NeoPixels, you can update the following:

- `number_of_pixels` - The total number of LEDs connected to your QT Py.

## Using the Activity Timer

Plug it in to begin. It starts in idle mode. Flip it to the side that matches the activity you'd like to begin timing.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/221/medium800thumb/leds_QT_Py_Timer_activity_timer_flip_to_start.jpg?1603319890)

The timer will begin. By default it fades from green to red.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/222/medium800thumb/leds_QT_Py_Timer_activity_timer_active.jpg?1603728476)

If you don't do anything when the timer is up, it will enter Red Alert mode and begin blinking.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/223/medium800thumb/leds_QT_Py_Timer_activity_timer_red_alert.jpg?1603319949)

Flip it over at any time to start the timer for the next activity.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/224/medium800thumb/leds_QT_Py_Timer_activity_timer_flip_to_restart.jpg?1603728491)

Flip it on its side to stop both of the timers and turn off the LEDs.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/225/medium800thumb/leds_QT_Py_Timer_activity_timer_sideways_idle.jpg?1603728499)

# Adafruit QT Py Activity Timer and Hydration Reminder

## Hydration Reminder

![](https://cdn-learn.adafruit.com/assets/assets/000/096/219/medium800/leds_QT_Py_Timer_hydrration_reminder.jpg?1603319814)

The QT Py Hydration Reminder is designed to track a time interval to remind you to stay hydrated. Flip it to begin. The timer will count down by fading the LEDs from one color to another, at which point it gives you a moment to flip it before blinking at you to let you know you haven't taken a drink. Flip it to begin the next interval. The process repeats. You can customise the colors and timing to fit your aesthetics and needs. Flip it on its side to stop the timer and turn off the LEDs. Let's get hydrated!

![](https://cdn-learn.adafruit.com/assets/assets/000/126/081/medium800/leds_one_one_one.png?1700078201)

## Code

Save the following to your **CIRCUITPY** drive as **code.py** :

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/QT_Py/QT_Py_Timer/QT_Py_Hydration_Reminder/code.py

## Settings and Customizations

The timer defaults to a 120 minute timer when facing up (LIS3DH on top), and 15 minutes when facing down (QT Py on top). Both timers begin green and fade to red, before entering Red Alert and beginning to blink.

If you're happy with the project as-is, you don't need to make any changes. If you'd like to customize it, you have the following options.

- `hydration_reminder` - The length of the reminder interval in minutes. Defaults to 60 minutes (one hour).
- `red_alert_delay` - The length of time in minutes the timer shows the final color solid before blinking to remind you to take a drink. Defaults to 2 minutes. If you flip the the timer within this time, the blinking will not start.
- `color_begin` - The color the LEDs begin when the timer begins. Timer fades from `color_begin` to `color_complete` to indicate time passing.
- `color_complete` - The color the LEDs end when the timer ends. This is also the color that blinks during Red Alert. Timer fades from `color_begin` to `color_complete` to indicate time passing.
- `led_brightness` - The brightness of the LEDs. If you add a diffuser to the project, you may want to make them brighter. Must be a number between 0.0 and 1.0 where 0.0 is 0% (off), and 1.0 is 100% brightness, e.g. 0.3 would be 30% brightness.
- `red_alert_blink_speed` - This is the speed in seconds of the blinking during Red Alert. Defaults to blinking on and off every 0.5 seconds. If you'd like it to be faster, decrease this number. To slow it down, increase the number.

The z-axis values are used to determine the orientation of the timer. The thresholds used in the code assume the LIS3DH is mounted horizontally within the timer, and that the timer is sitting flat. As it doesn't weigh much, the USB cable can sometimes pull it on an angle. If you find the timer isn't running when you want it to because you can't get the timer oriented properly, you can alter these values based on the z-axis values you're getting.

- `down_threshold` - The z-axis value must be less than this for the timer to start when in the down orientation. Defaults to -8.
- `up_threshold` - The z-axis value must be greater than this for the timer to start when in the up orientation. Defaults to 8.

If you used the parts suggested in the guide, you do not need to change the following. But, in the event you're using a different form of NeoPixels, you can update the following:

- `number_of_pixels` - The total number of LEDs connected to your QT Py.

## Use the Hydration Reminder

Plug it in to begin. It starts in idle mode. Flip it over to start the timer.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/212/medium800thumb/leds_QT_Py_Timer_hydration_reminder_flip_to_start.jpg?1603319265)

The timer will begin. By default, it will fade from blue to white.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/214/medium800thumb/leds_QT_Py_Timer_hydration_reminder_timer_active.jpg?1603319341)

If you don't do anything when the timer is up, it will enter Red Alert mode and begin blinking.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/215/medium800thumb/leds_QT_Py_Timer_hydration_reminder_red_alert.jpg?1603728323)

Flip it over at any time to restart the timer.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/217/medium800thumb/leds_QT_Py_Timer_hydration_reminder_flip_to_restart.jpg?1603319439)

Flip it on its side to stop the timer and turn off the LEDs.

![](https://cdn-learn.adafruit.com/assets/assets/000/096/218/medium800thumb/leds_QT_Py_Timer_hydration_reminder_sideways_idle.jpg?1603728375)


## Featured Products

### Adafruit QT Py - SAMD21 Dev Board with STEMMA QT

[Adafruit QT Py - SAMD21 Dev Board with STEMMA QT](https://www.adafruit.com/product/4600)
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with our favorite lil chip, the SAMD21 (as made famous in our GEMMA M0 and Trinket M0 boards).

This time it comes with [our favorite connector - the STEMMA QT](http://adafruit.com/stemma), a chainable I2C...

In Stock
[Buy Now](https://www.adafruit.com/product/4600)
[Related Guides to the Product](https://learn.adafruit.com/products/4600/guides)
### Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)

[Adafruit LIS3DH Triple-Axis Accelerometer (+-2g/4g/8g/16g)](https://www.adafruit.com/product/2809)
The **LIS3DH** &nbsp;is a very popular low power **triple-axis accelerometer**. It's low-cost, but has just about every 'extra' you'd want in an accelerometer:

- Three axis sensing, 10-bit...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2809)
[Related Guides to the Product](https://learn.adafruit.com/products/2809/guides)
### NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers

[NeoPixel Ring - 16 x 5050 RGB LED with Integrated Drivers](https://www.adafruit.com/product/1463)
Round and round and round they go! 16 ultra bright smart LED NeoPixels are arranged in a circle with 1.75" (44.5mm) outer diameter. The rings are 'chainable' - connect the output pin of one to the input pin of another. Use only one microcontroller pin to control as many as you can...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1463)
[Related Guides to the Product](https://learn.adafruit.com/products/1463/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 50mm Long](https://www.adafruit.com/product/4399)
This 4-wire cable is&nbsp;50mm / 1.9" long and fitted with JST SH female 4-pin connectors on both ends. Compared with the chunkier JST PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4399)
[Related Guides to the Product](https://learn.adafruit.com/products/4399/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft

[Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft](https://www.adafruit.com/product/1311)
Perfect for bread-boarding, free wiring, etc. This box contains 6 spools of solid-core wire. The wire is easy to solder to and when bent it keeps its shape pretty well. We like to have a few spools of this stuff around which is why this set is quite nice! We suggest picking up wire strippers...

In Stock
[Buy Now](https://www.adafruit.com/product/1311)
[Related Guides to the Product](https://learn.adafruit.com/products/1311/guides)
### USB C to USB C Cable - USB 3.1 Gen 4 with E-Mark - 1 meter long

[USB C to USB C Cable - USB 3.1 Gen 4 with E-Mark - 1 meter long](https://www.adafruit.com/product/4199)
As technology changes and adapts, so does Adafruit! Rather than the regular USB A, this cable has&nbsp; **USB C to USB C** &nbsp;plugs!

USB C is the latest industry-standard connector for transmitting data&nbsp;_and_&nbsp;power. Like Lightning and MagSafe cables, USB C...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4199)
[Related Guides to the Product](https://learn.adafruit.com/products/4199/guides)
### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)

## Related Guides

- [Adafruit QT Py SAMD21](https://learn.adafruit.com/adafruit-qt-py.md)
- [NeoPixel Jack-o-lantern](https://learn.adafruit.com/neopixel-jack-o-lantern.md)
- [Ursula's Seashell Necklace](https://learn.adafruit.com/ursulas-seashell-necklace.md)
- [Superhero Power Gauntlet](https://learn.adafruit.com/superhero-power-gauntlet.md)
- [Gemma Color Touch Pendant Necklace](https://learn.adafruit.com/gemma-color-touch-pendant-necklace.md)
- [Unibeam](https://learn.adafruit.com/unibeam.md)
- [3D Printed LED Microphone Flag](https://learn.adafruit.com/3d-printed-led-microphone-flag.md)
- [NeoPixel LED Cortana Costume](https://learn.adafruit.com/neopixel-led-cortana-costume.md)
- [CircuitPython Hardware: LIS3DH Accelerometer](https://learn.adafruit.com/circuitpython-hardware-lis3dh-accelerometer.md)
- [LED Rocket Lamp](https://learn.adafruit.com/led-rocket-lamp.md)
- [GEMMA Hoop Earrings](https://learn.adafruit.com/gemma-hoop-earrings.md)
- [Adafruit Feather RP2040 with DVI Output Port](https://learn.adafruit.com/adafruit-feather-rp2040-dvi.md)
- [CircuitPython Media Dial](https://learn.adafruit.com/media-dial.md)
- [2014 Halloween 3D Printed Projects Roundup](https://learn.adafruit.com/2014-halloween-3d-printed-projects-roundup.md)
- [NeoPixie Dust Bag](https://learn.adafruit.com/neopixel-pixie-dust-bag.md)
- [micro:bit Lesson 3. NeoPixels with micro:bit](https://learn.adafruit.com/micro-bit-lesson-3-neopixels-with-micro-bit.md)
