Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Inflatable Hard Drive - transferal of data between three devices via USB

Status
Not open for further replies.

wizman

Junior Member level 1
Junior Member level 1
Joined
Jan 3, 2020
Messages
16
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Activity points
139
Hello Everyone,

Small caveat to begin, I'm a product design student with very basic knowledge regarding electronics and coding, which is worth keeping in mind if i use some technical terms out of place.

For context, I'm proposing to build an inflatable hard drive. I have code* which reads the amount of data on the hard drive, and outputs this number as serial data which can be read by the arduino. The arduino would then, in theory, power one of two pumps for x amount of time, either inflating or deflating a balloon. Ideally, you would use the device in the same way you do an external hard drive e.g. plug your computer in via USB and transfer data. With the exception that this one inflates or deflates a certain amount depending on the amount of data you either add or remove

Both the code that serially outputs the hard drives capacity and the arduino code shouldn't be an issue. However, I don't know how to transfer the 'information' between devices with a single USB port

IHD inputs.jpg

Thinking it through in steps gives me this flow of information.

  1. Computer is connected to hard drive via USB port
  2. File is uploaded to hard drive
  3. Code ascertains change in hard drive capacity and converts this to serial data
  4. Computer sends serial data to arduino via USB port

I'm under the impression that the flow of electricity can be thought of in basic terms as similar to that of water. In which case i'm looking for a hub like component that redirects the flow of information from the hard drive to the arduino when that information is transmitted serially. Does this exist?

*The code was written with the help of a technician in node.js, a language I have zero experience in. Here is the github of some of this code https://github.com/wisemanlove/IHD taken from this folder IHD code folders.jpg
please let me know if it would be helpful to see more code.
 

Maybe I'm missing something, but you seem to have an enormous misunderstanding of, well, everything. The way you describe it, your system inflates a balloon proportional to the AMOUNT with no regard to WHAT the actual data is? Hard drives dont change size. They dont get smaller when you read data. You need to either rethink your idea, or explain it better.
 

My apologies. It is not the hard drive itself which inflates, but rather an external component e.g. a balloon, which inflates or deflates in proportion to the amount of data on the device. In theory the volume of the balloon will be mapped to the capacity of the drive such that at the drives full capacity the balloon is also full. The balloon is representative of the drives capacity, and the information i'm transferring between devices relates to the amount of time that pumps are powered to inflate that balloon relatively.

IHD concept.jpg
 

In your original post you said: "I'm proposing to build an inflatable hard drive". Then you said: " Ideally, you would use the device in the same way you do an external hard drive".

You are, in fact, using it NOTHING like a hard drive.

I think you are on a fool's errand.

First of all, what is even the point of having a balloon proportional to the utilization of a hard drive's utilization?
Secondly, what do you really mean "The balloon is representative of the drives capacity"? You would have to measure pressure, volume and temperature in order to relate it HD utilization. (PV=nRT)
Thirdly, the amount of time the pump runs is NOT linearly related to the PV (pressure and volume) of the HD. As the balloon fills the back pressure increases and the pump adds less air to the balloon for a given run time.
 

I’m struggling to understand
what is even the point
of your replies as they continually ignore the question I actually posed regarding
the flow of information
between devices. The only
fool's errand
currently being undertaken is by the muppet who seems intent on misunderstanding quite a simple proposal and giving an opinion where it isn’t wanted and hasn’t been asked for.

Your seniority on this forum, and textbook knowledge of equations i have no use for, implies that you do in fact know whether devices can be read, and written to, over a hub that takes one USB input and 'splits' it between two devices. If this falls within your purview please let me know.
 

Parts of your post are violating forum rules about Insulting posts, personal attacks or purposeless inflammatory posts.

It might be deleted by moderators if users complain about it.

In terms of data transfer, it makes no difference how the Arduino device visualizes information, hence we can abstract from the balloon inflation topic for the time being and don't need to worry about the involved physics now.

i'm looking for a hub like component that redirects the flow of information from the hard drive to the arduino when that information is transmitted serially. Does this exist?
Yes and no. It could be designed but doesn't make much sense. PC is communicating with hard drive in high speed (480 MBPS) or even USB 3.0 superspeed (several GBPS), using the dedicated USB mass storage device protocol. PC to Arduino interface is through a virtual COM port with full speed (12 MBPS), net data amount limited by the Arduino serial interface to e.g. 115 KBPS. Arduino USB interface neither talks MSD protocol nor handles the speed. So redirect doesn't work. Fortunately you don't want to redirect the data, only the information about transmitted data. Furthermore the data transfer doesn't directly reflect the storage utilization. You can read a file once or hundred times, but it's still stored on the hard drive. In contrast, deleting files doesn't involve much data transfer.

More generally speaking, flow of information is rather different from flow of electricity or water.

A straightforward solution would be to run an application on the PC that continuously monitors the hard drive storage utilization and sends the information to Arduino.
 

Computer is connected to hard drive via USB port
File is uploaded to hard drive
Code ascertains change in hard drive capacity and converts this to serial data
Computer sends serial data to arduino via USB port

Computer is connected to the hard disk via the USB cable; the filesystem reports the amount of hard disk used.

How this information comes to the arduino? You need to have a connection to the arduino so that it knows the file size.

It is wrong to say that the hard disk capacity changes; the only thing that changes is the number of blocks (or sectors) being used at a given time.

Hard disk is a block device; the files are written or deleted by software called device driver in units of blocks or sectors.

The device shown is a SATA device but it cannot communicate directly with arduino and a PC at the same time.

Your arduino need to be connected to the PC and the PC can ask the space occupied on the hard disk and send that information to the arduino. That can be performed periodically.

The The arduino can be asked to inflate and deflate a balloon in direct proportion of the % of disk filled with data.
 

Untitled-2.jpg

Your arduino need to be connected to the PC and the PC can ask the space occupied on the hard disk and send that information to the arduino. That can be performed periodically.

Can this not be done over a single usb port? Surely the computer does not need a separate connection directly to the COM port of the arduino. Can the data lines of the usb be used to send the serial data to the arduino via the digital input connections on the arduino?
 

Can this not be done over a single usb port?
Yes.
Can the data lines of the usb be used to send the serial data to the arduino via the digital input connections on the arduino?
No, you need to connect the Arduino USB port.

You can use a standard USB (mini) hub with at least two downstream ports.
 

I've ordered this. Will let you know how it goes. Many thanks for your help everyone.

It may be wise to think in advance how you are going to connect it. The SATA hard disk can be connected to a PC and the arduino can be connected to the PC. Where you are going to connect the USB hub?

What kind of files are going to be written on the hard disk (and I presume that is being done by the PC) and the OS being used.

You need to write a TSR on the PC that will send the file size information periodically to the arduino.

You need to write a program that will inflate or deflate the balloon depending on the file size on the hard disk.

I admit that I am not an expert on the USB hardware or software.
 

Here is a video of a working prototype!
Thanks everyone for your help.

 
  • Like
Reactions: FvM

    FvM

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top