Results 1 to 8 of 8

Thread: Arduino as USB network card

  1. #1
    Water Cooled Diamon's Avatar
    Join Date
    May 2010
    Location
    Sweden
    Posts
    516

    Default Arduino as USB network card

    Hey
    I've got a project I'm just starting to work on. I want to send arbitrary data between computers over visible light (visible light communication). I'm leaning towards connecting a computer to an arduino and using that as a network card that will handle converting data to/from light, similar to a USB WiFi card. But I'm not sure how to do this. Is it possible to use the arduino as a usb network card? Or would it be easier to get an ethernet shield and forward traffic from that? Or would you suggest something completely different?

    It'd be amazing if someone could help with this :-)

    //Diamon
    Projects: RGB Tower - Custom CPU water block

    Watching someone else use your computer is like watching a drunk orangutan solve a rubix cube. They have no idea what they're doing and you just wish they'd hand you the damn thing so you can do it yourself.
    -TheOatmeal

  2. #2
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Arduino as USB network card

    Sounds like an interesting project. Depending on your goals, I'll tentatively say that an arduino would probably work, but another platform might be a better choice.

    First, a couple questions:
    1) How are you planning on handling the optical communication on the level of the interface device (the arduino)?
    What I mean by this is, what is your layer 1 (physical) interface? LEDs flashing over fiber? Empty space? Lasers?

    2) How are you expecting to interact with the interface device on the level of the computer?
    That is, how are planning on presenting this data transfer interface to the host computer? Depending on what you are wanting, this may involve writing a custom driver for the device if it is connecting directly to the host.

    This is the main point that will drive the design of this device. If you want to connect the arduino directly to a host computer, your basic communication with the device will be through a serial channel. If you want every program to interact with that serial channel directly, then no more work to be done (well, you'll probably want to make a library to abstract that away, but that comes later).

    Personally, the way I would probably approach this would be to treat the device as a network-accessible micro-service. That is, rather than connecting the device directly to a host computer and interacting with it over a serial channel, I would connect the device directly to a network and build services that would let me interact with it as a network device. For example, JSON HTTP APIs, integration with a RabbitMQ server, etc. Or, depending on how far you want to take it, it would be really cool to build in router functionality, so you could just connect these two devices between two networks and treat them as a layer 3 link between the two networks.

    If you were to take the route (no pun intended) of the network-attached device, I would recommend looking into the variety of Linux-based SBCs available. These will give you a lot more horsepower to play with, as well as a much more powerful and flexible base to build more advanced platforms on. In addition to these benefits, depending on the platform you choose, it might actually be cheaper than an arduino with ethernet. Some that I would recommend looking into:
    Olimex A20 (refresh small form-factor, refresh small form-factor with embedded ROM, small form-factor, small form-factor with embedded ROM, larger form-factor, larger form-factor with embedded ROM)
    LinkSprite pcDuino3 Nano
    ODROID-C1

    Key points of interest:
    SBCSoCCPURAMNICStorageGPIO pins
    Olimex MICRO/LIMEAllwinner A20Dual-Core 1GHz ARM A7512MB100Mbps4GB embedded (on applicable models), 1x microSD, 1x SATA160
    Olimex LIME21GB1Gbps
    pcDuino3 Nano4GB embedded, 1x microSD, 1x SATA14
    ODROID-C1Amlogic ???Quad-Core 1.5GHz ARM A51x eMMC (ODROID proprietary connector), 1x microSD40
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  3. #3
    Anodized. Again. Konrad's Avatar
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    1,060

    Default Re: Arduino as USB network card

    The Arduino Ethernet Shield module probably offers better performance and reliability than anything you can fashion from scratch. Maxwell and FTDI offer all sorts of USB-RS232 converter chips which might allow your two Arduino devices to plug into PC USB at each end and interact via serial link.

    As x88x asked above, what is your physical layer? This determines what sort of optoelectronics (transmitters, receivers, isolators) you need to work into the design. Incidentally, visual spectrum LEDs/lasers may (or may not) be as efficient for your application as IR or UV spectra. Note that optoelectronic connectors typically introduce some signalling latency, and if you're planning to transmit lossless data over any real distance then you'll likely need to allocate some bandwidth to hardware error correction. You might want to look into IrDA SIR standards and early 802.11 (IR) standards.

    I doubt you can achieve transmission comparable to even 10Base-T with an Arduino part. You can select from a fair variety of ARM parts - as x88x suggested - or perhaps a dedicated FPGA Atmel/Cisco/etc part which would serve this function far more efficiently.
    My mind says Technic, but my body says Duplo.

  4. #4
    Water Cooled Diamon's Avatar
    Join Date
    May 2010
    Location
    Sweden
    Posts
    516

    Default Re: Arduino as USB network card

    Thanks for the replies

    So, to answer the questions:
    1: I'm planning to handle the optical communication with a flashing LED. The LED could also be used to receive, or a separate photo resistor could be used for that.

    2: The best choice for me would be to connect the device directly to the computer as an USB network card, preferably by making it compatible with some open source USB network driver. Connecting the device via ethernet would also work for me. In that case the device would convert the traffic coming from the ethernet wire to an opical transmission. It would also interpret incoming optical transmissions, convert them and send them back through the ethernet wire. As Konrad said this could easily be converted to USB with a USB network card.

    Thanks for the suggestions on one-board computers. That's definitely another way I could go.
    I'm not expecting a high bandwidth. It's a proof of concept that I could improve in the future. What I have in mind is something similar to the OpenVLC project
    Projects: RGB Tower - Custom CPU water block

    Watching someone else use your computer is like watching a drunk orangutan solve a rubix cube. They have no idea what they're doing and you just wish they'd hand you the damn thing so you can do it yourself.
    -TheOatmeal

  5. #5
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Arduino as USB network card

    What is your intended use for this? That is, how do you intend to interact with the optical device? Are you envisioning it being a transparent network bridge talking TCP/IP? Or do you envision an application talking directly to this device, using a custom protocol (or some other pre-existing protocol) to talk to another system on the other end of the link? Either way, this sounds like may end up becoming a much more difficult project than you may be prepared for. Not saying that to discourage you from doing it, just to give you a realistic idea of what you'll be getting yourself into.

    Quote Originally Posted by Diamon View Post
    In that case the device would convert the traffic coming from the ethernet wire to an opical transmission. It would also interpret incoming optical transmissions, convert them and send them back through the ethernet wire. As Konrad said this could easily be converted to USB with a USB network card.
    That's not what Konrad was talking about. He was referencing a USB-to-RS232 serial device. These were needed in order to connect most arduinos to PCs (if the PC did not already have a RS232 port) in the early days of the platform, but most of the current [arduino] boards have USB communications built in, usually in the form of a USB-RS232 adapter either built into the chip or included on the board.
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  6. #6
    Water Cooled Diamon's Avatar
    Join Date
    May 2010
    Location
    Sweden
    Posts
    516

    Default Re: Arduino as USB network card

    I'm envisioning a transparent network bridge that any program can interface with. Just like a regular NIC for Wifi or ethernet.

    I'm prepared that this might be a large project. It's a project I'm doing with 5 others at university. However preferable we'd be using some existing open source code to interface with the Internet layer. For example an open source usb network driver.

    Sorry, misread that.

    I've heard that the Arduino can emulate an arbitrary usb device. This would make it possible to connect the arduino to a PC as a regular usb network card. However, I'm leaning towards using a one-board computer, for example one of the ones you linked, and connecting to it via ethernet. The one-board computer could then have a LED attached and a driver for controlling it. If the eth0 interface and the vlc interface were bridged this would allow any computer connected to the ethernet to communicate with light. Our work would then be to write the VLC driver. Do you think this would work?

    I'm leaning to
    Projects: RGB Tower - Custom CPU water block

    Watching someone else use your computer is like watching a drunk orangutan solve a rubix cube. They have no idea what they're doing and you just wish they'd hand you the damn thing so you can do it yourself.
    -TheOatmeal

  7. #7
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Arduino as USB network card

    Quote Originally Posted by Diamon View Post
    I've heard that the Arduino can emulate an arbitrary usb device.
    They can interact as serial devices, and some can interact as USB HID devices (think keyboard/mouse/joystick/etc). Turning that into something addressable as a network device would be the challenge.

    Quote Originally Posted by Diamon View Post
    If the eth0 interface and the vlc interface were bridged this would allow any computer connected to the ethernet to communicate with light. Our work would then be to write the VLC driver.
    That's more what I meant when I said "transparent network device".

    Now, bear in mind I'm vastly over-simplifying this, but if you can build a library around the optical interface and get it to talk the right serial protocols (which are much simpler), you may be able to use netcat to translate between serial and TCP/IP[1]. Now, whether that could be made to be usable as a TCP-over-Serial as opposed to the Serial-over-TCP that most examples I'm seeing do, I don't know.

    [1] http://stackoverflow.com/questions/4...ux-environment
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  8. #8
    Water Cooled Diamon's Avatar
    Join Date
    May 2010
    Location
    Sweden
    Posts
    516

    Default Re: Arduino as USB network card

    Thanks for the help x88x and Konrad! You've given me a lot to read up on
    Projects: RGB Tower - Custom CPU water block

    Watching someone else use your computer is like watching a drunk orangutan solve a rubix cube. They have no idea what they're doing and you just wish they'd hand you the damn thing so you can do it yourself.
    -TheOatmeal

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •