Hiking Data Logger Using RFM69CW

1,863

15

2

Introduction: Hiking Data Logger Using RFM69CW

About: Hiking, Woodworking, PCB design using Eagle, Writing Software for MacOS and AVR, 3D Design using Fusion 360

This hiking data logger is used to record a hike’s location, start and end time, temperature, altitude and barometric pressures. It will also audibly report altitude milestones during the hike.

Even if you have no interest in hiking you may find the schematics, hardware and/or software useful.

The hiking data logger is made up of three separate devices and their Arduino projects.

All of the devices communicate using a HopeRF RFM69CW transceiver.

The three devices:

  1. Gateway - resides in your pack’s top pouch.
    - Coordinates the recording of hike data.
    - 5 button UI with a multi line RGB display
    - SD card slot used for downloading saved hike data.
    - Provides altitude milestone notification via an onboard MP3 player and micro speaker.
    - USB serial and 10440 Li-ion 3.7V 600mAh AAA size battery with onboard charger
    - 3D printed enclosure - 8 x 8 x 1.5cm
  2. BMP280 remote - hangs on the back of your pack
    - Broadcasts temperature and pressure updates every 4 seconds.
    - The gateway and 3 button remote use the pressure readings to calculate the altitude.
    - 10440 Li-ion 3.7V 600mAh AAA size battery that lasts several months on a single charge.
    - 3D printed enclosure - water resistant - 8 x 5 x 1.5cm
  3. Remote control - resides in an easily accessible pocket
    - Controls and displays information about a subset of the gateway’s functions.
    - 3 button UI with a multi line RGB display.
    - USB serial and 10440 Li-ion 3.7V 600mAh AAA size battery with charger
    - 3D printed enclosure with buttons large enough to be used with winter gloves - 8 x 6 x 1.8cm

The gateway stores a summary of up to 125 hikes. After that it overwrites the oldest summary. More detailed hike data can be downloaded to an SD card with each hike stored as a separate file. The detailed data is the temperature and pressure recorded every 4 seconds.

The only software that I didn’t write, other than the basic Arduino classes, are the classes that control the RFM69 transceiver and the SD card.

- Felix Rusu's RFM69 library Copyright Felix Rusu 2016

- Bill Greiman's SdFat library Copyright Bill Greiman 2011-2018

My Mac OS utility applications used in this project:

Note that all of the repositories below contain a built application (zip file.)

- SubsetFontCreator - creates a subset of a font for either 1 bit or RGB displays as compressed bitmap data (RGB is antialiased, 1 bit isn’t).

- SerialHexLoader - used to set various parameters on the devices serially and via an ISP, as well as exporting IntelHex representations of binary files.

- FatFsToHex - used to create FAT16 disk images for storing MP3 data on NORFLASH chips.

- HikeLoggerUtility - (not released yet, still being written) used to interpret and display the detailed hike data logged by the gateway. It’s also where hike location names and elevation data is added, edited and exported for loading onto the gateway.

There are no purchased modules other than the transceivers. I designed and built all four boards.

Usage Summary:

Setting the start and end location of a hike is done via the gateway’s UI. Once the setup is done the gateway can be placed in your pack. The 3 button remote is used to start, stop, pause, resume, and mark a hike as done. The only location setting action the 3 button remote can perform is swapping start and end locations (as you would do when going back the way you came.)

The 3 button remote controls a subset of the functions available on the gateway. The remote displays the current time, temperature and altitude. When logging a hike, the remote displays the elapsed time and percentage of the hike completed (in terms of elevation gain or loss.)

What the gateway logs:

The gateway receives a packet from the BMP280 remote approximately every 4 seconds. This packet contains the current barometric pressure and temperature. When logging a hike, this packet data is written to a serial EEPROM IC. When the hike is marked as done (an action in the UI), the log is terminated and setup for the next hike log to be appended. Completed hikes are saved to SD by inserting an SD card. You are prompted with “SAVE TO SD?”. If you then press enter, the logs currently in EEPROM are written as individual files to the SD card. When writing finishes successfully a “SAVED TO SD” message is presented. When you remove the SD card you’re given the option to remove the logs on the EEPROM. You have to explicitly select YES in the UI to do this. Removing the logs from the EEPROM does not affect the stored hike summaries, only the detailed hike log data.

The log data files are interpreted using the HikeLoggerUtility application on the Mac (not released yet.) The HikeLoggerUtility uses the pressure readings to calculate the altitude of each sample showing how the temperature changed over time/altitude and how fast you were ascending or descending. The HikeLoggerUtility also allows you to add metadata to the log such as what kind of day it was (cloudy/sunny/snowing/raining/windy), and what you were wearing and whether you were comfortable. I find this helpful in deciding what to wear on a hike in winter weather. You can lookup what you were wearing for an expected starting temperature within a given range.

The summary data that is always stored on the gateway can only be erased via the USB serial port by sending a summary reset command. This erases all summaries stored in the summary ring buffer. Summaries are only stored for hikes that make it past the 75% milestone. This eliminates writing summaries of logs started accidentally. Note that the 75% milestone rule only applies to summaries. All logs, accidental or not, are saved to the SD card.

Milestones reported by the gateway:

The gateway plays an MP3 clip for each milestone reached. The milestones are 25%, 50% and 75%. The milestone granularity can easily be changed in the code to any integer factor of 100. I have my gateway set to play the Mac OS “Glass” sound for all of the milestones. You could play a different MP3 for each milestone. When the MP3 finishes, the MP3 section of the board is powered down to save power.

More detail:

The Gateway Display:

The gateway display is textual, there are no icons. The display resolution, at about 10 points per millimeter, is quite high, higher than many computer monitors. For example my MacBook Pro with a Retina display is about 5 ppmm. At 1.60 USD the 240x240 gateway display is a good value. For this reason the fonts used are antialiased.

XFont class:

I looked at the various Arduino font rendering libraries available and decided to write my own named XFont. The XFont library makes no assumption about the underlying display hardware and font storage. All of the display classes derive from a common base class. The font data can be stored anywhere; Flash, Serial EEPROMs, etc.. You simply need to provide a stream class to access the data. The only storage assumption the font class makes when used in Arduino code is that the header and glyph lookup tables are stored in the MPU’s Flash memory (PROGMEM.) These structures are quite compact.

SubsetFontCreator application:

The font data consumed by XFont is created by my SubsetFontCreator Mac OS application. SubsetFontCreator uses the open source FreeType library to create a compact subset of a font’s available font glyphs, as bitmap data. For example, if you’re writing code for a clock you would only need the 14 glyphs needed to display the time (0 to 9, a colon, and the letters A, M, and P.) The glyph data generated is compressed for both 1 and 8 bit data. See the Readme.md on GitHub for more information about how the data is compressed.

SubsetFontCreator can generate a binary file, a C++ header, or both. The generated header file contains boilerplate code to make incorporating the font into an Arduino sketch easier. The data can be 1 or 8 bit. 1 bit data requires much less space than 8 bit. 8 bit data is for high resolution displays used to generate antialiased text when you have enough memory to store the data. As an example of how storage agnostic the font classes are, the same classes used in the Arduino code are used to create WYSIWYG font samples in SubsetFontCreator Mac OS application. Only a few display and storage subclasses were needed to support the Mac. Being able to debug the font classes on the Mac makes it easier to maintain.

For more information about XFont and SubsetFontCreator see the SubsetFontCreator repository on GitHub.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Schematics

Also included are parts lists for each board.

The gateway, notable components:

- ATmega644PA MCU
- 240x240 ST7789 RGB display
- RFM69CW transceiver
- USB CH340G serial
- USB powered TP4056 Li-ion charger with FS8205A/DW01A protection ICs
- LM3671 DC-DC 3v3 converter
- YX5200-24SS MP3 player (same IC used in the common DF Player module)
- 8002A mono amplifier connected to a micro speaker
- W25Q64FVSS 8MB SPI NORFLASH MP3 storage memory
- AT24C256N 32KB I2C EEPROM hike data memory

The 3 button remote, notable components:

Main board

- ATmega644PA MCU
- 80x160 ST7735 RGB display
- RFM69CW transceiver
- LM3671 DC-DC 3v3 converter

USB Serial & Charger board

- USB CH340G serial
- USB powered TP4056 Li-ion charger with FS8205A/DW01A protection ICs

The BMP280 remote, notable components:

- ATtiny84A MCU
- BMP280 digital pressure and temperature sensor
- RFM69CW transceiver
- LM3671 DC-DC 3v3 converter

Step 2: Assembling the Boards

I’ve written several instructables that have step by step instructions for assembling a board with surface mount devices (SMD.) For this instructable I will only describe the assembly of the 3 button remote board in detail and how to solder the display cables for the gateway board. Once you’ve assembled one SMD board you should be able to apply that to most other boards.

Step 3: Assembling the 3 Button Remote Board

Instructions for assembling the board (or almost any small board) follows. If you know how to assemble an SMD board, jump to step 9.

Using a small piece of wood as a mounting block, I wedge the board between two pieces of scrap prototype board. The prototype boards are held to the mounting block with double stick tape (no tape on the PCB itself).

Step 4: Apply Solder Paste and Place SMD Parts

Apply solder paste to the SMD pads, leaving any through hole pads bare. I generally work from top left to bottom right to minimize the chances of smearing the solder paste that I’ve already applied. If you do smear the paste, use a lint free wipe such as those for removing makeup. Avoid using a Kleenex/tissue. Controlling the amount of paste applied to each pad is something you get the hang of through trial and error. You just want a tiny dab on each pad. The size of the dab is relative to the size and shape of the pad (roughly 50-80% coverage). When in doubt, use less. For pins that are close together, like anything in TSSOP package, such as the LVC125A on the gateway, you apply a very thin strip across all of the pads rather than attempt to apply a separate dab to each each of these very narrow pads. When the solder is melted, the solder mask will cause the solder to migrate to the pad, kind of like how water won’t stick to an oily surface. The solder will bead or move to an area with an exposed pad.

Special case: When assembling either the gateway or 3 button remote, apply solder paste to the display pads on the boards, but don’t place the display yet

Special case: The BMP280 sensor on the BMP280 remote board is tiny and I’ve found it’s best to apply the solder paste (very sparingly) to each pad and NOT place the sensor directly onto the paste. After melting the solder, follow the BMP280 sensor instructions in the next step.

Optional special case: I haven’t been placing or applying the solder paste for the RFM69CW module in this step. I prefer to solder the RFM69CW after applying the hot air gun to all of the other parts.

No-clean Paste Flux: (source)

I use a low melting point solder paste (137°C Melting Point): (source)

Place the SMD parts. Give each part a light tap to ensure that it’s sitting flat on the board. When placing a part I use two hands to aid in precise placement.

As noted above, don't place the BMP280 sensor directly onto the solder paste.

Step 5: Apply the Hot Air Gun

Hold the gun perpendicular to the board at about 4cm above the board. The solder around the first parts takes a while to start melting. Don’t be tempted to speed things up by moving the gun close to the board. This generally results in blowing the parts around. Once the solder melts, move on to the next overlapping section of the board. Work your way all around the board. I use a pair of tweezers to tweak the parts into place as I move around the board.

I use a YAOGONG 858D SMD Hot Air Gun. (On Amazon for less than $40.) The package includes 3 nozzles. I use the largest (8mm) nozzle. This model/style is made or sold by several vendors. The important number is 858D. I’ve seen ratings all over the place. This gun has worked flawlessly for me. For 137°C low temperature solder I set the hot air gun to 235°C

Special Board Assembly technique for displays

After melting the solder, this is where you would mount the the display. Apply a very thin layer of no-clean flux to the display cable solder pads. Position the display cable using double stick tape on the display metal frame to hold the display cable in position over the solder pads on the board. Using a pencil tipped soldering iron, gently swipe each pad on the exposed side of the display cable, repeating till the display cable sits flat on the board. Use a narrow piece of PCB to hold the cable down as you solder it. I’ve found this technique works better than attempting to use the hot air gun.

After melting the solder, this is where you would mount the BMP280 sensor on the BMP280 sensor board. At this point the pads for the BMP280 should only have slight bumps of melted solder on them. Apply a very thin film of no-clean solder paste on underside of the sensor. Place the sensor on the board. Apply the heat gun and tap the sensor till the solder melts. If this is done correctly you should see the tiniest of solder beads bleed out from under the sensor at each pad.

After allowing the board to cool a bit, this is where I prefer to mount the RFM69CW. Apply solder paste to the RFM69CW pads, place the RFM69CW module, and reapply the hot air gun. Note that when the board is warm the solder paste will spread out quickly, so if you perform this special case, note that you need to be careful applying the solder paste to a warm board.

Step 6: Cleaning/removing the SMD Flux

The solder paste I use is advertised as being “no clean”. You do need to clean the board, it looks much better and it will remove any small beads of solder on the board. Using latex, nitrile, or rubber gloves in a well ventilated space, pour a small amount of Flux Remover into a small ceramic or stainless steel dish. Reseal the flux remover bottle. Using a stiff brush, dab the brush in the flux remover and scrub an area of the board. Repeat till you’ve entirely scrubbed the board surface. I use a gun cleaning brush for this purpose. The bristles are stiffer than most tooth brushes.

Special case: It may not matter, but I hold the board with my thumb on the BMP280 air hole to prevent getting the flux remover inside the sensor.

Flux remover I use: MG Chemicals 4140 or 4140A. Note that the board may appear to be slightly sticky after using this product. I’ve found that after the product completely evaporates (may take an hour or more) the sticky film turns to a whitish dust that is easy wiped off the board.

Step 7: Place and Solder All of the Trough Hole Parts

After the flux remover has evaporated off the board, place and solder all of the trough hole parts, shortest to tallest, one at a time.

For quite a while now I haven’t been installing the ICSP header on any of the boards I make. I instead use test probe pogo pins either attached to a test fixture or inserted into a 2x3 Dupont shell. For an example of a DIY test fixture see: PCB Test Fixture

Step 8: Cleanup the Through Hole Pins

Using a flush cutter plier, trim the through hole pins on the underside of the board. Doing this makes removing the flux residue easier.

For a nice appearance, reheat the solder on the through hole pins after clipping. This removes the shear marks left by the flush cutter.

Using the same cleaning method as in Step 6, clean the back of the board.

At this point all 4 boards should be assembled as per the schematics and parts lists.

Step 9: Print the 3D Parts

Gateway case: RFM69 Gateway

3 Button Remote case: RFM69 3 Button Remote

BMP280 case: RFM69 BMP280 Remote

Step 10: Download Software

Download the software from GitHub:

ArduinoHikingLogger

The ArduinoHikingLogger repository contains the sources for HikingLoggerGateway and HikingLoggerRemote sketches. When compiling either of these sketches, make sure you edit the Arduino Preferences Sketchbook location to point to the ArduinoHikingLogger folder.

The MCU on the gateway and 3 button remote is an ATmega644PA. In order to compile software for this MCU you need to have the MightyCore board manager installed. You install this by adding "https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json" to the Additional Boards Manager URLs in the Arduino Preferences.

ATmega644PA Settings

Replace /dev/cu.usbserial-14420 with the actual port connected to the board.

Arduino-Tiny

The Arduino-Tiny repository contains the sources for several of my ATtiny related sketches. The sketch you're interested in is BMP280Remote. When compiling this sketch, make sure you edit the Arduino Preferences Sketchbook location to point to the Arduino-Tiny folder.

The MCU on the BMP280 remote is an ATtiny84A. In order to compile software for this MCU you need to have the damellis/attiny board manager installed. You install this by adding "https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json" to the Additional Boards Manager URLs in the Arduino Preferences.

ATtiny84A Settings

Replace /dev/cu.usbserial-14420 with the actual port connected to the board.

Step 11: Load Software on BMP280 Remote

First set the ATtiny84A's fuses:

The fuse settings in the command line (see below) sets the ATtiny84A to use the internal resonator at 8MHz. These fuse settings also preserve the EEPROM from being erased whenever downloading a new sketch. Many default fuse settings don’t do this.

I do this using an ISP, specifically the one I designed (see AVR Programmer) You can use any AVR ISP such as Arduino as ISP built on a breadboard so long as it's 3v3. See the Arduino as ISP example from the Arduino IDE Examples menu for a DIY ISP.

Very important: You must use a 3v3 ISP or you will damage components on the board.

The following are Mac OS instructions.

Open a BBEdit worksheet (you could also do this from a Terminal window.) Note that a bootloader for the ATtiny84A should not be loaded via the Arduino IDE. All software is loaded via an ISP through the ICSP connector on the BMP280 board.

Set the SPDT switch on the BMP280 board to “OFF/PROG". This reroutes the board’s power source to the ICSP cable and disables the RFM69CW module. If the RFM69CW module isn’t disabled it will interfere with the ISP.

Connect a 6 pin ISP cable from the ICSP header on the board to the connector on a 3v3 ISP.

From within the BBEdit worksheet OR the Terminal app, run:

/Applications/Arduino\ 1.8.10.app/Contents/Java/hardware/tools/avr/bin/avrdude -C /Applications/Arduino\ 1.8.10.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -p t84 -P /dev/cu.usbserial-A603R1VD -c avrisp -b 19200 -U lfuse:w:0xe2:m -U hfuse:w:0xd7:m -U efuse:w:0xff:m

The path to your Arduino application should be used in place of "/Applications/Arduino\ 1.8.10.app".

/dev/cu.usbserial-A603R1VD above should be replaced with whatever USB serial port is connected to your ISP.

Set the Network and Node ID:

All 3 boards should have the same network ID. Chose a value from 1 to 254.

All 3 boards need a unique node ID. The gateway should be ID 1, the 3 button remote 2, and the BMP280 remote can be anything greater than 2.

The code reads network and node IDs from EEPROM in the sketch's setup() routine. The instructions below define how to set these IDs in the EEPROM using the SerialHexLoader application. Another way of setting these IDs would be to replace the code in setup() that reads the IDs with hard coded values.

Using the SerialHexLoader application attached to a 3v3 ISP connected to the boards ICSP connector, select “Set NodeID…” from the Command menu. This will display a dialog with two fields. Enter the node and network IDs. When you press OK this will send a few AVR STK500 commands to the ISP to write the two IDs to the MCU’s EEPROM starting at address 2. You will see success or failure in the utility log view.

This same procedure is used to set the node and network IDs for the gateway and 3 button remote. As noted above, the gateway should be ID 1, the 3 button remote should be ID 2, and the BMP280 node ID can be anything greater than 2. The network ID common to all 3 boards should be unique for the set of devices.

Upload the BMP280Remote sketch:
Using the same setup as step 13, use the Arduino IDE to upload the BMP280Remote sketch via the ISP. After uploading, set the SPDT switch on the BMP280 board to “ON”.

Step 12: Assemble the BMP280 Remote

Parts:

(8) M2x4mm hex socket button head screws (ISO7380) (source)

(1) 11x7x2mm Nitrile rubber (aka NBR) O-Ring (source)

~22cm 1.5 diameter rubber gasket material. (aka Rubber Jewelry Cord) (source)

(1) 28mm snap ring (source)

(1) set (+ and -) of AA/AAA battery spring plate 10x9mm plate size (source)

(1) 433MHz 40x7mm PCB antenna with IPEX connector (source)

7cm 26awg Red wire

4cm 26awg Black wire

2mm diameter acrylic rod (used as a light guide for the LED on board) (source)

(1) 10440 AAA size 600mAh 3.7V Li-ion battery (charged)

Preparation and installation of the LED light guide:

Ream out the hole located at the approximate lower center of the base to the diameter of the acrylic rod. The 2mm rod I was able to find was actually 2.2mm. Using a sanding block with 500 grit sandpaper, smooth and square one end of the acrylic rod. With the board temporarily mounted in the base, insert the rod into its hole till it makes contact with the LED on the board. Using a flush cutter, snip the rod flush with the base. Remove the board and the cut rod. Sand the cut end of the rod smooth and square. Mix and apply a small amount of plastic epoxy to the rod hole. Insert the rod till it’s flush with the base surface. Cleanup any residual epoxy. Set aside and wait for it to cure.

Install the cover gasket:

Using a small flat blade blunt screwdriver, work the 1.5mm gasket material into the channel on the inside of the base. Cut the gasket to size.

Preparation and installation of the battery spring plates:

On the spring/battery side of each battery plate, solder the red and black wires. Fold the tabs over the back of each plate. Insert the battery plates as shown in the photos. Place the board to determine the length needed. Cut the wires to length with some slack. Solder the wires to the component side of the board. (red +, black -)

Slide the battery plates into the battery compartment slots as shown in the photo.

Install the antenna:

Remove the protective layer on the antenna’s double stick backing. Place the antenna in the base as shown in the photo. Attach the IPEX connector to the board.

Make sure the switch on the board is set to ON.

Place the O-Ring as shown in the photo. Install the board using two M2x4mm screws.

Install the battery and back cover using four M2x4mm screws.

Step 13: Burn Bootloaders on Gateway and 3 Button Remote

It’s easier to burn the bootloaders before installing the boards in their cases. The gateway and 3 button remote both use the ATmega644PA MCU. Setup the Arduino IDE following the instructions in step 10.

Connect your 3v3 ISP/Programmer and select the corresponding serial port in the Tools menu.

Select your ISP/Programmer in the Tools menu.

Very important: You must use a 3v3 ISP or you will damage components on the board.

For each board:

With your ISP connected to the ICSP header on the board, select Burn Bootloader in the Tools menu.

If everything is connected and configured correctly you should get a success message in the sketch log pane.

This would also be a good time to set the Network and Node IDs for these boards. Follow the instructions in Step 11.

Step 14: Create the Bitmap Fonts

Because I don’t own the fonts used in this project you need to use my SubsetFontCreator app to create them.

Launch the SubsetFontCreator.

Select “Choose…” from the Font path control popup at the top of the SubsetFontCreator main window.

Navigate to the /Library/Fonts folder and select MyriadPro-Regular.otf

The 1-Bit and Rotate checkboxes should be unchecked.

The bits-per-offset radio should be set to 16.

Set the Size to 36.

The subset string should be “ !%)-:@!--?A[]]mm°°”, not including the quotes. Make sure you include the leading space. Also, because of a bug in the Instructables HTML interpreter, replace the '@' with '<'. It doesn't like a less than character within quotes.

Alternatively you can use the helper dialog and paste in !%&'()-./0123456789:<=>?ABCDEFGHIJKLMNOPQRSTUVWXYZ[]m° also with a leading space.

This defines the set of glyphs to be exported as bitmap data.

Select Export… from the File menu. The format should be set to C++ Header.

Save the file MyriadPro-Regular_36.h to the HikingLoggerGateway sketch folder.

You’ll know you’ve generated the correct number of character codes if the fontHeader’s numCharCodes field is 55.

The AM and PM strings are drawn as 18 pt text. Create this bitmap header by changing the Size to 18 and the subset string to " AAMMPP”, not including the quotes. Make sure you include the 2 leading spaces.

Export the file MyriadPro-Regular_18.h to the HikingLoggerGateway sketch folder.

The 3 button remote font sizes are smaller than the gateway’s because the display has fewer pixels per mm.

Set the font size to 24 and the subset string to “ !%)-:@!--?A[]]mm°°” (same as the gateway) Because of a bug in the Instructables HTML interpreter, replace the '@' with '<'. It doesn't like a less than character within quotes.

Export the file MyriadPro-Regular_24.h to the HikingLoggerRemote sketch folder.

Set the font size to 14 and the subset string to " AAMMPP" (same as the gateway)

Export the file MyriadPro-Regular_14.h to the HikingLoggerRemote sketch folder.

Because 3 lines of text are needed in the remote display, change the fontHeader line height from 29 to 26 in MyriadPro-Regular_24.h

-->

Step 15: Assemble the 3 Button Remote

Parts:

(11) M2x4mm hex socket button head screws (ISO7380)

(2) M2x12mm hex socket button head screws (ISO7380)

(1) set (+ and -) of AA/AAA battery spring plate 10x9mm plate size, ~14x9 including solder tab, 9mm width

(1) 433MHz 40x7mm PCB antenna with IPEX connector

8cm 26awg Red/Black bonded wire (source)

5cm 26awg Red wire

5cm 26awg Black wire

(3) 4cm 26awg wires of different colors (I used white, pink and purple)

(1) 40mm diameter 1mm thick acrylic disk. (source)

(1) 1mm diameter x 5cm stainless steel rod (or 16 awg solid copper wire) (source)

2mm diameter acrylic rod (used as a light guide for LEDs)

(1) 10440 AAA size 3.7V Li-ion battery

(1) 40mm Display template/mask/installation guide (3ButtonRemoteFace.PDF)

3M General Purpose 45 Spray Adhesive or some other spray adhesive suitable for paper. (source)

Mount the display:

Leave the protective film on the display face until final installation.

Remote Tape

Place a strip of 6mm wide electrical tape along the upper edge of the board as shown in the photo.

Place a strip of double stick tape as shown in the photo.

Remote Display

Place/adhere the display to the board using the outline printed on the board as a guide.

Preparing and installing the acrylic face:

Print the attached 3ButtonRemoteFace.PDF

Carefully cut out one of the printed faces following its outline.

Face MaskFace Mask Cut

Spray a thin layer of spray adhesive to the cut out printed face following the spray adhesive instructions.

Remove the protective plastic film from one side of the acrylic disk.

Carefully place/adhere the printed face to the exposed side of the acrylic disk.

Mount the disk in a vise with the indentation on the edge of the printed face exposed.

Using a chainsaw file or some other fine round file, file the acrylic to match the printed indentation.

Repeat for the 2nd smaller indentation. Note that these indentations are used to align the disk, so accuracy counts.

Pre-fit the disk in the base.

While holding the disk in the base, use a utility knife to scribe the 30mm base circle with just enough pressure to cut the protective plastic film and not damage the acrylic.

Face Prep

Remove the disk from the base and carefully remove the outer ring of plastic film created in the last step, leaving the center 30mm circle of protective plastic film in place.

Mix a small amount of plastic epoxy and trowel it on the outside ring of the acrylic disk.

Press and align the acrylic disk in the base.

Gently remove any epoxy that may have squeezed out from either side of the disk being carful not to smear any epoxy on the exposed rectangular paper window.

Apply pressure to the acrylic disk by temporarily installing the board using three M3x4mm screws and set the base aside till the epoxy cures.

Once cured carefully remove the remaining protective film. This should also remove any remaining epoxy from the acrylic face.

Face EpoxyFace Done

For each of the 4 cover holes over the USB serial charger board status LEDs, follow the instructions as described in step 18 for preparation and installation of the LED light guides.

Light Guides

Solder the separate Red and Black wires to the battery plates as described in step 18.

Remote Wires

Solder the other end of the battery cables to the USB serial charger board as shown in the photos.

Solder the bonded Red/Black power cable to the main board as shown in the photos.

Solder the other end of the Red/Black power cable to the USB serial charger board as shown in the photos.

Solder the remaining 3 wires as shown in the photo between the USB serial charger board and the main board. (DTR, TXD, RXD)

Install the antenna:

Remote Antenna

Remove the protective layer on the antenna’s double stick backing.

Place the antenna in the base as shown in the photo.

Attach the IPEX connector to the main board.

Make sure the switch on the USB serial charger board is set to ON. When this switch is in the other position DTR will not reset the board as needed when uploading a sketch.

Serial Switch

Remove the protective film on the display.

Install both the USB serial charger board and the main board using 6 M2x4mm screws.

Assemble and install the buttons:

Clean up the button prints by removing the support material on the button arms.

Cut the 1mm stainless steel rod into three 15mm pieces. To cut the rod use a cutter with very hard faces. Do not use a cutter designed for copper or you’ll ruin the cutter. Only make an indentation on the rod. Using two pliers, snap the rod at the indentations.

Button Parts

Attach each button to the button plate using the 15mm rod pieces.

Button Assy

Press the button plate into the base as shown in the photos.

Buttons Inst

Slide the battery plates into the battery compartment slots as shown in the photo.

Install the battery.

Install the back cover using the remaining M2 screws. You may want to wait on this step till you successfully load the software. Getting the cover on without pinching the battery wires is kind of tricky but doable. I used tweezers to position the wires so they don’t get pinched when closing the cover. I never got around to changing the design to allow more space for these wires.

Step 16: Assemble the Gateway

Parts:

(7) M2x4mm hex socket button head screws (ISO7380)

(1) set (+ and -) of AA/AAA battery spring plate 10x9mm plate size, ~14x9 including solder tab, 9mm width

(1) 433MHz 40x7mm PCB antenna with IPEX connector

5cm 26awg Red wire

5cm 26awg Black wire

(1) 14x20mm speaker (source)

(1) 30x30mm 1mm thick acrylic square. (source)

2mm diameter acrylic rod (used as a light guide for LEDs)

(1) 10440 AAA size 3.7V Li-ion battery

(1) 2-pin Micro JST PH 2.0 connector & pins (source)

Assembly:

Gateway Assy

Leave the protective film on the display face until final installation.

Place double stick tape on the board within the outline of the display.

Place/adhere the display to the board using the outline printed on the board as a guide.

Cleanup the base print by removing all support material. There will be support material in all cutouts on the top wall (SD, USB and switch). There’s also support material in the speaker bracket slot on the side to the battery compartment.

Ream out the two 3mm LED holes on the base front.

Following the instructions in step 18, ream and install the four 2mm rod LED light guides on the base front.

Preparing and installing the 30x30mm acrylic face:

Pre-fit the acrylic face in the base.

While holding the acrylic face in the base, use a utility knife to scribe the outside square with just enough pressure to cut the protective plastic film and not damage the acrylic.

Remove the face from the base and carefully remove the outer strip of plastic film created in the last step, leaving the center 24x24mm square of protective plastic film in place.

Mix a small amount of plastic epoxy and trowel it on the outside edge of the acrylic face.

Press and align the acrylic face in the base.

Gently remove any epoxy that may have squeezed out from either side of the face.

Apply pressure to the acrylic face by temporarily installing the board using four M3x4mm screws and set the base aside till the epoxy cures.

Once cured carefully remove the remaining protective film from both sides. This should also remove any remaining epoxy from the acrylic face.

Install the 14x20mm speaker

Speaker

The speaker wires can either be directly soldered to the board or you can use a micro JST PH 2.0 connector. If the connector is used, crimp the pins to the speaker wires. Insert the pins into the connector matching the polarity shown in the photo.

Remove the protective layer on the speaker’s double stick backing. Place the speaker in the base as shown in the photo.

Using one M2x4mm screw, install the speaker bracket as shown in the photo. Note that the other end of the bracket fits in a slot on the side of the battery compartment.

Solder the separate Red and Black wires to the battery plates as described in step 18.

Solder the Red and Black wires to the battery connection on the board as shown in the photo.

Slide the battery plates into the battery compartment slots as shown in the photo.

Install the battery.

Remove the remaining protective film on the acrylic face and display.

Install the board using four M2x4mm screws.

Step 17: Upload the Sketches

Both the 3 button remote and the gateway have USB serial ports that can be used to load sketches. Using the settings defined in step 10, open and upload the HikingLoggerGateway.ino and HikingLoggerRemote.ino to their corresponding boards. If you’re able to build either board I’ll assume you know how this is done.

See the FatFsToHex readme file for instructions on how to load MP3 files onto the gateway.

Step 18: Gateway Mode Descriptions

The Gateway has 7 modes: Log, Starting Location Selection, Ending Location Selection, Review Hikes, Save To SD Card, BMP280 Synchronization, and Reset Log Memory.

Not all modes are available at all times. Save To SD Card is only available when you insert an SD card and can’t be exited until the card is removed. BMP280 Synchronization is only available when the synchronization status has changed (success, failed, retry.) Reset Log Memory is only available immediately after ejecting the SD card. Start and End Location Selection isn’t available while a hike log is in progress.

The up and down buttons are used to cycle through the available modes.

Log Mode:

Log Mode

Controls starting, stopping, resuming, ending a log and swapping the start and end locations.

For all states of log mode, the time, temperature and elevation are displayed on the bottom two lines. The temperature can be displayed in Celsius or Fahrenheit. The elevation can be displayed in meters or feet.

When a log isn’t in progress log mode displays the starting location in green, and the ending location in red.

When a log is in progress log mode displays the elapsed time and the percentage complete in terms of elevation gain or loss.

The left and right buttons are used to cycle through the available actions.

To select an action you press the center button, enter.

Starting Location Selection Mode:

Used to select the starting location.

The left and right buttons are used to cycle through the available locations.

To select (change) a location, you press the center button, enter. If you change modes without pressing enter, no change is made.

Ending Location Selection Mode:

Used to select the ending location.

The left and right buttons are used to cycle through the available locations.

To select (change) a location, you press the center button, enter. If you change modes without pressing enter, no change is made.

Review Hikes Mode:

Used to view up to the last 125 hike summaries.

Review Scn1Review Scn2

The center button toggles the summary data displayed. The first screen displays the starting and ending locations, elevations and temperatures. The second screen displays the starting and ending time, the day of week and the hike duration. Line one of both screens lists the hike date.

The left and right buttons are used to cycle through the saved hike summaries.

Save To SD Card Mode:

This mode is only entered when an SD card is inserted and can’t be exited till it’s removed.

When you insert an SD card the prompt ENTER TO SAVE is displayed. Pressing enter initiates a save. When the save completes SAVED TO SD is displayed. You are then expected to remove the SD card. If any buttons are pressed before ejecting the SD card, the reminder EJECT SD CARD is displayed.

Once the SD Card is ejected and the data was successfully written to SD, Reset Log Memory mode is entered otherwise Log mode is entered.

Reset Log Memory Mode:

Only entered when an SD card is ejected after successfully saving log data to SD.

The top line displays RESET LOG.

The left and right buttons are used to toggle between NO and YES.

Pressing enter when YES is displayed will reset/erase the log data stored on the gateway.

Once saved RESET DONE is displayed.

At any point in Reset Log Memory Mode you can use the up or down buttons to exit this mode. You will not be able to re-enter this mode till the SD card is ejected again.

BMP280 Synchronization Mode:

This mode is entered when synchronization with the BMP280 remote is initiated, when synchronization is successful and when synchronization fails or is broken. When synchronization is in progress this mode can’t be exited till it completes successfully or fails. Synchronization takes anywhere from 5 to 10 seconds. When synchronization is successful BMP SYNCD is displayed. When synchronization fails or is broken (battery died on the remote, etc.), SYNC BMP ERR is displayed. When not synced BMP280 Synchronization Mode can be entered into when cycling through the available modes. Entering BMP280 Synchronization Mode will prompt you to press [ENTER] 2 SYNC. This will try again to sync with the BMP280. Once synchronization is finally successful, this mode will no longer be available.

Setting the time and date:

The SerialHexLoader application can be used to set the time and date on the gateway by opening a connection to the USB serial port and then selecting Command->Set Time from the menu bar. The only other way of setting the time and date is to upload the HikingLoggerGateway sketch. This second method is less accurate than the first because it’s based on the build time hard coded into the binary and will be off by the amount of time it takes to upload the sketch.

Step 19: Remote Mode Descriptions

The remote has 4 modes: Info, Log, BMP280 Synchronization, Gateway Synchronization, and Sleep.

Remote

Not all modes are available at all times. BMP280 Synchronization is only available when the synchronization status has changed (success, failed, retry.) Gateway Synchronization is only available immediately after BMP280 Synchronization is successful.

The center mode button is used to cycle through the available modes.

For all modes an indication of the radio activity is drawn as a 2 pixel high bar at the bottom of the display representing the radio activity state plus the number of packets queued to be sent. The queue can hold up to 4 packets (requests sent to the gateway.) Current radio activity is one of the bars, so the total possible bars is five.

Info Mode:

Displays the current time, temperature and elevation. When a log is in progress the elapsed time and percentage complete is displayed. The temperature can be displayed in Celsius or Fahrenheit. The elevation can be displayed in meters or feet.

Log Mode:

Controls starting, stopping, resuming, ending a log and swapping the start and end locations.

When a log isn’t in progress log mode displays the starting location and starting elevation.

When a log is in progress log mode displays the ending location and starting elevation.

The available actions are displayed on the top line of the display. Depending on the available options, pressing either the left of right button enact the command by sending the command to the gateway. The response from the gateway will cause the remote to update the display to reflect the result of the command being enacted.

BMP280 Synchronization Mode:

This mode is entered when synchronization with the BMP280 remote is initiated, when synchronization is successful and when synchronization fails or is broken. When synchronization is in progress this mode can’t be exited till it completes successfully or fails. Synchronization takes anywhere from 5 to 10 seconds. When synchronization is successful Gateway synchronization begins. When synchronization fails or is broken (battery died on the remote, etc.), SYNC BMP (in red) and [LEFT] 2 SYNC (in white) is displayed. BMP280 synchronization mode can’t be exited till it’s successful. BMP280 synchronization mode will prompt you to press [LEFT] 2 SYNC. This will retry BMP280 synchronization. When BMP280 synchronization fails, the only other UI option available is to put the remote into deep sleep by pressing the left and right buttons for 2 seconds.

Gateway Synchronization Mode:

This mode is entered immediately after BMP280 synchronization is successful. When synchronization is in progress SYNCING BASE is displayed and can’t be exited till it completes successfully. Gateway synchronization takes anywhere from 1 to 5 seconds. The only indication that gateway synchronization has failed, is that the message SYNCING BASE will remain displayed passed the expected sync time. This will only happen if the gateway isn’t running or out of range. The only UI option available when synchronization fails is to put the remote into deep sleep by pressing the left and right buttons for 2 seconds. Because this is a remote it’s useless if it can’t sync with the base. For this reason I didn’t write any additional code to deal with this rare situation.

Sleep Modes:

The 3 button remote has two sleep modes, a light sleep mode that just powers down the display, and a deep sleep mode that powers down the entire board including the RTC. When waking from either sleep mode the remote uses the packet broadcast from the BMP280 remote to know when to communicate with the gateway. When the remote is sleeping the gateway keeps its receiver on a few milliseconds after the BMP280 packet arrives to listen for a possible sync request from the 3 button remote. The response sent by the gateway to the 3 button remote sets up the current time, the current start and end locations, and whether a hike is in progress. The request from the 3 button remote also lets the gateway know that the remote is awake. The gateway will keep its receiver on till the remote goes to sleep. The remote goes into a light sleep mode automatically after 2 minutes of inactivity and a deep sleep mode when the left and right buttons are held down for 2 seconds. To wake up from light sleep the center “mode” button is pressed. To wake up from deep sleep mode the center mode button needs to be held down for 2 seconds. This 2 second requirement limits the chances of accidentally waking the 3 button remote when it’s in your pocket. Note that deep sleep can't be entered from Log mode to prevent accidental starting/stopping of the log.

Step 20: Boards Availablity

If anyone would like any of the bare boards, contact me and I'll share them on PCBWay.

The USB Serial w/Charger is already shared: https://www.pcbway.com/project/shareproject/USB_S...

If anyone in the US would like to purchase any of the boards already assembled, contact me.

Be the First to Share

    Recommendations

    • Raspberry Pi Contest 2020

      Raspberry Pi Contest 2020
    • Wearables Contest

      Wearables Contest
    • Fix It Contest

      Fix It Contest

    2 Discussions

    0
    a-morpheus
    a-morpheus

    1 day ago

    Nice Instructable, looks like a ton of work went into the project. What other wireless solutions than the RFM69CW did you consider and what made you choose that one? Since all the devices are very close to each other (a meter or two?) it seems like there'd be lower power and cheaper solutions like HC05 bluetooth or the 433MHz transceivers this guy used https://www.instructables.com/id/Low-Cost-Wireless-Sensor-Network-on-433MHz-Band/ which apparently go down to 4.7 microamps in deep sleep (not sure what the power consumption of the RFM69CW is though).

    0
    JonMackey
    JonMackey

    Reply 1 day ago

    There was a possibility that the BMP280 remote would also be used in a different project that needed greater range. Other factors: I also had several RFM69CW on hand, and I already worked with it on other projects. The sleep current is good enough, around 0.1uA. Something is chewing up battery on all of the boards and I suspect the DC-DC converter. Maybe I don't have it implemented correctly. The BMP280 remote lasts about a month on a charge, but it should be longer based on the specs. I've gone through all of the MCU pins to make sure they aren't back feeding during sleep (pulled up when they should be pulled down, etc..) I don't have a meter that can accurately measure uA.

    The RTC on the gateway is a just a clock crystal. It's accurate down to about 10F and then it drifts a bit. I'm changing the design to use a temperature compensated crystal oscillator (the ubiquitous DS3231.)

    Re ton of work: most of the time went into the font classes and the app that generates the compressed bitmaps.