# PyLeap CLUE Sensor Plotter

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/115/280/medium800thumb/sensors_allSensorsDbl.jpg?1663782945)

https://youtube.com/shorts/PCWj6HKdfuk

The CLUE has tons of onboard sensors that can sense movement, light, sound and environmental measures like temperature and humidity. This project uploads code to the CLUE using PyLeap that uses the CLUE's onboard display to plot all of the sensors' data.

This project was originally created by Kevin Walters. The original Learn Guide can be found [here](https://learn.adafruit.com/clue-sensor-plotter-circuitpython).

[Original CLUE Sensor Plotter in CircuitPython Learn Guide](https://learn.adafruit.com/clue-sensor-plotter-circuitpython)
## Parts
### Adafruit CLUE - nRF52840 Express with Bluetooth® LE

[Adafruit CLUE - nRF52840 Express with Bluetooth® LE](https://www.adafruit.com/product/4500)
Do you feel like you just don't have a CLUE? Well, we can help with that - get a CLUE here at Adafruit by picking up this sensor-packed development board. We wanted to build some projects that have a small screen and a lot of sensors. To make it compatible with existing projects, we made...

In Stock
[Buy Now](https://www.adafruit.com/product/4500)
[Related Guides to the Product](https://learn.adafruit.com/products/4500/guides)
![Animated GIF showing CLUE board  displaying data from the many on-board sensors.](https://cdn-shop.adafruit.com/product-videos/640x480/4500-04.jpg)

### Clear Acrylic Enclosure + Hardware Kit for Adafruit CLUE

[Clear Acrylic Enclosure + Hardware Kit for Adafruit CLUE](https://www.adafruit.com/product/4675)
Here is a chic&nbsp;minimalist enclosure for your **CLUE** board! This case&nbsp;has been laser-cut specifically to accommodate the TFT display, tactile buttons, and capacitive pads.

And of course, we include&nbsp;mounting hardware so you can assemble it right onto your CLUE...

In Stock
[Buy Now](https://www.adafruit.com/product/4675)
[Related Guides to the Product](https://learn.adafruit.com/products/4675/guides)
![Angled shot of a Clear Acrylic Enclosure + Hardware Kit for Adafruit CLUE.](https://cdn-shop.adafruit.com/640x480/4675-04.jpg)

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
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 microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

### 3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip

[3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip](https://www.adafruit.com/product/3287)
This battery holder connects 3 AA batteries together in series for powering all kinds of projects. We spec'd these out because the box is compact, and 3 AA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries, plus it has&nbsp;a nifty&nbsp;on-off...

In Stock
[Buy Now](https://www.adafruit.com/product/3287)
[Related Guides to the Product](https://learn.adafruit.com/products/3287/guides)
![Angled shot of 3 x AA battery holder with on/off switch, JST, and belt clip.](https://cdn-shop.adafruit.com/640x480/3287-00.jpg)

### Alkaline AA batteries (LR6) - 3 pack

[Alkaline AA batteries (LR6) - 3 pack](https://www.adafruit.com/product/3521)
Battery power for your portable project! These batteries are good quality at a good price, and work fantastic with any of the kits or projects in the shop that use AAs. This is a pack of **3 AA batteries**.  
  
These batteries are Alkaline (MnO2) chemistry, with a voltage...

In Stock
[Buy Now](https://www.adafruit.com/product/3521)
[Related Guides to the Product](https://learn.adafruit.com/products/3521/guides)
![Angled shot of 3 AA batteries.](https://cdn-shop.adafruit.com/640x480/3521-00.jpg)

# PyLeap CLUE Sensor Plotter

## CircuitPython on CLUE

[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** &nbsp;flash drive to iterate.

The following instructions will show you how to install CircuitPython. If you've already installed CircuitPython but are looking to update it or reinstall it, the same steps work for that as well!

## Set up CircuitPython Quick Start!

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

[Download the latest version of CircuitPython for CLUE from circuitpython.org](https://circuitpython.org/board/clue_nrf52840_express/)
 **Click the link above to download the latest version of CircuitPython for the CLUE.**

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

![adafruit_products_CLUE_UF2_Downloaded.png](https://cdn-learn.adafruit.com/assets/assets/000/088/037/medium640/adafruit_products_CLUE_UF2_Downloaded.png?1580840077)

Plug your CLUE 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 **Reset** button on the top (magenta arrow) on your board, and you will see the NeoPixel RGB LED (green arrow) turn green. If it turns red, check the USB cable, try another USB port, etc. **Note:** The little red LED next to the USB connector will pulse red. That's ok!

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_Clue_Reset_NeoPixel_bootloader.png](https://cdn-learn.adafruit.com/assets/assets/000/087/919/medium640/adafruit_products_Clue_Reset_NeoPixel_bootloader.png?1580496467)

You will see a new disk drive appear called **CLUEBOOT**.

Drag the **adafruit-circuitpython-clue-etc.uf2** file to **CLUE**** BOOT.**

![adafruit_products_CLUE_CLUEBOOT.png](https://cdn-learn.adafruit.com/assets/assets/000/088/042/medium640/adafruit_products_CLUE_CLUEBOOT.png?1580841287)

![adafruit_products_CLUE_drag_UF2.png](https://cdn-learn.adafruit.com/assets/assets/000/088/043/medium640/adafruit_products_CLUE_drag_UF2.png?1580841295)

The LED will flash. Then, the **CLUEBOOT** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

If this is the first time you're installing CircuitPython or you're doing a completely fresh install after erasing the filesystem, you will have two files - **boot\_out.txt** , and **code.py** , and one folder - **lib** on your **CIRCUITPY** drive.

If CircuitPython was already installed, the files present before reloading CircuitPython should still be present on your **CIRCUITPY** drive. Loading CircuitPython will not create new files if there was already a CircuitPython filesystem present.

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

![adafruit_products_CLUE_CIRCUITPY.png](https://cdn-learn.adafruit.com/assets/assets/000/088/044/medium640/adafruit_products_CLUE_CIRCUITPY.png?1580841453)

# PyLeap CLUE Sensor Plotter

## Pairing

Now that you're done uploading the correct firmware, **disconnect** your device from your computer and power it via [LiPoly](https://www.adafruit.com/category/574)&nbsp;or [AAA battery pack](https://www.adafruit.com/product/727).

## Pairing device to PyLeap

Once powered, press the small&nbsp; **Reset** button in the center of the board (Circuit Playground Bluefruit) or on the top right of the board (CLUE). When the blue light flashes, press the Reset button again.

![Circuit Playground Bluefruit with reset button in center of board](https://cdn-learn.adafruit.com/assets/assets/000/107/090/medium800thumb/circuit_playground_ezgif22.jpg?1664908526 Circuit Playground Bluefruit with a small Reset button in the center of the board)

![Adafruit](https://cdn-learn.adafruit.com/assets/assets/000/087/865/original/adafruit_products_Clue_pinouts_Reset.png?1580413920 Adafruit CLUE Reset Button (Highlighted on the upper right))

When done correctly, the LEDs will flash yellow followed by solid blue. Once this occurs, the board will **continuously** be in discovery mode.

## Scan & Connect

When your Circuit Playground Bluefruit or Adafruit CLUE is in discovery mode, hold it very closely to your iPhone or iPadOS to pair.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/112/226/medium800thumb/circuitpython_ezgif.com-gif-maker-3.jpg?1654190148)

Below the spinning Blinka, you'll notice a status&nbsp;indicator that will let you&nbsp;know your current **pairing status.**

Once you've found&nbsp;your&nbsp;device and received the **Bluetooth Pairing Request** message, press Pair to pair your board to your iPhone or iPadOS.

![](https://cdn-learn.adafruit.com/assets/assets/000/112/232/medium800/circuitpython_IMG_6159.png?1654209813)

## If your Circuit Playground Bluefruit doesn't appear:

1. Check to see if your Circuit Playground Bluefruit is powered on. Verify that the green **On** light is lit.
2. Make sure your Circuit Playground Bluefruit is running the correct **firmware**. See the [CircuitPython page](https://learn.adafruit.com/pyleap-app/circuitpython)&nbsp;in this guide.
3. Try resetting the Circuit Playground Bluefruit by pressing the small **Reset** button near the center of the board.

# PyLeap CLUE Sensor Plotter

## Sensor Plotter Code

![](https://cdn-learn.adafruit.com/assets/assets/000/115/284/medium800/sensors_edited_P1380842.png?1663786248)

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/CLUE_Sensor_Plotter/code.py

# PyLeap CLUE Sensor Plotter

## Usage

![](https://cdn-learn.adafruit.com/assets/assets/000/115/388/medium800thumb/sensors_allSensorsDbl.jpg?1664290905)

After pairing your CLUE with the PyLeap app, scroll down to the **PyLeap CLUE Sensor Plotter** project in the list. **Tap** to open it and then **tap** on **Run it!** to download the project to your CLUE over BLE.

![sensors_00046.gif](https://cdn-learn.adafruit.com/assets/assets/000/115/387/medium640thumb/sensors_00046.jpg?1664290556)

Once the project is uploaded, the code will begin running. First, you'll see a "button guide" on the screen that tells you what the CLUE's A and B buttons do. The A button has a few different functions depending on the length of time that you press the button.

- **Short press:** advance to the next sensor
- **Two seconds:** change the palette (colors on the display)
- **Three seconds:** opens the Mu plotter if your CLUE is connected via USB to Mu
- **Four seconds:** locks the range of the plot

The B button changes the style of the plot. You can choose between plotting with a line or dots and having the plotter scroll or wrap.

![sensors_edited_P1380839.png](https://cdn-learn.adafruit.com/assets/assets/000/115/285/medium640/sensors_edited_P1380839.png?1663786277)

Toggle through plotting the different sensors on the CLUE. As the sensors' values change, you'll see the onscreen plot change as well.

![sensors_accel_1.gif](https://cdn-learn.adafruit.com/assets/assets/000/115/281/medium640thumb/sensors_accel_1.jpg?1663784213)

## Going Further

If you're curious about what makes the code tick, or plot, you can check out the [original Learn Guide by Kevin Walters](https://learn.adafruit.com/clue-sensor-plotter-circuitpython). It goes into depth on how everything is working.

[Original CLUE Sensor Plotter in CircuitPython Learn Guide](https://learn.adafruit.com/clue-sensor-plotter-circuitpython)

## Featured Products

### Adafruit CLUE - nRF52840 Express with Bluetooth® LE

[Adafruit CLUE - nRF52840 Express with Bluetooth® LE](https://www.adafruit.com/product/4500)
Do you feel like you just don't have a CLUE? Well, we can help with that - get a CLUE here at Adafruit by picking up this sensor-packed development board. We wanted to build some projects that have a small screen and a lot of sensors. To make it compatible with existing projects, we made...

In Stock
[Buy Now](https://www.adafruit.com/product/4500)
[Related Guides to the Product](https://learn.adafruit.com/products/4500/guides)
### Clear Acrylic Enclosure + Hardware Kit for Adafruit CLUE

[Clear Acrylic Enclosure + Hardware Kit for Adafruit CLUE](https://www.adafruit.com/product/4675)
Here is a chic&nbsp;minimalist enclosure for your **CLUE** board! This case&nbsp;has been laser-cut specifically to accommodate the TFT display, tactile buttons, and capacitive pads.

And of course, we include&nbsp;mounting hardware so you can assemble it right onto your CLUE...

In Stock
[Buy Now](https://www.adafruit.com/product/4675)
[Related Guides to the Product](https://learn.adafruit.com/products/4675/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
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 microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### 3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip

[3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip](https://www.adafruit.com/product/3287)
This battery holder connects 3 AA batteries together in series for powering all kinds of projects. We spec'd these out because the box is compact, and 3 AA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries, plus it has&nbsp;a nifty&nbsp;on-off...

In Stock
[Buy Now](https://www.adafruit.com/product/3287)
[Related Guides to the Product](https://learn.adafruit.com/products/3287/guides)
### Alkaline AA batteries (LR6) - 3 pack

[Alkaline AA batteries (LR6) - 3 pack](https://www.adafruit.com/product/3521)
Battery power for your portable project! These batteries are good quality at a good price, and work fantastic with any of the kits or projects in the shop that use AAs. This is a pack of **3 AA batteries**.  
  
These batteries are Alkaline (MnO2) chemistry, with a voltage...

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

## Related Guides

- [Introducing Adafruit CLUE](https://learn.adafruit.com/adafruit-clue.md)
- [Wirelessly Code your Bluetooth Device with CircuitPython](https://learn.adafruit.com/wirelessly-code-your-bluetooth-device-with-circuitpython.md)
- [CLUE Dice Roller](https://learn.adafruit.com/clue-dice-roller.md)
- [CircuitPython BLE Morse Code Chat](https://learn.adafruit.com/circuitpython-ble-wireless-morse-code-chat.md)
- [CLUE Step Counter](https://learn.adafruit.com/clue-step-counter-st-lsm6ds33.md)
- [Clue Coffee Scale](https://learn.adafruit.com/clue-coffee-scale.md)
- [Which CircuitPython Board is Right for You?](https://learn.adafruit.com/choose-your-circuitpython-board.md)
- [CircuitPython BLE Heart Rate Zone Trainer Display](https://learn.adafruit.com/circuitpython-ble-heart-rate-monitor-gizmo.md)
- [BLE Thermal "Cat" Printer with CircuitPython](https://learn.adafruit.com/ble-thermal-cat-printer-with-circuitpython.md)
- [Chauncey the Flower Care Bot with CLUE and Bonsai Buckaroo](https://learn.adafruit.com/chauncey-flower-watering-bot-clue.md)
- [Using the Bluefruit Dashboard with Web Bluetooth in Chrome](https://learn.adafruit.com/bluefruit-dashboard-web-bluetooth-chrome.md)
- [How to Fuse Motion Sensor Data into AHRS Orientation (Euler/Quaternions)](https://learn.adafruit.com/how-to-fuse-motion-sensor-data-into-ahrs-orientation-euler-quaternions.md)
- [CircuitPython BLE Libraries on Any Computer](https://learn.adafruit.com/circuitpython-ble-libraries-on-any-computer.md)
- [CLUE Text Telephone Transmitter](https://learn.adafruit.com/clue-teletype-transmitter.md)
- [PyLeap CLUE Barometer](https://learn.adafruit.com/pyleap-clue-barometer.md)
- [CLUE Sensor Plotter in CircuitPython](https://learn.adafruit.com/clue-sensor-plotter-circuitpython.md)
