AVR Minecraft server lets you toggle pins from the virtual world

Wanting to test his skills by building a webserver [Cnlohr] decided to also code a Minecraft server which allows him to toggle pins from inside the game. The rows of switches seen above give him direct access to the direction register and I/O pins of one port of the ATmega328.

The server hardware is shown in the image above. It’s hard to tell just from that image, but it’s actually a glass substrate which is [Cnlohr's] specialty. He uses an ENC424J600 to handle the networking side of things. This chip costs almost twice as much as the microcontroller next to it. But even in single quantities the BOM came in at under $20 for the entire build.

In the video after the break [Cnlohr] and a friend demonstrate the ability for multiple users to log into the Minecraft world. The simulation is fairly bare-bones, but the ability to affect hardware from the game world is more exciting than just pushing 1s and 0s through some twisted pairs.

[via Reddit]

Comments

  1. anon.coward says:

    Sweeeeet! ;)

    Great stuff, really fun to watch…

  2. Brady says:

    Horray for linux!

  3. jrsmile says:

    Hi there, very interresting project, i wanted to do the same with bukkit and the computercraft mod. the mod has a http interface which could send a get request every time you send a redstone signal for example. Ideal for triggering gpios of the raspberry, but the server was to slow on a stock 700mHz raspi. How fast would a 8 bit embedded solution be latency wise?

    Regards, Jan

    • six677 says:

      It would be even slower

      • Dissy says:

        This is the case. I’ve already built a computercraft interface to the host PC (both input and output) and there is a 0.2 second limit on polling.
        For levers it isn’t too noticeable, but for pressure plates and buttons it can be.

    • legionlabs says:

      I’ve done this too, but add the option of using COSM for ‘cloud storage’. Sending/receiving data to/from COSM is slow (just under 10 seconds). I’m in Vietnam though, so your latency might vary. I added control over a local serial port, which can be read and written faster… but as Dissy pointed out polling is still a limitation.

      Still, it’s quite ok for a bit of datalogging, sharing state between physical/virtual devices, and other fun stuff. I already have a voltmeter that can be accessed from within minecraft. Next maybe a big red button?

      Anyway, bother me if you want the code (Python). It works, but isn’t very user friendly yet.

    • roboman2444 says:

      It would also not have enough ram… not even close to enough.
      Unless he managed to have only a single tiny room, with a “procedural” floor and etc.

  4. Hephaix says:

    I watched again the process to make glass PCB Clnohr’s explained here: http://www.youtube.com/watch?v=Rf5HBLzDGQA
    Is it possible to print directly on the flexible copper sheet with the laser printer before gluing it too the glass?
    The transfer step could be jumped this way.

    • Charles says:

      I have tried doing this several times, most of the time with low success as the fuser can’t properly fuse the toner to the copper on my printer. BUT you can directly attach the toner transfer page to the copper, then attach the card-and-copper to the glass. This seems to work very well.

      • legionlabs says:

        I was able to print directly to copper foil using a wax printer, so long as the copper was lightly adhered to some paper first. Toner didn’t work for me either, the copper was too big a heat sink for the toner to fuse.

        Wax was ok for 10 mil traces usually… but in the end toner transfer proved more reliable and allowed smaller traces. Also wax didn’t like heated etch baths much :/

        Have you thought of adhering the copper+toner to polyimide film? This way you could manufacture your own flexible-PCB, heat resistant enough for soldering (as long as you chose an appropriate adhesive). Good for those times you need to replace an FFC (flat flexible cable), or when weight is a concern.

  5. mike says:

    From OP on reddit, https://github.com/cnlohr/avrcraft is the repo.

    If you’d rather have a full minecraft implementation you could use the JSONAPI plugin for bukkit instead. http://alecgorge.com/minecraft/jsonapi/ It’s easy to extend with your own plugin, so adding something for detecting lever changes is possible.

    • Charles says:

      What fun would that be? I’d have to run a full computer to do that… this uses 0.5 watts and is tiny.

      • mike says:

        That’s a silly question with an obvious answer. A fully functional server, and an interfaced avr. You’re already running a minecraft client, running a server on the same computer is trivial.
        To be clear, yes, the project is neat. It would be fun to replicate. Interfacing an avr with bukkit and jsonapi would greatly expand the possibilities.

      • mike says:

        Reading the other comments, I realize that you’re Cnlohr. Sorry if the previous comment came off rude.

  6. bromide says:

    At first i really thought that mc does java, but then…So the thing runs tcp and in the loop has all that is required to answer client’s packets and maintain level data?
    Awesome (=

  7. qwerty says:

    I can’t but think to the next step: a virtual world linked to an electronic simulator (think Spice, NI Multisim, etc) where the user travels through electronic components in a circuit as an electron would do, exploring from the inside the inner workings of each part.

  8. XOIIO says:

    Holy fuck, do you realise how awesome this is? We are getting close to having virtual rooms where we can control any countless number of real world things now! Imagine this sort of system connected to second like for something. Still though, minecraft is awesome too, this is great.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,417 other followers