Difference between revisions of "Serial Data Logger SKU: PZSSD002"

From CQRobot-Wiki
Jump to: navigation, search
(Example and Test Code)
(Product Display)
 
(6 intermediate revisions by the same user not shown)
Line 16: Line 16:
 
=='''Product Display'''==
 
=='''Product Display'''==
  
[[image:PZSSD002-1-1.jpg|thumb|1200px| center]]
+
[[image:PZSSD002-1-2.jpg|thumb|1200px| center]]
 
----
 
----
  
Line 93: Line 93:
  
 
Upload the program to the Arduino control board, first connect VCC and GND, then the S LED light of the module will flash once; Save the data once; insert the SD into the computer and open the text under the FILE file to see the saved data.
 
Upload the program to the Arduino control board, first connect VCC and GND, then the S LED light of the module will flash once; Save the data once; insert the SD into the computer and open the text under the FILE file to see the saved data.
 +
 +
[[File:PZSSD003-2.jpg|800px]]
 +
 +
'''2. Raspberry Pi Connection Method'''
 +
 +
[[File:PZSSD002-5.jpg|600px]]
 +
 +
'''2.1 Initialize the UART first, and enter the command sudo raspi-config----->3 Interface Options---->I6 serial Port--->No---->Yes---->Finish in the terminal'''
 +
 +
[[File:PZSSD003-3.jpg|600px]]
 +
 +
[[File:PZSSD003-4.jpg|600px]]
 +
 +
'''2.2 Serial port to send data'''
 +
 +
Enter the Raspberry Pi terminal, execute the following command to open the serial port software
 +
 +
<pre>
 +
sudo apt-get install minicom
 +
sudo minicom -D /dev/ttyS0
 +
</pre>
 +
 +
[[File:PZSSD003-5.jpg|600px]]
 +
 +
Press Ctrl+A--->Z--->E key
 +
 +
[[File:PZSSD003-6.jpg|600px]]
 +
 +
Connect the Pzsmocn serial port data recording module as above, when we send data to the serial port, the SLED light on the module will flicker, and the data will be saved in the SD card of the module, insert the SD card into the computer and open the text under the FILE file to see saved data.
 +
 +
[[File:PZSSD003-7.jpg|600px]]
 +
 +
[[File:PZSSD003-8.jpg|600px]]
 +
 +
 +
'''3. Frequently Asked Questions'''
 +
 +
 +
*The CONFIG.TXT file cannot be automatically generated when the module is powered on. Confirm whether the USB host is used to supply power to the module.
 +
*The SD light does not light up when writing data to the module quickly. A: The SD card has a lifespan of 100,000 times of erasing and writing. To ensure the life of the SD card, the module writes data to the SD card about 50ms or 512 bytes once.
 +
*When does the module enter the USB disk mode? When to enter data storage mode? A: When using a USB host to connect the module, the module enters the U disk mode, and at this time, data cannot be stored in it, and the CONFIG.TXT file and new blank files will not be automatically generated when the power is turned on. In other cases, the module enters the data storage mode. If the module does not have a CONFIG.TXT file, it will automatically generate a CONFIG.TXT file and a new blank file.
 +
*How to solve the garbled characters of recorded data? A: Check if the format you open is UTF-8. This module can only record character data, if you write raw data or hex data, it will form garbled characters.
 +
 
----
 
----

Latest revision as of 15:28, 15 January 2023

Serial Data Logger V1

Introduction

Compared to the previous MicroSD Card Module, this Pzsmocn serial data logger V1 can store data more conveniently, and supports direct data printing through serial port without additional codes.

The Pzsmocn serial data logger V1 supports 32GB TF card, Onboard high-performance AC6925B chip, making it suitable for long-time data storage. It comes with a USB function, which means you can directly connect it to a PC to read the stored files without using a card reader. Meanwhile, with the onboard LED indicator, data writing status can be viewed visually. And the onboard SAVE pin makes it easier to store data into separate files.

AC6925B Chip Specification Download

Media: AC6925B Datasheet V1.0.pdf


Application

  • Offline Data Collection
  • Capture Product Debug Logs
  • Robots and Drones Debug

Product Display

PZSSD002-1-2.jpg

Specifications

  • Model: PZSSD002
  • Main Chip: AC6925B
  • Supply Voltage: 3.3V to 5V
  • Operating Current: 23mA
  • USB Protocol: USB2.0
  • Operating Temperature Range: -30 Degree Celsius to +85 Degree Celsius
  • Operating Humidity Range: 5%RH to 85%RH
  • Support: 32GB TF card
  • Dimension: 23.5mm * 25mm
  • Mounting Hole Size: 3.0mm

Pin Description

Note: The SD LED indicator is an indicator for data interaction between the module and the storage, and the light flashes when data is written or a new file is created.


PZSSD002-2.jpg

First Time Using

  • If the storage is not formatted, please format the storage first, the file system is FAT32.
  • Power on the module for more than 2S (non-USB host), so that the module will automatically generate the CONFIG.TXT file, and the SD light will flash once.
  • Check whether the CONFIG.TXT file is generated normally. You can modify the communication baud rate and file storage name of the module by modifying CONFIG.TXT.

PZSSD003-1.jpg

  • Baud: Serial communication baud rate selection (00 corresponds to 2400 baud rate, 01 corresponds to 4800 baud rate), the module baud rate matches the main control serial port printing baud rate to store data normally.
  • FIleNum: The file serial number of the next new file (FileNum=0099, the next generated file name is FILE0099.txt), if the file already exists, it will skip this file and continue to search.

Notice

  • Do not send data to the serial port of the module before the CONFIG.TXT file is generated.
  • Do not connect USB and serial port at the same time.
  • Connect to the computer via USB, it is recommended to eject the U disk and then pull out the module.

Example and Test Code

1. Arduino Connection Method

Note: The DuPont wire female single-head wiring we distribute cannot be directly connected to the UNO R3 control board. When wiring, it is necessary to stack the sensor expansion board on the UNO R3 control board, or connect the male-to-male Dupont wire (bread wire) on the Dupont wire female single-head wiring.

In the experiment, we connected the interface of the sensor to the UNO R3 control board.

PZSSD002-4.jpg

1.1 Download and Run the Test Examples

Media: PZSSD002_Arduino_Code_A.rar


1.2 Arduino test code

#define SPIN 6  //Connect the S pin of the module, and the low level triggers to save the file.
uint16_t i = 0;
void setup(void){
  Serial.begin(9600);
  delay(2000);  //To prevent data loss, delay for a period of time and wait for the module to start.
  pinMode(SPIN, OUTPUT);
  digitalWrite(SPIN, HIGH);}
void loop(void){
  Serial.println(String(i));
  i++;
  if((i % 10) == 0){
    digitalWrite(SPIN, LOW);
    delay(500);
    digitalWrite(SPIN, HIGH);
  }
  delay(300);
  }

1.3 Test methods and results

Upload the program to the Arduino control board, first connect VCC and GND, then the S LED light of the module will flash once; Save the data once; insert the SD into the computer and open the text under the FILE file to see the saved data.

PZSSD003-2.jpg

2. Raspberry Pi Connection Method

PZSSD002-5.jpg

2.1 Initialize the UART first, and enter the command sudo raspi-config----->3 Interface Options---->I6 serial Port--->No---->Yes---->Finish in the terminal

PZSSD003-3.jpg

PZSSD003-4.jpg

2.2 Serial port to send data

Enter the Raspberry Pi terminal, execute the following command to open the serial port software

sudo apt-get install minicom
sudo minicom -D /dev/ttyS0

PZSSD003-5.jpg

Press Ctrl+A--->Z--->E key

PZSSD003-6.jpg

Connect the Pzsmocn serial port data recording module as above, when we send data to the serial port, the SLED light on the module will flicker, and the data will be saved in the SD card of the module, insert the SD card into the computer and open the text under the FILE file to see saved data.

PZSSD003-7.jpg

PZSSD003-8.jpg


3. Frequently Asked Questions


  • The CONFIG.TXT file cannot be automatically generated when the module is powered on. Confirm whether the USB host is used to supply power to the module.
  • The SD light does not light up when writing data to the module quickly. A: The SD card has a lifespan of 100,000 times of erasing and writing. To ensure the life of the SD card, the module writes data to the SD card about 50ms or 512 bytes once.
  • When does the module enter the USB disk mode? When to enter data storage mode? A: When using a USB host to connect the module, the module enters the U disk mode, and at this time, data cannot be stored in it, and the CONFIG.TXT file and new blank files will not be automatically generated when the power is turned on. In other cases, the module enters the data storage mode. If the module does not have a CONFIG.TXT file, it will automatically generate a CONFIG.TXT file and a new blank file.
  • How to solve the garbled characters of recorded data? A: Check if the format you open is UTF-8. This module can only record character data, if you write raw data or hex data, it will form garbled characters.