Wichit Sirichote, firstname.lastname@example.org
Build a bluetooth data logger for temperature recording with a PIC18F46j11 microcontroller and a DS1820 temperature sensor.
This device is designed for temperature recording in the chilled products under transportation. The design features are sealed box, one channel temperature sensor, battery operated, bluetooth interfacing and wireless charging.
Figure 1: The prototype of the M-Logger V1.0
The simplified block diagram of the instrument is shown in Figure 2. Temperature sensor is one-wire interfaced DS1820. The microcontroller interfaces the DS1820 using one line I/O bit. The temperature reading is saved to the SPI RAM. Data uploading is transferred through the Bluetooth modem board using 9600 UART, TxD and RxD. The circuit is powered by a +3.7V Li-ion cell phone battery. The bluetooth modem is powered by a +5V from the receiver pad. The power pad also provides the charging to the battery as well.
Figure 2: Simplified block diagram.
Figure 3: Hardware schematic (click to enlarge).
The complete schematic is shown in Figure 3. The microcontroller, PVN1 is PIC18F46J11, 44 pin TQFP. The chip runs with internal 4MHz oscillator. Timer1 oscillator, 32,768Hz is for internal RTCC (Real-Time Clock and Calendar) module. U1, DS1820 is interfaced to the MCU at PORTB, RB4. The memory for data storage has two chips, U2 and U4. The memory chips are SPI interface 32kB each. J1 is for Bluetooth modem interface. J3 is for +5V from the receiver pad wireless charger. BT1 is +3.7V Li-ion battery. The battery is also charged with the receiver pad. D1 is status LED.
The Bluetooth modem is built with a CSR Bluecore4-external chip sets. It has 8MBit Flash memory for software storage and settings. Output power is Class II. The modem is powered with a +3.3V power source. Settings is done with AT command mode. The default speed for parameters settings is 38400 8n1. Paring code is 1234. We can use any VT100 terminal to set the parameters with AT commands easily.
Figure 4: Bluetooth modem with TX and RX interface.
The circuit is built with a double sides PCB. On the top layer, only the MCU and two chips SPI RAM are soldered. The sensor DS1820 is closed to box and taped with aluminum sticker. The receiver coil are placed under the PCB.
Figure 5: MCU board without Bluetooth Righthand is DS1820 under aluminum stricker. Below the MCU is two SPI RAM. Lefthand is +37V Li-ion battery. Receiver coil is placed on the bottom.
Figure 6: Receiver coil for wireless charger.
The Bluetooth modem is plugged to the MCU board at J1 connector. The 2GHz antenna is PCB trace. The LED shows connecting status. When the device is placed on the charger pad, it will provide power to the bluetooth modem.
Figure 7: MCU board with Bluetooth. The bluetooth is powered only when receiving coil gets electromagnetic energy from the transmitter's coil at the charger pad.
Connecting with Bluetooth
To connect the device with PC as the master, we can use a cheap bluetooth USB adapter. When place the device on the charging pad, the bluetooth is then trying to connect to the PC. Paring code is '1234'.
Figure 8: The bluetooth modem is operated only when the data logger is placed on the charging pad.
When double click at the bluetooth icon, we will see the available COM ports being assigned for bluetooth device. For the PC as the master, we can use COM18 in the Outgoing direction.
Figure 9: Available COM ports for bluetooth devices
We can see the device name, "M-Logger-V1-Bluetooth" with 1234 as the passkey.
Figure 10: Device name appeared.
Now we can use Putty as the terminal interface with 9600 8n1 format. Choose COM18 for connecting the data logger.
Figure 11: Choose COM18 with 9600 speed.
Press ENTER and ? command for help. We get below window. To read sensor once, press "/" key.
Figure 12: Commands list with ? key.
The printable records can be uploaded and saved as the CSV file by settings the log file from the Session-Logging easily. The sample file mlog1.csv can be opened with spreadsheet software then.
The data logger was tested for recording below zero degree Celsius in the ice cream refrigerator. Figure 13 shows the sample plot.
Figure 13: Sample plot.
Download Schematic, HEX file , Bluetooth Datasheet
27 March 2013