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]

20 thoughts on “AVR Minecraft server lets you toggle pins from the virtual world

  1. 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

      1. 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.

    1. 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.

    1. 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.

      1. 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.

      1. 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.

  2. 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 (=

  3. 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.

  4. 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.