Browse our open source example apps to accelerate your wireless IoT project.

Blues Developers
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
Button IconHelp
Notehub StatusVisit our Forum
Button IconSign In
Sign In
Sign In
What’s New
Resources
Blog
Technical articles for developers
Newsletter
The monthly Blues developer newsletter
Terminal
Connect to a Notecard in your browser
Developer Certification
Get certified on wireless connectivity with Blues
Webinars
Listing of Blues technical webinars
Blues.comNotehub.io
Shop
Docs
homechevron_rightExample Appschevron_rightAcceleratorschevron_rightRestroom Servicing Monitor

Restroom Servicing Monitor

  • LoRa
  • MicroPython Firmware
  • Wiring Required

Receive updates on restroom cleanliness so that it can be serviced when needed.

You Will Need

  • Blues Starter Kit for LoRaWAN
  • Raspberry Pi Pico
  • 2 USB A to micro USB cables
  • Breadboard
  • 3 push buttons
  • Jumper wires

Notehub Setup

Sign up for a free account on notehub.io and create a new project.

LoRa Gateway Setup

Before you can use the Notecard LoRa you need to have a LoRaWAN gateway that is provisioned to The Things Network. To make this easy you can use the Blues Indoor LoRaWAN Gateway . To get this set up follow the setup instructions

Hardware

Before we set up the Pico for the restroom servicing monitor, let's wire up the hardware. The hardware interface is 3 push buttons: 1 for a bad rating (restroom needs service), 1 for an ok rating (restroom cleanliness deteriorating), and 1 for a good rating (no service needed).

These buttons are wired to GPIO pins on the Pico. Those pins will be configured with internal pull-downs so that the pin reads a digital 0 when the button isn't pushed. When the button is pushed, it connects the corresponding GPIO pin to 3V3 so that it reads a digital 1.

Using the breadboard, buttons, and jumper wires, wire up the hardware as shown in the diagram below.

breadboard wiringBreadboard Wiring

The three buttons are connected as follows:

Poor (Left) -> GP26 (Pin 31) Ok (Middle) -> GP8 (Pin 11) Good (Right) -> GP7 (Pin 10)

The labels off the breadboard correspond to the Qwiic connector from the Notecarrier. Connect these to the breadboard as follows:

Blue (SDA) -> Pin 6 Yellow (SCL) -> Pin 7 Black (GND) -> Pin 8

Do not connect the red connector of the Qwiic cable.

The power rail of the Breadboard is connected to Pin 36 on the Pico (3V3 Out).

Pico Setup

Your Raspbery Pi Pico will need to have Micropython installed. If it is not yet installed, follow the installation instructions provided by MicroPython.

MicroPython Code

The script that will run on the MCU is main.py . It depends on note-python , a Python library for communicating with a Notecard.

note-python

To get the note-python files onto the MCU, use the setup_board.py script. This uses the pyboard.py script to communicate with the Raspberry Pi Pico. First, you must identify the MCU's serial port. On Linux, it'll typically be something like /dev/ttyACM0. You can run ls /dev/ttyACM* before and after plugging the board in to figure out the serial port's associated file. Once you have that, run python setup_board.py <serial port>, replacing <serial port> with your serial port. This script does a few things:

  1. Clones note-python from GitHub.
  2. Creates the /lib and /lib/notecard directories on the MCU.
  3. Copies the .py files from note-python/notecard on your development machine to /lib/notecard on the MCU.
  4. Lists the contents of /lib/notecard so you can verify that everything was copied over.

Note that for pyboard.py to work, you'll need to install pyserial with pip install pyserial, if you don't have it installed already.

Running main.py

Before running main.py, uncomment this line: # product_uid = 'com.your-company:your-product-name'. Replace com.my-company.my-name:my-project with the ProductUID of the Notehub project you created in Notehub Setup.

Copy main.py over to the board with this command:

python pyboard.py -d <serial port> --no-soft-reset -f cp main.py :/

Make sure to replace <serial port> with your serial port. main.py will start running after boot up.

Testing

To test things out, we'll press each button, observe the serial log, and then observe the Note that was sent to Notehub.

  1. Press the leftmost button connected to GP26 (bad rating). You should see Sent bad rating. in the serial log. On your Notehub project's Events page, you should see a ratings.qo Note that looks like this:
{
    "rating": "bad"
}
  1. Press the middle button connected to GP8 (ok rating). You'll see Sent ok rating. in the serial log and the Notehub event should have a rating field with the string "ok".
  2. Press the rightmost button connected to GP7 (good rating). You'll see Sent good rating. in the serial log and the Notehub event should have a rating field with the string "good".

Blues Community

We’d love to hear about you and your project on the Blues Community Forum !

On This Page

  • You Will Need
  • Notehub Setup
  • LoRa Gateway Setup
  • Hardware
  • Pico Setup
    • MicroPython Code
  • Testing
  • Blues Community

Resources

  • GitHub
  • Request More Info
© 2025 Blues Inc.
© 2025 Blues Inc.
TermsPrivacy
Notecard Disconnected
Having trouble connecting?

Try changing your USB cable as some cables do not support transferring data. If that does not solve your problem, contact us at support@blues.com and we will get you set up with another tool to communicate with the Notecard.

Advanced Usage

The help command gives more info.

Connect a Notecard
Use USB to connect and start issuing requests from the browser.
Try Notecard Simulator
Experiment with Notecard's latest firmware on a Simulator assigned to your free Notehub account.

Don't have an account? Sign up