8×8 LED matrix on an Arduino

I picked a SZ410788K 8×8 LED matrix out of my junk bin today and decided to play around with it. It cost me about 1USD in Aitendo, Akihabara. A little googling brought up the following:

8x8pinout

I decided to hook it up to an Arduino (yea I know, I know).

(more to follow)

Here’s some quick code that scans the matrix:


void setup() {
  // set the digital pin as output:
  pinMode(2, OUTPUT);     
  pinMode(3, OUTPUT);       
  pinMode(3, OUTPUT);       
  pinMode(4, OUTPUT);       
  pinMode(5, OUTPUT);       
  pinMode(6, OUTPUT);       
  pinMode(7, OUTPUT);       
  pinMode(8, OUTPUT);       
  pinMode(9, OUTPUT);       
  pinMode(10, OUTPUT);       
  pinMode(11, OUTPUT);       
  pinMode(12, OUTPUT);       
  pinMode(13, OUTPUT); 
  
  pinMode(A5, OUTPUT);       
  pinMode(A4, OUTPUT);       
  pinMode(A3, OUTPUT);       
  pinMode(A2, OUTPUT);       
  
}

void flash(int x,int y) {
  
   int state1=HIGH;
   int state2=LOW;
   
   for(int n=0;n<2;n++) {
  
   if(n==0) {
     state1=HIGH;
     state2=LOW;
   } else {
     state1=LOW;
     state2=LOW;
   }
   if(x==0) digitalWrite(8, state1); else digitalWrite(8, state2);
   if(x==1) digitalWrite(9, state1); else digitalWrite(9, state2);
   if(x==2) digitalWrite(10, state1); else digitalWrite(10, state2);
   if(x==3) digitalWrite(11, state1); else digitalWrite(11, state2);
   if(x==4) digitalWrite(A5, state1); else digitalWrite(A5, state2);
   if(x==5) digitalWrite(A4, state1); else digitalWrite(A4, state2);
   if(x==6) digitalWrite(A3, state1); else digitalWrite(A3, state2);
   if(x==7) digitalWrite(A2, state1); else digitalWrite(A2, state2);
  
   if(y==0) digitalWrite(12, state1); else digitalWrite(12, state2);
   if(y==1) digitalWrite(13, state1); else digitalWrite(13, state2);
   if(y==2) digitalWrite(2, state1);  else digitalWrite(2, state2);
   if(y==3) digitalWrite(3, state1);  else digitalWrite(3, state2);
   if(y==4) digitalWrite(4, state1);  else digitalWrite(4, state2);
   if(y==5) digitalWrite(5, state1);  else digitalWrite(5, state2);
   if(y==6) digitalWrite(6, state1);  else digitalWrite(6, state2);
   if(y==7) digitalWrite(7, state1);  else digitalWrite(7, state2);
   
   if(n==0) delay(50);
   }
}


void loop()
{

  for(int x=0;x<8;x++) {
    for(int y=0;y<8;y++) {
      flash(x,y);
    }
  }

}

The pins are connected as follows:

Arduino   Matrix
2         K6
3         K5
4         K4
5         K3
6         K2
7         K1
8         K8
9         K7
10        A8 
11        A7
12        A6
13        A5
A5        A4
A4        A3
A3        A2
A2        A1

A 2N3904 is used to switch the grounds in on the A pins. So the circuit looks like this:

8x8diag

LM1117 notes

I pulled some LM1117 voltage regulators from a bunch of routers. I want to use them in another project so I knocked together a quick circuit to test them. Here is the basic LM1117 schematic:

lm1117

And here it is built up, using mostly random parts from my junk bin. R1 is 200Ohm, R2 is a 1K pot in series with a 200Ohm. The cap is 100uF. I should probably also have a cap on the input, but I’m running this from a bench supply and it seems fine.

lm1117made

The LM1117 is used in a number of applications are a jelly bean variable regular, I’ve seen it typically used as a 1.2 or 3.3v regulator. There’s an interesting application note on this application here.

You can find the datasheet, and some design notes for this part at the end of the post here were it’s used in a RT3050 PCB I was reverse engineering as a 3.3v regulator.

Simple gnuplot histogram example

The gnuplot histogram style wont automagically bin your data. To do this you need to either use an external program, or add some additional code, here a simple example:

set terminal png
set output "hist.png"
set boxwidth 1
set style fill solid
set style histogram 
set style data histogram
bw=1
bin(x,width)=width*floor(x/width) + bw/2.0
plot "test.dat" using (bin($1,bw)):(1.0) smooth freq with boxes

Using this data file:

1
2
3
4
5
5
5
5
5
5
5
5
5
5
5
7
8
9
10

You should see this output:

hist

HP 34401A Repair

34401A

This post documents the repair of a HP 34401A Multimeter, I’ll be updating this post as I work on it.

The meter powered up and appeared to be fine for DC voltage/current and resistance measurements. However AC and frequency measurements were showing 0 and the self test failed. Still pretty happy with it for 50USD.

First obvious problem was the following blown cap, sorry I didn’t take a pic before removing it:

deadcap

But wow it left it’s mark:

deadcomponents

You can also see a blown 3.3V regulator next to it. The LM317 which drives this appeared to be outputting 30V rather than 18 as it should. I’ve ordered replacements and will update when I’ve refitted the components.

The replaced regulator, not a great job I’m afraid, it was hard to get to:

lm317

4V p-p input, 1KHz, square:

func1

func2

The voltage is a bit off, but I’d probably blame my function generator (300USD Siglent).

And some resistance measurements for fun, first a 0.01% 100Ohm resistor:
multi2

And then a 10K:
multi

I measured the cables as 0.05Ohm, so this looks pretty good!