To Moscow…Idaho

18 May 2014
anemone

Anemone flowers at north end of trail.

I took this trip on the third of May (2014).
I went for the express purpose of checking out the Goodwill store and the Palouse Mall.
The day threatened rain and was a little colder than I would have liked, but it didn’t rain much.
I started at the north end of the trail, which is near where I live.

rabbits

Rabbits living in protected wetlands.

The Pullman-Moscow bike-jogging-walking trail follows the streams that drain the area. The land immediately adjacent to these streams has been designated as protected wetlands. There is a little watershed conservation district here that is quite active – probably due to the biologists at the two universities.

steam locomotive

Little steam engine on display downtown Pullman.

An attempt was evidently made to preserve some of Pullman’s historic artifacts from the railroad days. However, this little locomotive and the cars behind it are in disrepair and seem to be used by a real estate company.

With the help of a west wind, I arrive at the outskirts of Moscow about 1-1/2 hours after leaving. This is where several stores and the Mall have been built. It is right next to the Washington-Idaho border.

goodwill sign

Goodwill parking lot.

palouse mall

View of the Mall.

The Mall is just east of a big Walmart, which is just east of the older Staples-Goodwill-hotel-restaurant complex. It is a real suburban-style mall with clean, bright indoor-facing stores covered by a roof. In this area, this arrangement makes a lot more sense than the parking-lot-facing “strip” mall that was so popular everywhere in the ’60s.

bicycle

My vehicle.

I ate lunch at the Qdoba and found the usual assortment of corporate sales outlets at the mall. There is also a Chinese “buffet” restaurant. All-you-can-eat lunch for 8 or 9 dollars. I also shopped at the Big 5 Sporting Goods store which has a “satellite” building at the mall. I needed something to cover my Goodwill purchases in case it rained.

The local model plane flying club also had a neat display set up inside the mall. I didn’t try to take any photos inside, though.

the trail back

The trail back.

Time to head back to Pullman. The going was a bit rough, as even though the grade is slightly downhill, I had a headwind. I walked the bike much of the way.

duck

Duck in little pond near halfway mark.

Near the halfway mark is a little tunnel under a crossing road. On the east side was a bench that was out of the wind, so I rested there a while. There was a duck in a nearby pond, but it wandered off when I tried to get closer to take more photos.

jorstad's fence

The Jorstad’s fence.

One of the features of the Chipman (Pullman-Moscow) Trail is the Jorstad’s house. I don’t know anything about the family, but these photos tell you something about them by themselves.

the jorstad's

The Jorstad’s

Panel Project – First Successes

30 April 2014
panel project illustration

My panel connected to a computer.

This is my first article about a project I have been working on for some little time now. I’m presenting it now because I finally got some important features of this project working.

Depicted above is my hardware for this particular project. The “control panel” was once part of a now-replaced flight training computer program. It supposedly represents some of the controls on a Cessna airplane. It was meant to be attached to an old-fashioned game controller to give it a “flight yoke.” I added the basic parts of such a game controller to the top of this panel, but am not using it yet, and probably won’t.

A Problem and a Solution

This panel is operated by a microcontroller that talks to the flight simulation computer program over an “old fashioned” serial communication line. These days microcontrollers are equipped with “flash” memory to hold their programs. This type of memory is permanent, but its contents can be changed. The older microcontrollers were programmed once and that was it. So there was no way for me to adapt this panel for my own use.

I had to rewire it with a new controller somehow. I found a way to do it (which I won’t get into here) using a Digilent product much like the Arduino Uno that I thought would have enough pins to connect to all these buttons. This product was purposely made to be programmed in a very similar way to the Arduino. As gone over earlier, this means this product uses a programming system that is a standard used for many different purposes today.

So, after installing the new microcontroller in the panel, I worked out – over a period of many weeks a few hours at a time – a program that would send out data about the panel. The code for this is gone over below.

Discovering a workable host program

I needed a program running on a computer to stand in for the flight simulation program that went with the original control panel. The original program was made for Windows. Those programs are a bit difficult to write! But there are several ways these days to achieve a similar effect. And one pretty good open source program-writing resource is Processing, which I covered briefly in a previous post.

I discovered that Processing had a little code “library” (a collection of usually short programs that adds a certain feature) for “old fashioned” serial communications. Many modern microcontrollers communicate to the computer that is used to program them through a USB cable that is set up to mimic an “old fashioned” serial communication line.

So all I had to do with the panel was program it to send “old fashioned” serial messages through its USB cable (which also powers it) to the host program written using Processing.

Below is a screenshot of a generic panel program I wrote using Processing to receive and display data from a panel of up to 64 (8X8) separate controls. Most of these controls would ordinarily be switches, and that is the only functionality I have implemented so far.

This panel has two other types of controls besides switches: Rotary switches called “encoders” and sliding controls that can be assigned numerous values depending on position. These are a little bit trickier than switches to code for, so I’ve left them for later.

This application shows a grid of colored rectangles with some text in them. They switch colors depending on data received from the physical panel. This screenshot shows that some of the positions on the panel are open or inactive (grey). A “1″ from the panel results in a yellow box and a “0″ results in a red box (I was going for something more orange, but I liked this color better). So this application just gives us a start at writing a host program that can take data from a control panel and act on it, do something with it.

panel display

Screenshot of the Processing application that displays the state of the panel.

The Code

With some trepidation, I present below the code more or less as I have written it so far. The data behind the slashes are “comments.” This is information that helps the program writer explain to himself or others what he or she is trying to do with a line or section of code.

The following code was written on the Multi-Platform IDE for uploading into the microcontroller that is wired into this panel.

/*
DigitalReadToSerialMonitor2
Reads digital inputs connected to the controller pins and sends
out the result on a serial communication line.
Modified extensively for the FS-100 application.
This example code is in the public domain.
This version implements simple handshaking scheme
to make sure the host is ready for the next message.
*/
// Set up global (can be seen by all other code) arrays of values:
int prevValues[8][8]; 
// 8 by 8 array holds previous state of the panel to compare to.
int valueArray[8][8]; 
// 8 by 8 array holds most current state of the panel.

void setup()
{
/* These setup steps are needed to tell the microcontroller
what its pins are connected to. I don't use all these pins 
in this particular program. */
pinMode(0, INPUT);
pinMode(1, INPUT);
pinMode(2, INPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, INPUT);
pinMode(9, INPUT);
pinMode(10, INPUT);
pinMode(11, INPUT);
pinMode(12, INPUT);
pinMode(13, INPUT);
pinMode(14, INPUT);
pinMode(15, INPUT);
// Below are the data lines that will be read by this code.
pinMode(34, INPUT);
pinMode(35, INPUT);
pinMode(36, INPUT);
pinMode(37, INPUT);
pinMode(38, INPUT);
pinMode(39, INPUT);
pinMode(40, INPUT);
pinMode(41, INPUT);

/*
The 3 volt outputs of the controller are connected to
inverting transistors ("buffer") that output 5 volt signals.
Reset needs a high pulse, so I give the buffer a low pulse.
This reset pulse is for the rotary encoders, not yet implemented.
*/
digitalWrite(7,HIGH);
delay(5); // delay() introduces a time lag in milliseconds.
digitalWrite(7,LOW); //reset the encoders just once
delay(5); // delay() helps make sure your timing works out.
digitalWrite(7,HIGH);

for (int i=0; i<8; i++) // this line implements a "loop"
{
  for (int j=0; j<8; j++)
    {
      prevValues[i][j] = 0; // This fills one array with zeros.
    }
 }
Serial.begin(9600); // This activates the serial comm line.
}

/* The Processing IDE uses a program element called draw()
to contain code that will be repeated over and over again. 
This IDE calls this loop() as it does not draw to the screen. 
Void refers to a method (function) that does things, 
but does not return any value. */

void loop()
{
/*
During each iteration of this loop, the panel is scanned
by issuing an address, then enabling the controls that are
at that address (up to 8) and reading their values.
Right now, all we are reading is digital (on or off)
controls. These data go into the valueArray.
Addresses are inverted due to inverting buffer...
Start with address 0 which is 111 inverted.
Output enable (on pin 6) is active-low. 
That means issuing a LOW turns it off (makes it HIGH).
*/
digitalWrite(6,LOW); // Ensure outputs are disabled.
delay(5);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);

digitalWrite(6,HIGH); // Now enable the control outputs.
delay(5);
// Below illustrates how an array is addressed in code.
valueArray[0][0] = digitalRead(34);
valueArray[0][1] = digitalRead(35);
valueArray[0][2] = digitalRead(36);
valueArray[0][3] = digitalRead(37);
valueArray[0][4] = digitalRead(38);
valueArray[0][5] = digitalRead(39);
valueArray[0][6] = digitalRead(40);
valueArray[0][7] = digitalRead(41);
digitalWrite(6,LOW);

// Repeat for address 2:
digitalWrite(6,LOW);
delay(5);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);

digitalWrite(6,HIGH);
delay(5);
valueArray[2][0] = digitalRead(34);
valueArray[2][1] = digitalRead(35);
valueArray[2][2] = digitalRead(36);
valueArray[2][3] = digitalRead(37);
valueArray[2][4] = digitalRead(38);
valueArray[2][5] = digitalRead(39);
valueArray[2][6] = digitalRead(40);
valueArray[2][7] = digitalRead(41);
digitalWrite(6,LOW);

// Repeat for address 4:
digitalWrite(6,LOW);
delay(5);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);

digitalWrite(6,HIGH);
delay(5);
valueArray[4][0] = digitalRead(34);
valueArray[4][1] = digitalRead(35);
valueArray[4][2] = digitalRead(36);
valueArray[4][3] = digitalRead(37);
valueArray[4][4] = digitalRead(38);
valueArray[4][5] = digitalRead(39);
valueArray[4][6] = digitalRead(40);
valueArray[4][7] = digitalRead(41);
digitalWrite(6,LOW);

// Repeat for address 5:
digitalWrite(6,LOW);
delay(5);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);

digitalWrite(6,HIGH);
delay(5);
valueArray[5][0] = digitalRead(34);
valueArray[5][1] = digitalRead(35);
valueArray[5][2] = digitalRead(36);
valueArray[5][3] = digitalRead(37);
valueArray[5][4] = digitalRead(38);
valueArray[5][5] = digitalRead(39);
valueArray[5][6] = digitalRead(40);
valueArray[5][7] = digitalRead(41);
digitalWrite(6,LOW);

// Repeat for address 6:
digitalWrite(6,LOW);
delay(5);
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,LOW);

digitalWrite(6,HIGH);
delay(5);
valueArray[6][0] = digitalRead(34);
valueArray[6][1] = digitalRead(35);
valueArray[6][2] = digitalRead(36);
valueArray[6][3] = digitalRead(37);
valueArray[6][4] = digitalRead(38);
valueArray[6][5] = digitalRead(39);
valueArray[6][6] = digitalRead(40);
valueArray[6][7] = digitalRead(41);
digitalWrite(6,LOW);

/*
Next step is to loop through and compare old values to new values, etc.
*/
for (int i=0; i<8; i++)
 {
   for (int j=0; j<8; j++) 
    { 
      if (prevValues[i][j] != valueArray[i][j]) 
        { 
          String outStr = String(i)+String(j)+String(valueArray[i][j]); 
// Here is where we implement the semi-handshake. 
            if ( Serial.available() > 0)
              {
                Serial.println(outStr);
              }
            else
              {
                delay(100); 
// If we don't get an answer in 100 milliseconds, send the data anyway.
                Serial.println(outStr);
              }
        }
    }
 }
/*
Now transfer new values to old values using loops.
*/
for (int i=0; i<8; i++)
 {
   for (int j=0; j<8; j++)
    { 
      prevValues[i][j] = valueArray[i][j];
    }
 }
  delay(5);
}

And here is code written in the Processing IDE to receive this data:


/**
 * SerialReadControlPanel
 * Larry Cox 2014. Developed from "Simple Read" and other code examples.
 * Read data from the serial port and change the color of a rectangle
 * This code was tested 29 April 2014 and worked with loopback cable.
 * (Loopback = pins 2 and 3 connected.)
 */

import processing.serial.*; // This is the serial communication features.

Serial myPort;   // Create object from Serial class
int ports;       // Number of ports in list of serial ports.
String inputStr; // Data received from the serial comm line
String titleStr; // via out serial port.
int cols = 8;    // For the display grid.
int rows = 8;    // For the display grid.
Cell[][] Panel;  // Cell is a special object that displays as a grid.
String[][] labelArray = 
  {
  {"1"," 9","17","25","33","41","49","57"},
  {"2","10","18","26","34","42","50","58"},
  {"3","11","19","27","35","43","51","59"},
  {"4","12","20","28","36","44","52","60"},
  {"5","13","21","29","37","45","53","61"},
  {"6","14","22","30","38","46","54","62"},
  {"7","15","23","31","39","47","55","63"},
  {"8","16","24","32","40","48","56","64"} 
  };
int[][] valueArray = 
  {
  {1, 9,17,25,33,41,49,57},
  {2,10,18,26,34,42,50,58},
  {3,11,19,27,35,43,51,59},
  {4,12,20,28,36,44,52,60},
  {5,13,21,29,37,45,53,61},
  {6,14,22,30,38,46,54,62},
  {7,15,23,31,39,47,55,63},
  {8,16,24,32,40,48,56,64},
  };
  int rate = 0;
  int evenToggle = 0;
  
void setup() 
{
  size(800, 500); //Initial window size.
  
  ports = Serial.list().length; // Find out if any ports are active.
  if (ports > 0) // If one is, assume it's the first one (index = 0).
  {
  String portName = Serial.list()[0];
  // I create an informational title string.
  titleStr = "# of ports = " + str(ports) + " :" + portName;
  myPort = new Serial(this, portName, 9600);
  myPort.bufferUntil('\n'); // '\n' means a linefeed in the C language.
  myPort.write("000"); 
  myPort.write('\n');
/* The above lines will initiate the first serial event if 
the serial line is connected as a loopback. */
  }
  else
  {titleStr = "No serial ports currently active.";}
  Panel = new Cell[cols][rows]; // This is called a "constructor."
}

void draw()
{
  background(255);             // Set background to white.
  fill(rate);                  // Fill color for update ticker.
  ellipse(750,25,40,40);       // Draw update ticker.
  fill(0);                     // Set fill to black.
  text(titleStr,2,2,700,20);   // Draw the title.
  
                                // Create the panel.  
  for (int i = 0; i < cols; i++) // For each column in Panel...
  {
    for (int j = 0; j < rows; j++) // create a row of cells. 
    {
      // This line initializes each object in turn.
      Panel[i][j] = new Cell(i*100,(j*50)+50,100,50,labelArray[i][j],str(valueArray[i][j]));
/* Cell Constructor syntax:
Cell(float posX, float posY, float width, float height, float angle) */
      Panel[i][j].display(); // Draws the panel a rectangle at a time.
    }
  }
  // I want an indicator to flash at the speed I'm updating the display.
  int nextRate = 0;
  if (rate == 0) { nextRate = 255; }
  else { nextRate = 0; }
  rate = nextRate;
}

/*
The serialEvent() method runs automatically whenever the buffer reaches 
the byte value set in the bufferUntil() method in setup().
This is the crucial code that responds when data are received.
*/
void serialEvent(Serial myPort) 
{ 
  inputStr = myPort.readStringUntil('\n'); 
  inputStr = trim(inputStr);  // Just in case it contains junk characters.
/* The int() method will convert a numeric string to a value. */
  int i = int(inputStr.substring(0,1)); 
  int j = int(inputStr.substring(1,2)); 
  String k = inputStr.substring(2);
  valueArray[i][j]= int(k); // Updates array contents - crucial!
/* I wanted to toggle the data that gets sent out so in a loopback 
test I could see it changing on the screen. */
  int nexToggle = 0;
  if ( evenToggle == 0 )
  { 
    myPort.write("000"); // Send a string to serve as a test and to ask for more data.
    nexToggle = 1;
  }
  else 
  { 
    myPort.write("001"); // Send a different string...  
    nexToggle = 0;
  }
  myPort.write('\n');
  evenToggle = nexToggle;
} 
// A Cell object is defined below:
class Cell 
{
// A cell object knows about its location in the grid as well as its size.
  float x,y;   // x,y location
  float w,h;   // width and height
  String label; // Cell "content"
  String value; // rest of cell content

  // Cell Constructor
  Cell(float tempX, float tempY, float tempW, float tempH, 
        String tempLabel, String tempValue) 
  {
    x = tempX;
    y = tempY;
    w = tempW;
    h = tempH;
    label = tempLabel;
    value = tempValue;
  } 
  void display() 
  {
    stroke(255); // Draws a black border.
    strokeWeight(2); // One of several border options.
    fill(204); // Fill color for the next object to be drawn.
    rect(x,y,w,h); // Gives us an array of boxes on the screen.
    fill(0); // Fill color for the text.
    text(label,x+2,y+2,w-4,h-29); 
// Above line draws text superimposed over the boxes.
    text(value,x+2,y+27,w-4,h-29);
  }
}

I didn’t capture quite the latest version of my code with the yellow and red logic in it, but this is plenty for now.

Blackout! and other news

15 April 2014

Monday (the 7th of April) was one of the warmest days of the year so far in Pullman. Having neglecting my weekend grocery shopping, I accomplished it that Monday afternoon and returned home at 4:30 or so. By the evening I was busy with one of my electronics projects. At about 6:30 or so the lights flickered, went out entirely, pulsed back on once again, and again died in what seemed a kind of spasm.

It was pitch black in my basement apartment, though not nearly sunset time yet. I fumbled around on my work table until I found my flashlight. I use it to inspect my soldering work. Then I searched around the place for a better source of light. I found a head lamp I had purchased from All Electronics and a shake-light I had acquired I don’t recall where. The head lamp was great for getting around inside. I found my jacket, put on my shoes, and went out to see what was going on.

As I went out “front” (the side facing east onto Grand) a car from the fire station up the street drove by with siren on. Other than that, all seemed normal. A couple were above me, leaning on the balcony railing, speaking quietly about the loss of our electric power. So I went back in.

I put my head lamp back on, sat down at my work table, and tried to continue on the design I had started, hoping the power would soon come back. But, it didn’t. It was basically too dark to do anything. Inside it was completely quiet, as the fridge – the only source of noise – was off. I resolved not to open it until the power came back up, in hopes that my just-purchased food would stay reasonably cold. There was nothing else to do. Without electric power I was totally without the usual devices that I use day-to-day. My only battery-powered devices are flashlights (I plan to change that some day). I don’t have any “mobile devices” (I don’t plan to change that any time soon).

So, I went to bed.

I didn’t rest well, as I kept anticipating the power returning. It finally did at about 12:30. I was needing now to get my rest, so I stayed in bed a while. But all the lights were on. So I finally got up and turned everything off and went back to bed for real.

At work, only a few others had experienced the blackout, as it was fairly localized. I heard stories of what had happened, but didn’t look them up myself until today.

Distraught being

As it turns out, a distraught person – drunk – had been hurtling south on Grand in her 1999 Chevy van, sending several cars to the shoulder or otherwise off the road. One of these cars swerved off the road and rolled down a hill into a power pole. The impact broke the insulators holding up the high-voltage wires, and they fell to the ground. The driver was trapped in his overturned vehicle by these high voltage wires until the utility company was able to de-energize them about an hour later. He was – amazingly – unharmed.

The police caught up with the “crazy” lady a little while later. They had to take her to a hospital to get treated for minor injuries before arresting her.

distraught being One of the news sources published a Sheriff’s Office photo of the lady – from some earlier incident. I edited it down to just the face for this post: This is the face of a very distraught being.

True source of accidents

This lady will most likely be found guilty of some crime and put in jail or into some sort of “care.” This, of course, will not remedy her distraught state in any way shape or form. To turn her back into someone safe to be around (assuming she was at one point) would be to solve the terror she obviously suffers from.

LRH has this to say:

People making mistakes or doing stupid things is evidence that an SP [Suppressive Person - known to some as the "psychopath"]exists in that vicinity.
(From HCO Bulletin of 12 March 1968: Mistakes, Anatomy Of.)

This is the basic datum on which all Scientology ethics and management technology is based. True SPs comprise less than 5% of the general population. However, 25% or more are unduly influenced by them, thus becoming “accident prone,” or worse.

Because our justice system – more than likely under the influence of SPs – does not go looking for the SP “in the vicinity” of the person who “caused” the accident or committed the crime, our situation regarding crime and accidents never seems to improve. We have the wrong why.

Other News

That same weekend I received a portion of an instrument panel from a DC-8 aircraft. This was one of the first jet airliners to be mass-produced during the 1960s. I bought it for the aluminum panel and to see how it was constructed. It arrived a bit the worse for wear, but I took all the parts off it and cleaned it up, and it looks promising. I think I will make a battery charger with it.

DC-8 panel detail

DC-8 panel detail, showing the registration number of the aircraft it is from and its most recent “SELCAL” radio message code.

The deer return

This afternoon walking home, I saw a family of deer grazing in the field below the “industrial park” where I work. It looked like a buck and three doe. Probably the same deer that were here last year. They somehow managed to live down in the wetlands that the bike/jogging trail goes through, just the other side of Grand. That’s where the electric poles are, too; like the one that guy ran into.

I wasn’t sure they would return. Last year they were here earlier. I remember seeing them in the same place when it was still snowy. They lost one of their young to road kill that year. I know: I saw the dead deer myself. It was at the “vacant lot” where I took many of my wildflower pictures. So I thought they might go somewhere else this year. But there probably aren’t too many other places to choose from for these deer. They do have to be watchful, and not only for cars. I’ve seen coyotes in this area, too; though its the rabbits who usually suffer when the coyotes come through.

Voltage indicator

4 April 2014

This post is an experiment for me.
I don’t usually describe how I do my design work.
The objects, generally speaking, are not that photogenic, and electronics is a bit of a dry subject. But some people just aren’t familiar with it, and they should be. This is the age of electronics on earth.

most of my patch bay

My patch bay – right side.

Design opportunity and goal

While some electronics designers work within the framework of marketable consumer or industrial products, I don’t. It’s strictly “for fun” you might say. But any designer requires opportunities to do his or her work. After all, you can always buy OTS (off the shelf) if the item you want has already been designed.

I had made a “patch bay” – a kind of interconnection panel where lots of signal connections come together at the same place – for signals used to control my displays. I had purchased a blank piece of aluminum from a local welding shop, cut a slot down the middle (don’t ask me how) and drilled a bunch of holes in it for switches and connectors, then started loading it up with circuit boards.

But on the far left end I had four holes where nothing really seemed to fit: A design opportunity! I decided I wanted a voltage indicator that used four LEDs that got brighter as the monitored voltage got closer to each one’s center setting. The usual bar graph, of which I had made many using a commonly available part, uses ten LEDs that just go on when the input voltage goes above their set point, and off when it goes below. There is also a “dot mode,” which I like to use because it uses less power, where the LED whose set point is closest to the input voltage is the only one that goes on.

I didn’t want to use ten LEDs in the usual way. I wanted to use only four and have them get brighter and dimmer, the way my light panels are designed to do. I wanted each one a different color, but I only had three colors on hand, so the middle two are green, the top is white and the bottom is red. The red LEDs I have are a good deal less bright than the other colors, so I had to try to compensate for that, too.

patch bay left side

My patch bay, left side.

Dot display IC (integrated circuit)

I decided to use the dot display IC as the central component in this project. The two bottom outputs would go to the red LED. The next three to the lower green. The next three to the upper green, and the top two outputs to the white LED. You can set up the IC for so much current per output. Old LEDs required 20mA (milliamperes) to be bright. But modern LEDs only need 2. I tried limiting the current through the LEDs using series resistors. The brightest LED (white) would get a big series resistor (7K – kilohms) the green ones would get smaller ones (I think I used 1.5K) and the red would get the smallest series resistor, something like 100 ohms. These values were arrived at experimentally, and weren’t perfect, but good enough for this project.

How do you get an LED to get brighter and dimmer? You can simply drive it with more or less current. But almost exactly the same effect can be achieved by turning it on and off rapidly using a technique called “pulse width modulation” (PWM). This works because the body only takes a picture of its environment about 100 times a second. So any light flashing at about that rate or faster will appear constantly on. In technology, this is most commonly experienced when watching video monitors (or films). The picture on them only changes 30 to 70 times a second, but the motion appears continuous.

To do this with my dot display IC, I would have to make the input move back and forth through the set points of each of the dot outputs. I decided to use a “triangle wave” for this, and here it is:

triangle wave

This image is from my USB oscilloscope. There is a grid with the vertical and horizontal scales shown by the knobs. The period of this waveform is about 10mSec (milliseconds) and the amplitude is about 800mV (millivolts) peak-to-peak. So it’s oscillating at about 100 Hz (Hertz, cycles per second) and it’s about a volt high. The entire scale of my meter is 2.5 volts, so this signal should activate about 4 outputs at one time, with the one at the center of the oscillation the brightest.

I coupled this signal to an amplifier through a capacitor, then made the DC (direct current – not oscillating, or changing very slowly) level of the amplifier equal to half the input signal (0 to 5 volts). This created an input signal to the dot display IC of a triangle waveform going up or down depending on the slowly-changing DC level being measured, centered at zero to 2.5 volts, the input range of the dot display IC.

Does it work?

With the input set lower (see knob) the red LED is brighter than the lower green (by a little).

low input display

With the input set higher, the white LED is brighter than the top green.

high input display

The effect is quite noticeable, particularly to the eye (less to a camera). I was pretty happy with the outcome.

Limitations of measuring instruments

The range of voltages I use for my analog projects is zero to five volts, so that’s the only range my indicator needed to have. Since the electronics run on +7V and -5V, they can’t put out much more than 5 volts anyway.

But I noticed a funny thing happening with my USB oscilloscope when I didn’t connect it to my signal through a capacitor (to block the DC component of the signal).

clipped triangle wave

It was “clipping” off the top of the waveform! My cheap little USB oscilloscope only has a display range of plus and minus 5 volts! (at least at the settings I was using). This is a very small DC range for a professional oscilloscope, where more like plus and minus 50 volts is what is expected. This little scope had no DC offset built into the front end (all good scopes do) so if the signal goes beyond certain limits, it just disappears.

Here is a trace of the 12volt square wave that creates the triangle wave. Notice that it stops at a little under 5 volts. This means I will have to build a more compliant front end onto my scope if I want to see the entire waveforms in my 8-12volt projects.

clipped square wave

Comments?

I hope this post gives some small insight into the electronic design process. I kept it conceptual. The hardware details are VERY dry. You just look up the data sheets of the parts you decide to use and figure out how to connect the correct pins together. There are certain real-world considerations to take into account, such as using bypass capacitors on the supply pins so signals don’t get into the circuit in unexpected ways. And you have to know how to solder if you want to make a permanent circuit board. Solder is hot metal and it has stuff inside that smells pretty bad when it burns, so a lot of people don’t like it and I don’t blame them. It’s a great technology for military equipment, but hobbyists could probably get by with conductive glue.

Anyway, I rarely get real comments on this blog and would appreciate some. They don’t appear immediately; I have to go through them and approve or disapprove them.

Bye for now.

Spring News

31 March 2014

More photos of the tiny white roadside flowers!
They’re back! They are a crucifer, probably an alyssum that most would consider a weed. I took my camera out to “the vacant lot” on a brisk, sunny Sunday afternoon for these shots.

flowers look like snow

They look like snow on the ground from a distance…

drift of tiny white flowers

Get closer and you still can’t really tell..

mat of tiny white flowers

Yes, they are flowers!

huge field of tiny flowers

From an ant’s eye view, they look like a huge field!

flowers in gravel

Basalt gravel adds a little character.

defiant little flower

They defiantly grow where no plant has grown before!

Remote Viewing News

Speaking of defiant, Courtney Brown, who runs the Farsight Institute single-handed, has released his latest project, after much fanfare in an attempt to get more attention. This project concerns the building of the Great Pyramid of Giza. Yes, ETs and cloned rock miners appear to have been involved. The stones (up to 80 tons in weight) were hovered into place with the manual help of human devotees. The sessions include the data that another ET group came in and introduced monotheism to the area. The “magic” of the pyramids had evidently waned by that time, and the people, finally realizing they were free to leave the area, did in droves.

Courtney is convinced that data gained from Scientific Remote Viewing can change the planet for the better, but he has come to understand the grim realities of the situation: He has only two remote viewers he can rely on; the technology is dying out. You need a group to push a new technology forward, or it will die as an esoteric curiosity. Data of this variety is being pushed into the “alternative media” with the hope that it will never be picked up by the mainstream. The “intelligence” community seems very involved in this activity. They also work hard to discredit and/or ruin anyone who has something truly promising or revealing to offer. The strategy is to make the “alternative realities community” – also known as “New Agers” – look like a bunch of kooks so no one who wants to be known as “serious” or “legitimate” will touch them. Works pretty well most of the time.

One year on the Palouse as of end of January!

tiny flowers with bicycle

My bicycle celebrates its first year in service.

Microscopes

23 March 2014
microscope

American Optical “Spencer Sixty” lab microscope

When I was young I had a microscope. I didn’t use it very much. Just enough to see some little creatures swimming around in pond water, look at some insect parts, and things like that.

But when I saw a lab microscope last year at Palouse Treasures, being sold for a tenth of what it was worth, I had to get it. Now someone who really has a use for one has expressed an interest in it. So I thought I better take some photos of it and put up an article.

Known History of the Microscope

According to the historians, Dutch lens makers (for eyeglasses) were the first ones on earth to put together microscopes, back in the late 1500s. This may be true.

Antonie van Leeuwenhoek (1632–1723) is a famous name in microscopy, pioneering the use of this instrument as a research tool in biology.

As a Scientologist I am aware that all earth technologies had earlier versions elsewhere. The process here on earth has been one of re-familiarization, not “first art,” for the most part.

Optical microscopes served us well until the 1930s, when some electronics guys were able to throw together some instruments that magnified things much better than optical microscopes could. Meanwhile, optical lenses continue to be used for so many different purposes it would be difficult to list them all.

Parts of a Microscope

parts of a microscope

Parts of an optical microscope.

I don’t particularly want to get into a whole thing on optics here. The point was to just get some photos of a microscope up on my blog, with a few of the basic technical terms.

microscope business end

objectives, stage, focus knobs, lamp

Perhaps one of the more fascinating things about this instrument, and many others like it, is the solidity of its design and the obviously precision machining that went into many of its parts. In many modern machines, the technique that goes into their construction is mostly hidden under a cute or simply practical cover. Unless you open things up, you won’t notice all the precision parts that go into the things we use (I am thinking of computer disk drives). But with this microscope, the machined surfaces are right out there to look at.

Extending the perceptions

The microscope is an example of a long list of tools designed to extend human perception. The fact that we find ourselves in a situation where we must construct sophisticated machines to extend the abilities of our bodies (which are rather sophisticated biological machines in themselves) is quite ironic. We had – in theory at least – the full range of perceptions to start with. We ended up “inside” a very limiting body for reasons best left for researchers such as LRH to explain.

Only a very few people on earth are beginning to experience the range of perceptions that are available to a being when it operates exterior to a body. There have even been techniques developed to rehabilitate lost perceptual abilities, including the ability to sense things like magnetism and radio waves. I am very interested to see where this process of rehabilitation will take us!

Java – diving in

6 March 2014

What it takes to write a program – briefly?

Back when I was using DOS [the Disk Operating system sold with most PCs (personal computers)], there was a program included called QBasic. You ran the program and there was a window (a DOS window) where you could write your own little programs. Then you would run them from inside the QBasic program.

This was a very simple functionality for writing software. However, we still follow this fundamental pattern. The program you write software in is now called an IDE – Integrated Development Environment. You develop software by writing and editing code. An average biggish program will make use of many code libraries. These all have to be in places where the IDE can find them. As the functions implemented by your application become more complex, the connections between the various different parts become more numerous.

What does it take to write a program? I takes an IDE, or something like one.

Java

The Java language and approach was created in the 1990s by a computer scientist at Sun (Stanford University Network) Microsystems. By 2007 it had become completely open-source (all code freely available to the public). In 2009 Oracle, a huge software company, bought Sun with the promise to keep Java open source.

The Java approach was to create a language that would be the basis for programs that could run on any operating system. This language is VERY widely used. Its users include huge companies like Boeing, governments, the military, robotics competitions and programming hobbyists.

NetBeans

NetBeans is Oracle’s IDE for Java. It started as a student programming project in Prague (a beautiful city in central Europe). It was purchased by Sun in 1999, and was made open-source soon after that.

One reason it is called NetBeans is because Java is very widely used to create applications that run over networks. Network applications are more complicated than desktop applications because they require communication between computers and sharing resources among multiple users. Of course, Java can also be use to create desktop applications.

Here is a screenshot of a sample NetBeans project:

netbeans example

This shows two views of the same project. One view shows the actual folder structure of the project, and the other shows the project in a way that should assist a developer to work on it.

Note that the number of different parts that make up this “simple” project is quite large. This is rather daunting for the beginner!

What I wanted to do

Years ago I learned that a game controller, usually called a “joystick” after the control stick used in helicopters and jets (a rather base play on words – common among pilots), was extremely simple to make. It seemed like an ideal way to add some hardware knobs to any sort of control application. I wanted to have a piece of code that would allow me to use human-controlled joystick positions in my software applications.

In the “old days” of DOS, this wasn’t too hard to do. You could write commands that took data directly from the computer’s hardware interface.

But “modern” computers, in an attempt to become much more versatile, no longer access hardware directly, but communicate to the hardware through “drivers” that are little pieces of software that make some particular piece of hardware look to the operating system like a generalized, or generic, piece of hardware. So the operating system only has to worry about “printers” and “keyboards” and “game controllers” instead of all the different specific models that exist. And the hardware manufacturer is responsible for providing drivers for different operating systems that they want their hardware to work with.

Windows, in particular, has been through a lot of changes in how its hardware drivers work. This is partly because it is trying to anticipate future hardware innovations and make operating systems that will be compatible with them.

Thus, talking to an old-fashioned DOS joystick on a Windows computer is now basically impossible. You need an intermediate piece of hardware (thankfully not too expensive) to make the “legacy” joystick look like a USB game controller. Then you can choose one of several ways of talking to the USB game controller — your joystick.

I was not getting anywhere finding code examples that worked in my Microsoft IDE (Visual Studio – I learned to use it at Seattle Central Community College), so I thought I might try Java.

My first choice for a Java IDE was Eclispe. This is an open-source IDE developed by IBM. It is about 10 years younger than Java and is in fact written in Java. I had heard good things about it including the fact that it is very versatile through the use of feature “plug-ins.”

Here is a screenshot of just a portion of the application. It is really very similar to other IDEs. However, the best code examples I could find were developed using NetBeans. Each IDE uses its own internal folder structure. So you can’t really take a NetBeans Java project and just copy it over to Eclipse and have it work fine.

eclipse-example

Success!

If you have a USB joystick, on Windows 7 you can go to the Control Panel, choose Devices and Printers, and you should find listed your game controller (if it’s plugged in). You can right click it, select “…settings” and then click the Properties button. It should bring up a little window that graphically shows the joystick, sliders and buttons on the game controller, and the graphic will change as you move the controls or press the buttons. This is exactly what the code I found implements using Java. It’s a very interesting piece of code, and it is comprised of (count them!) three major parts and about 15 different functions. That doesn’t count all the stuff that Java takes care of for you. So this function is not as simple as I’d like it to be, but at least I finally have some code I can look at. (This is available in a zip file called JInputJoystickTestV2.zip from http://theuzo007.wordpress.com/2013/10/26/joystick-in-java-with-jinput-v2/ .)

More on project folders

It took me a while to learn to use folders to organize my code projects – even the ones I did without a real IDE (I learned to create PHP applications without using an IDE). I finally decided on a standard folder structure for my PHP projects, and it has helped me to “throw together” an idea, because I can just start by copying a similar project into a new folder.

Below is a little illustration of someone’s website folders. The “eng” stands for “English.” The other folders are similar to the ones I use. One for HTML pages, which may be “static” or contain code in them. One for images. A website can have a LOT of images! One for styles, which are files written in a language called CSS – Cascading Style Sheets – that describe how a website should look, but contain no content. And one for “js” – JavaScripts. JavaScripts are not really related to Java, and are a little controversial. They are basically little programs that download with a web page and run in your browser. They can therefore potentially do bad things to your computer. They are supposed to only do things to your web page, though, and now most browsers are built in a way to help ensure that JavaScripts only operate on the document being displayed. Still, I don’t like to use them. I prefer to rely on built-in browser functionality to do things on a web page.

And with that little digression, goodbye for today!

website-example

DMX

14 February 2014

DMX controller

DMX stands for Digital Multiplex. It’s a digital control technology (like MIDI) that was developed in the late 1980s to allow computerized control of stage lights.

Multiplex: “…a system for transmitting or receiving simultaneously two or more messages or signals over a common circuit…” (Webster’s 1982).

DMX allows a very low-power digital signal to control many very high-power theatrical lighting fixtures. Now that LEDs are bright enough to use for this sort of lighting, the power needed to run such lights has gone way down, and so has the cost of the fixtures. So I got a used one to get some mass on how this system works.

DMX fixture

The DMX system design is very simple. The controller regularly sends out a signal that can contain data for up to 512 different parameters, known as “channels.” A parameter can have any value between 0 and 255. A lighting fixture can be controlled by as little as one parameter (how bright or dim it is) up to many that can control its color, where it’s pointing and other functions that fixture is capable of.

For example, the fixture I bought has three colors in it (red, green and blue). So each color is controlled by one channel, and a fourth channel controls the overall brightness of the entire fixture. When setting up such commands with a computer, all sorts of intricate automated sequences can be created.

Fixtures have separate cables for power and control signals. To save cabling, most fixtures have “in” and “out” connectors so that each fixture can be connected to the one closest to it, and they will all get the control signal in “daisy chain” fashion. For some reason, probably because of their sturdiness and availability, the same connectors that are used for professional audio are also used for DMX signals. Technically, though, since the digital signals contain much higher frequencies, normal audio cable cannot be used for DMX; special digital cable must be used.

DMX fixture

More about MIDI, DMX and possibly other digital control schemes in future articles…

MIDI

2 February 2014

MIDI controller

Musical Instrument Digital Interface

Interface: “…a means of interaction between two systems…” (Webster’s)

The term is used broadly and sometimes confusingly in electronics, computers, computer science and programming as well as less technical subjects.

This word – and many of these articles – embrace a topic which I call digital control. A simple form of digital control is when you walk up to a light switch in your house and turn it on or off. One huge use for computing machines is to use this basic action for controlling all sorts of things. Huge electrical machines, power generation and distribution systems, lighting systems in buildings and for entertainment, manufacturing tools, and all sorts of other devices.

Any control system has 3 basic components:

  1. A controller;
  2. the thing to be controlled;
  3. some sort of feedback mechanism to tell the controller if it was successful.

In MIDI and several other simpler digital control systems, the only feedback channel is through the human senses. In other words, when a musician hits a key on a MIDI controller, the only way he knows that doing that worked the way he wanted it to is by listening to what comes out of the speakers.

I will bring out the book I have in my library: The MIDI Companion by Jeffrey Rona (1994) as my resource for this little introductory article.

MIDI was introduced in 1983 by the growing electronic musical instrument industry as a standard way for controllers to talk to synthesizers. As the name implies, is was digital. In fact, it totally depends on microcontrollers to work at all.

I define a microcontroller as any electronic control device built into a piece of equipment that requires software (or firmware – embedded software) to make it work. The actual technical definition is maybe a little narrower than this.

Thus, MIDI has two main technical aspects to it:

  1. The technology of making musical sounds using electronics, which heavily uses the terminologies of acoustics, the science of sound.
  2. The technology of digital communications, which uses the terminologies of computer systems and computer science.

Advanced users of MIDI must learn both technologies and the various terminologies involved. A “casual” user of MIDI only needs to learn the basic acoustical terminologies, along with having some knowledge of music, of course.

The controller

The photo at the top of this article is my controller. It has an ordinary musical keyboard to play notes, and quite a few control knobs, sliders and switches that tell the synthesizer more about the acoustical properties of each note.

Controller hardware can have a wide variety of capabilities built into it. But what it must do is send instructions to the synthesizer that will result in musical sounds coming out.

The synthesizer

The synthesizer is the device being controlled. It’s job is to make sounds by responding correctly to the control messages sent to it over its MIDI connection from the controller. Most synths also have some stand-alone sound production capability, so they can be tested without a full controller attached.

MIDI synthesizer

I have recently acquired a synth, which is the main reason for this article. Before, I only had “software” synths, which operate on a computer and play through the computer’s sound system. That adds a layer of complexity that I didn’t want to have to address in writing about MIDI. So with the use of this synth, that complexity is eliminated.

Future articles will explore this technology in more depth.

Freezing Fog

23 January 2014

view wide

We have had “freezing fog” on the Palouse for the past five days now. It may disappear tomorrow when the sun comes out. I was not used to it, so took some photos. Technically, it’s probably not “fog” but extremely low clouds. But as you can see, it turns the trees, bushes and plants white.

view narrow

Here are what some rose hips by my apartment looked like on the second day.

rose hips

And here’s what a branch up on the hill looked like on the fourth day.

branch with crystals

An undropped oak leaf is encrusted with fine ice crystals.

oak leaf

Up on the hill, the crystals were long and whiskery by the fourth day.

branches closeup

The structure of these crystals is quite fascinating and appears quite delicate. I’m sure if there had been more wind, they would have all been knocked off.

crystals closeup

A little further down the hill, a different branch carries its crystals in a stubbier pattern.

bush branch


Follow

Get every new post delivered to your Inbox.

Join 58 other followers