Difference between revisions of "Lego Interactive Interface-A Driven via Arduino"

From LVL1
Jump to navigation Jump to search
Line 76: Line 76:
  
 
==== Code becomes a Library ====
 
==== Code becomes a Library ====
 +
 +
Code for the arduino would need to turn pins on and off as well as read the analog pins for input.  A few define statements and analogWrite statements would be easy.
 +
 +
#define PORT0_PIN 3
 +
#define PORT1_PIN 5
 +
#define PORT2_PIN 6
 +
#define PORT3_PIN 9
 +
#define PORT4_PIN 10
 +
#define PORT5_PIN 11
 +
#define PORT6_ANALOGPIN 0
 +
#define PORT7_ANALOGPIN 1

Revision as of 21:26, 17 January 2016

Backstory

A number of years ago, a visitor to the LVL1 Hackerspace brought in a box of old Lego items that their father had in storage. The hope was that they would be an interesting project to build something and then use it to demonstrate engineering to children at a science center. The central element was an Interface-A (70455) control unit. The Lego collection also included the Apple II interface card. A working Apple II was not available, so someone suggested driving the "brick" with an arduino.

LBAP brick.jpg

First Step

Opening the "brick"

The first step was to open up the brick. This was done relatively easy by cutting a number of tabs along a seam.

LBAP brick guts.jpg

Now, cutting the brick open was not really necessary since a number of web sites already document this piece of technology. The pin-outs and voltage specs can be found through a series of simple Google searches. Below is a site used for reference.

LEGO - LEGO's first programmable product

From this link one can navigate to a number of others sites with information about this product. Among them is this page with pin-outs.

LEGO® TECHNIC 1093

The information was available and all that was required was a shield and some programming time to get an arduino to drive the brick.

Two Years Later - Some Follow Up

The project simply was forgotten until August 2015. The Director of Legal Evil for LVL1 discovered a LVL1 photo with the brick and decided to close the loop. Based upon the pin-outs and research, he fashioned an arduino UNO shield from a basic prototyping shield.

LBAP Uno Shield.jpg

The shield simply wired arduino pins directly to the pins from the brick (via ribbon cable).

Wiring
Arduino Brick Port Id
3 6 0
5 8 1
6 10 2
9 12 3
10 14 4
11 16 5
A0 18 6
A1 20 7

The Brick Output Ports (0-5) were wired to PWM pins. The brick supports PWM signals as a way of regulating voltage to its ports.

The Brick Input ports were wired to analog pins although testing to see if variable voltages would be sent from brick was not tested.

With the shield, an arduino could drive the brick. Now it was only a matter of writing arduino code.

Code becomes a Library

Code for the arduino would need to turn pins on and off as well as read the analog pins for input. A few define statements and analogWrite statements would be easy.

#define PORT0_PIN 3
#define PORT1_PIN 5
#define PORT2_PIN 6
#define PORT3_PIN 9
#define PORT4_PIN 10
#define PORT5_PIN 11
#define PORT6_ANALOGPIN 0
#define PORT7_ANALOGPIN 1