Skip to content

This is an 8-channel logger for collecting temperature data (431 160 readings). Data export via USB Flash Drive (Pendrive).

Notifications You must be signed in to change notification settings

rtek1000/Datalogger_2039

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

Datalogger 2039

  • This is an 8-channel logger for collecting temperature data (431 160 readings).
    • Data export via USB Flash Drive (Pendrive).
    • Digital sensor.
  • Project started in Jan/2019.
    • Note: Work in progress, just demonstrative, not (fully) functional, sorry.
    • If you are using a browser on your smartphone, use the landscape screen to read more characters in the file names.
      • (These files have already been cited elsewhere, and changing the name of the folders causes corruption of the references)

Features:

  • 12-bit temperature sensor [DS18B20 from -55°C to +125°C (-67°F to +257°F)]
    • Needs two cycles to reset fault (Cycle 1: Start converting; Cycle 2: Read)
  • 16-bit temperature sensor [TMP117 from -55°C to 150°C and from 0°C to 85°C for letter M code)]
  • Short circuit protection for sensors (power and data line).
  • Short-circuit protection for the USB ports (power line).
  • 56 characters channel label.
  • Special character supported for channel label (À/Á/Ã/Â/Ä).
  • Channel label Ctrl+C/Ctrl+V (copy/paste) supported.
  • 53 895 readings per channel (37 days, 10 hours and 15 minutes @ 1 minute interval).
  • Control access to settings and data export via password.
  • Export data via USB Flash Drive (Pendrive) (*.dat file).
    • Before removing the USB disk It is recommended to exit the Export screen to completely disable the USB port.
    • Need to format the USB disk in FAT (FAT32, LBA; exFAT may be faster), or it will give an error.
    • Output file with part of the data encoded in Base64. Need to decode the data to import into a spreadsheet, see the File Converter App.
    • Formatting USB flash drive on Android did not cause error (tested on Motorola Smartphone and Android version 10).
    • Quick formatting may cause an error if the previous partition is not FAT, in this case use full formatting.
  • USB Flash Drive (Pendrive) format function (Be careful, all files will be lost).
    • Some USB disks may not be recognized correctly on Android smartphones when using exFAT.
  • Edit parameters via USB keyboard.
    • Keyboard may take a few seconds to recognize.
  • Cabinet tilt monitoring.
  • Battery and charger voltage monitoring.
  • Battery polarity reversal protection (In case the Datalogger 2039 is using two batteries, it is not recommended to reverse any of them, or it may damage the battery).
  • Monitoring of data in colored graph.
  • Can save Screenshot to USB flash drive (PrintScreen key).
  • Multiple languages (English, Portuguese and Spanish).
  • Integrated firmware integrity check (CRC).
  • Energy saving for prolonged battery charge and durability of the LCD backlight.
    • Microcontroller operates in two modes, low power at only 40MHz clock and normal power at 168MHz clock.
    • The display is activated only when the microcontroller is clocked at 168MHz.
    • The display backlight has 3 operating states: high brightness, low brightness and off.
    • When the sensor is read, a conversion interval of 750ms is required (DS18B20), during which time the microcontroller sleeps.
  • Temperature offset. On the sensors screen, press the number between 1 and 8 to open the offset adjustment screen.

Software:

  • Firmware for STM32F407VGT6 microcontroller:
    • STM32CubeIDE - C language project (HAL).
  • File Converter:
    • ̶B̶4̶J̶ ̶-̶ ̶B̶a̶s̶i̶c̶ ̶l̶a̶n̶g̶u̶a̶g̶e̶ ̶p̶r̶o̶j̶e̶c̶t̶ ̶(̶J̶a̶v̶a̶ ̶-̶ ̶c̶r̶o̶s̶s̶ ̶p̶l̶a̶t̶f̶o̶r̶m̶)̶.̶

Hardware:

  • STM32F407VGT6: Dual USB port microcontroller.
  • DS18B20: OneWire digital temperature sensor (±0.5°C Accuracy from -10°C to +85°C).
  • TMP117: I2C digital temperature sensor (±0.1°C; 16 bits).
  • TCA9548A: 8CH I2C Multiplexer.
  • CD74HC595: Port expansion (8-Bit Serial-In, Parallel-Out Shift)
  • ILI9341: SPI TFT LCD 2.4 inch.
  • W25Q64: SPI flash memory (64M-bit).
  • DS3231: I2C extremely accurate real time clock - RTC.
    • CR2032: Lithium 3.0V battery backup.
  • MPU6050: I2C accelerometer (ACC).
  • USBLC6-2: ESD protection.
  • STMPS2141: Enhanced single channel power switch (500mA continuous current)
  • 18650: Li-ion 3.7V battery backup.
  • TP4056: Battery charger.
  • MCP1700: 1.6 µA Quiescent Current (IQ) Linear voltage regulator.
  • LMR14020: High efficiency 2.2 MHz 2A Step-Down Converter (40V, 40µA IQ).
  • MT3608: High Efficiency 1.2MHz 2A Step Up Converter (Up to 28V)
  • LAN8720: High-Performance 10/100 Ethernet (For future connectivity expansion).
  • 12V DC charger (9V~24V x 2A)
  • Multi-functional button:
    • For manual activation when in economy mode
    • To force restart of the USB port (keyboard)
    • To force restart the microcontroller

Note:

Note: If the pins PA13 (SWDIO) and PA14 (SWCLK) are used (configured for another option other than the default state) it may prevent the ST-Link from working, to solve this problem, keep the BOOT0 (pin 94) in logical state high (3.3V) before energizing (reset the microcontroller). To not need to manually change the BOOT0 pin, keep the pins PA13 (SWDIO) and PA14 (SWCLK) unused, it also cannot be configured as input.


ToDo

  • Add factory reset (W25Q64 chip erase).
  • Add offset adjustment lock if sensor is in use.
  • Add a link to the offset value to the sensor serial number (user may need to reposition sensors).
  • Add / Implement drivers for I2C and SPI peripherals using DMA.
  • Modify USB Flash Drive port power to be enabled only when data export is confirmed.
  • Note: Fixes and improvements noted in the changelog.txt file.
    • Annotations started from project update date using STM32CubeIDE version 1.12.1 (FW_F4 1.27.1).

Downgrade firmware

Note: To go back to version 0.0.7 after installing firmware 0.0.8:

  • Version 0.0.7 does not support the Wireless Mini Keyboard with Touchpad built in.
    • User needs to use normal USB keyboard without built-in touchpad.
  • Version 0.0.7 powers USB ports differently than version 0.0.8.
    • If the battery is disconnected or low charge, infinite loop may occur when booting.
    • On the serial port UART1 it is possible to see that an infinite initialization loop occurs (via PuTTy 115200 bauds).
    • Only the 5V regulator (U12) does not provide enough power to activate the DC-DC converter (U11) with the USB ports in use.
    • Without 5V from U11, the display cannot turn on.
    • The user can disconnect the keyboard (USB1) to verify that the problem stops occurring.
    • User needs to provide functional battery for normal operation.

LCD Graph screen screenshot:

img

img


STM32 internal hardware USB:

img

Each model may have an ERRATA document, check on the ST website under the Documentation tab. Series of STM32 can have similar functions, as for example the F4 and F7 series:

img


Failures may occur in the USB port operating as a Host if the connected device lacks synchronization (not very accurate time base, such as using a ceramic resonator instead of a quartz crystal). The same device (joypad) that failed with STM32, didn't fail with Arduino and MAX3421e, can be an interesting alternative, library: UHS3.0

  • The image below shows data that the STM32 read from the device during the device recognition (enumeration) procedure, and subsequent readings are not the same.

img

(Test code):

#if PRINT_HID_REPORT_DESCRIPTOR == 1
			USBH_UsrLog("Dump HID Report Descriptor start");
			printf("wItemLength %d\n", HID_Handle->HID_Desc.wItemLength);

			for(uint16_t i = 0; i < HID_Handle->HID_Desc.wItemLength; i++){
				printf("0x%02X ", phost->device.Data[i]);
			}

			printf("\n");
			USBH_UsrLog("Dump HID Report Descriptor end");
#endif // #if PRINT_HID_REPORT_DESCRIPTOR == 1

Licence:

Hardware:

Released under CERN OHL 1.2: https://ohwr.org/cernohl

Software:

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

About

This is an 8-channel logger for collecting temperature data (431 160 readings). Data export via USB Flash Drive (Pendrive).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages