usb data logger

Not rated 9,062

Circuit Image

The Vinculum board is controlled using DOS commands. Each time a command is sent, if executed successfully, the board responds with "D:>", indicating readiness for the next command. Sending commands faster than the Vinculum board can execute them, without waiting for the "D:>" response, can lead to errors in stored data and potential crashes. To address this, the Arduino sketch listens for a response from the Vinculum board after sending each command. If it receives "D:>", referred to as the "ok" response, it proceeds to send the next command. If it receives "No disk", the process stops until a disk is inserted and the start write button is pressed. The start/stop write button functions by being held down for 2 seconds to initiate writing, with an LED indicator turning on, and held down again for 2 seconds to stop writing, turning the LED off. If the Arduino's wait for "ok" response code receives a "no disk" response, the LED is automatically turned off. This Arduino sketch operates independently from other energy monitor hardware and code, writing values set in variable declarations to the board as a demonstration. The Arduino is connected to the internet via an Ethernet shield to upload values to a MySQL database every 10 seconds. However, occasional crashes cause it to go offline, resulting in data loss during that time. The intention is to save this data to a USB drive for later updates to the MySQL database with the missing data.

The Vinculum board serves as a bridge between the Arduino microcontroller and a storage medium, allowing for data management through DOS command protocols. The communication between the Arduino and the Vinculum board relies on a clear command-response mechanism to ensure data integrity and operational reliability. The Arduino sketch implements a state machine that effectively manages the communication flow, ensuring that commands are only sent when the Vinculum board is ready to process them.

The command-response cycle is initiated by sending a command from the Arduino to the Vinculum board. Upon successful execution, the board replies with "D:>", signaling that it is prepared to receive the next command. This ensures that commands are not sent in rapid succession, which could overwhelm the board and lead to data corruption or system crashes. The sketch includes logic to handle the "No disk" response, which prevents further write attempts until a valid storage medium is detected. This feature is crucial for maintaining data integrity, as it prevents the Arduino from attempting to write to a non-existent disk.

The start/stop functionality of the write button is implemented with a simple user interface, allowing the operator to control the writing process effectively. The LED indicator provides visual feedback, enhancing usability by signaling the current state of data writing. The sketch's ability to turn off the LED automatically upon receiving a "no disk" response further improves user experience by clearly indicating when the system is not ready for writing.

In scenarios where the Arduino experiences connectivity issues while uploading data to the MySQL database, the capability to store data on a USB drive serves as a backup solution. This feature ensures that critical data is not lost during offline periods, allowing for later synchronization with the database. The overall design emphasizes reliability, user control, and data integrity, making it suitable for applications requiring consistent data logging and management.The Vinculum board is controlled using DOS commands and so every time you send a command if the command is executed successfully the board sends a D:> response that indicates its ready for the next command. If you try and send commands faster than the Vinculum board takes to execute them and don`t wait until after the Vinculum board has sent the D:>  ready for new command response, I

found I would get errors in the data stored and it would sometimes crash. To solve this the arduino sketch code listens for a response from the Vinculum board after it sends each command, if it receives D:>  which I`ve called the ok response then it can go on to send the next command. If it receives No disk  it stops trying to write to a non existent disk and waits until a disk is inserted and the start write button is pressed.

Just a simple start/stop write button. To start writing you hold the button down for 2s and the led comes on to indicate writing. To stop writing you hold it down again for 2s and the led turns off. If the arduino wait for `ok` response code receives a `no disk` response. The led is automatically turned off. The arduino sketch here works with the board independently of any of the other energy monitor hardware and code. It will just write the values set in the variable declaration to the board as an example. I have my arduino connected with the ethernet shield to internet to upload values to mysql database each 10 seconds, but sometimes it crashes and it goes offline, i loose all the data for that time.

I would like to save that data to the usb so that later i can update the mysql database with the missing data. 🔗 External reference