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_rightFreight Car Door Motion and Location

Freight Car Door Motion and Location

  • GPS/GNSS Tracking
  • Hostless
  • Wiring Required

Track the location of a Freight Car and determine the number of times the door was opened and closed. Battery powered solution with an expected lifespan of 10 years.

You will need

  • USB A to micro USB cable
  • LiPo battery with JST cable
  • Notecarrier-A or Notecarrier-B
  • Notecard WBNA
  • To sense the door opening, either
    • Hall Effect Sensor
  • or
    • Magnetic Door Sensor
  • Dupont jumper cables (male-female)

Notehub Setup

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

Hardware Setup

  1. Assemble Notecard and Notecarrier as described here.
  2. Plug the LiPo battery's JST cable into the Notecarrier port labeled "LIPO".
  3. Connect the micro USB cable from your development PC to the port on the Notecarrier. This is to both charge the LiPo battery and configure the Notecard.

Notecard Firmware

The Notecard should use firmware version 3.5.2 or higher. The simplest way to update firmware is to do an over-the-air update.

Notecard Configuration

With the Notecarrier connected to your development PC, navigate to , open the in-browser terminal and connect to the Notecard. Then enter this command in the terminal:

{ "req": "hub.set", "product" : "com.your-company:your-product-name", "sn": "a-serial-number", "body":{"app":"nf23"} }

Make sure to replace "com.your-company:your-product-name" with your ProductUID from Notehub Setup. Also, replace "a-serial-number" with the serial number of other relevant identifier for this particular tracker (e.g. "freight car 2").

card.voltage

API Reference

Next, enter this command to optimize voltage ranges for the LiPo battery

{ "req": "card.voltage", "mode": "lipo" }

And then this command

{ "req": "hub.set", "mode": "periodic", "inbound": 1440, "outbound": 60 }

This will have the notecard send any outbound messages once per hour. If there are no messages to send, the Notecard does not power on the modem, preserving battery life. It also checks for incoming messages once per day.

You can read more about this command in the Low Power Design documentation

card.location.mode

API Reference

This command tracks location daily, switching to once every 2 days when the battery is low. When powered via USB, location is reported every 30 minutes, since power use is not a concern.

{
 "req": "card.location.mode",
 "mode": "periodic",
 "vseconds": "usb:30;high:86400;normal:86400;low:178200;dead:0"
}

card.location.track

API Reference

This command enables automatic location tracking to Notefile _track.qo.

{
 "req": "card.location.track",
 "start": true
}

You can optionally add the property "sync":true which configures the Notecard to perform an immediate sync with Notehub when location is reported. Without this, the Notecard will sync within the next hour.

card.aux GPIO mode

API Reference

This command uses AUX GPIO mode to configure the notecard to count the number of times the door has been opened.

{
    "req": "card.aux",
    "mode": "gpio",
    "usage": ["count-pulldown"],
    "file": "door.qo"
}

Detecting when the door is opened and closed

Detecting whether the car door is open or not can be done using either a Hall Effect sensor and a magnet, or a magnetic door switch.

Which you use in your implementation will depend upon the mounting options available for each type of sensor. All other things being equal, the magnetic door switch is a better choice since it consumes no current while the door is closed. The Hall Effect sensor has a built-in LED which will drain the battery quicker.

Hall Effect Sensor

The sensor is attached to the Notecarrier using this pinout:

  • Brown (V+) to VMAIN
  • Black (Signal) to AUX1
  • Blue (V-) to GND

You may choose to crimp your own cable ends, or simply splice the wires on the sensor with a Dupont Connector aappropriate for your Notecarrier.

Note that the Hall Effect sensor only detects one pole of the magnet, usually the North pole. Be sure to test your sensor with the magnet by moving the magnet up to the sensor and away, and verify that you see events posted to door.qo in Notehub, confirming that the sensor detected the "open/close" event.

Magnetic Door Switch

The switch operates like a relay, with COM, Normally Closed and Normally Open terminals. Since the door is closed for most of the time, we only want to sink current through the switch when the door is open to reduce power use.

The door switch is wired to the Notecarrier as follows:

  • VIO on Notecarrier to the COM terminal on the switch
  • AUX1 on Notecarrier to the NO terminal on the switch

Once the wiring is complete, test the connection as follows:

  1. bring the two parts of the switch into close proximity
  2. simulate opening and closing the door by moving one part away and then back again to make contact.

You should see events posted to door.qo in Notehub. If you don't, you may need to perform a manual sync by typing sync into the in-browser terminal, or alternatively adding "sync":true to the card.aux command so that the Notecard syncs with Notehub when the door is opened.

Notecard CLI

You can use the config.json file in this directory along with the Notecard CLI to issue the above commands in one fell swoop:

notecard -setup config.json

Before doing this, you will need to edit config.json and replace com.your-company:your-product-name with your ProductUID from Notehub Setup.

On This Page

  • You will need
  • Notehub Setup
  • Hardware Setup
  • Notecard Firmware
  • Notecard Configuration
    • card.voltage
    • card.location.mode
    • card.location.track
    • card.aux GPIO mode
  • Detecting when the door is opened and closed
    • Hall Effect Sensor
    • Magnetic Door Switch
  • Notecard CLI

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