A project log for Data Logger

A simple and extensible data logger with Bluetooth

Brian CornellBrian Cornell 10/12/2018 at 18:350 Comments

The hardware design is simple.  Most of the PIC’s pins are dedicated to data collection.  The PIC's Vdd=5V so, the RS232 output lines require voltage dividers to interface to the Bluetooth module.  A higher Vdd was done to provide the PIC’s ADC a more range at the expense of resolution (4.88 vs. 3.22 mV per bit).  A tuning fork crystal is connected to the secondary oscillator to keep accurate time for logging.

Microchip’s RN4677 hybrid BT Classic / BLE module is used for its support of SPP, command line interface, and ease of use.  Most of its features aren’t used; it essentially provides a wireless connection for the serial data.  You should be able to use it out of the box:  default settings are 115.2kbps, 8 data bits, 1 stop, no parity.  I do recommend changing the service name.  I do recommend changing the service name for easier identification.

Power is supplied by batteries or an external power supply to LDO regulators.  The unit will accept 6-10VDC or the 5V LDO can be bypassed by connecting regulated 5VDC to the appropriate terminal lug.  When this is done the batteries can serve as a UPS should external power be lost.

As previously mentioned, I opted to include on-board light & temperature sensors since these are often needed in the testing I do.  It also gives the unit some versatility to perform basic environment monitoring & control.  These sensors share pins with ICSP so DIP switches are used to disconnect when the PIC’s firmware needs updating.

Three additional analog inputs are made available on a terminal block as are four digital inputs and two digital outputs.  A 6-pin ICSP header is included for firmware updates.  Also included are provisions for connecting to the RS232 bus in case the RN4677 requires changes.  The MPU Disable switch holds the PIC in reset so it doesn’t interfere with communication.

Note that the RN4677 might not be available and I believe Microchip recommends the RN4678 which should be pin-compatible.

The hardware footprint could be compressed but I opted for this because of extensibility:  real-world connects require additional interface circuitry.  I had a case in mind that would allow for the stacking of interface cards.

Here's a picture of a setup I've used for a couple of different projects.

The adapter to the left of the enclosure is a 5V USB supply for applications where AC is handy.  Otherwise 4 AA batteries supply a nominal 6V to the LDO..

The perf board contains a number of discrete circuits.  The top left is a comparator that drives one of logger's digital inputs.  It is connected to the AC cord on the right side of the box.  The plug contains a neon lamp fused to photo-transistor and is used to indicate when an AC circuit is energized without introducing an impedance to the line when off.  The bottom right is an LDO that allows logger to be powered by DC sources higher than 10V.  The bottom left contains a set of hall effect current sensors and a voltage divider for sensing DC voltages between 10~20V.  All of these employ noise filtering and connect to analog inputs.  The jumper from the ICSP pins delivers 5V to the interface circuitry.