First Look at UML in Visio 2013

I’ve used the UML stencils in Visio 2010 for several years now. While it has many flaws (lack of non-Microsoft adopted language support), it is very easy to use and works in most situations. I’ve spent hundreds of hours doing process modeling, use case, sequence, and class diagrams.

My first experience with Visio 2013 is finding out that 2010 documents with UML will import in read-only mode. That makes them a bunch of pretty pictures. Outrage!

Creating new class diagrams from scratch reveals that Microsoft stripped a lot of UML functionality. For instance, the entire infrastructure to generate code is gone. Without code generation, the interface simplifies quite a bit. No modal dialogs. No formally typed members. No differentiation between methods and attributes. These changes actually allow more flexibility if you want to deviate from the UML standard.

Sequence diagrams changed a lot too. Besides looking very Metro, there is now support for fragments and stacking activations. In Visio 2010, you would find many options under the right-click menu. In 2013, there are fewer options, given the flexibility you will find in the actual editor.

My first reaction was to hate Visio 2013. Change is hard. After spending some hours with it, and figuring out that it is actually more flexible, I like it much more. Oh yeah: I never did use code generation.

UML_Visio2013_Class

UML_Visio2013_Sequence

Fun with the 74HC4046 PLL

Most hobbyist skip over the section on understanding Phase Locked Loops. The problem with PLL’s is that they are generic. There are many things you can do with PLL’s, so many that it’s hard deconvolute what a basic PLL does.

The 4046 has been around for decades. The 74HC4046 is a modernized (but by no means modern) version that can be used at higher frequencies. The built-in oscillator works up to 12mhz.

The 4046 has two basic sections: a voltage controlled oscillator (VCO) and a phase comparator. The VCO takes a voltage input (zero to Vdd) at pin 9 and outputs a signal on pin 4. This oscillator (VCO) can be used without using the rest of the chip.

I configured a test circuit with C1 = 20pf and R1 = 10K ohms.

Here are the frequencies generated at different pin 9 voltages.

1V 1.0424 mhz
2V 2.883 mhz
3V 4.348 mhz
4V 5.403 mhz
5V 5.551 mhz

C1 = 68pf

1V 0.358 mhz
2V 1.214 mhz
3V 1.902 mhz
4V 2.442 mhz
5V 2.512 mhz

RF Mixer PCB

A while back I created two circuit board designs to learn Upverter, but also gain some experience in laying out circuit boards. SeeedStudio will sell you ten 5×5 cm circuit boards for about USD$15 shipped.

I decided to create a SA602 RF mixer board and a separate crystal filter board to go along with it. The mixer board is built with multi-purpose implementations in mind. For instance, you can configure it as with a crystal, or a LC oscillator, or add a varactor. The inputs and outputs have multiple through-holes for using a transformer or capacitors.

The crystal filter board supports four crystals and has an optional configuration of using varactor’s for variable bandwidth.

I sent both designs to SeeedStudio (first time I used their service). I was impressed that I could download the Eagle files from Upverter and send them to Seeed without changing file names or doing anything.

DSC02940

IMG_0589

Raspberry PI and clock stretching

I started playing with i2c (or two-wire) on the Rpi. I quickly found problems when talking to i2c slaves that are usually some sort of embedded processor (mostly AVR’s). The problem is that the current i2c driver in Raspbian “wheezy” has a hard coded timeout flag. I2C is facilitated by a Broadcom 2835 chip that has multiple types of I/O. There is a drive for this chip that maps the different types of I/O to /dev/ devices.

I’ve had this problem with blinkm’s and Sparkfun’s 7 segment serial/i2c board (both use AVR’s). I also tried smbus and quick2wire. What makes this problem maddening is that the timeout is problem very close to the actual timing and will fail sometimes but not others.

Back to the problem: if the i2c slave does not ACK a command within a certain number of rpi clock cycles, then the driver returns errno 5. On the i2c slave side, the AVR (or other processor) may be do work in response to a command. If the slaves waits to long, the timeout gets exceeded and the Linux driver returns that pesky error. Until this is fixed at the driver level, people are going to have to live this annoyance. Edit: Reading from smarter people: this is a really a chip set issue. The best solution is to use an I2C chip set that handles this in hardware. Fixing it in software (at the driver) level is just kludge.

To me this is more than an annoyance, it’s pesky and makes the i2c nearly unusable. There are a few work arounds:

  1. Reduce (or changed) the i2c bus frequency
  2. Rewrite the firmware on the i2c slave to immediately return the ACK
  3. Catch the errno 5 and repeat until success

Cheap Sharp GP2Y0A21 IR sensors from China

DSC02965 (1280x960)

I purchased a bunch of the Sharp (are they really?) branded GP2Y0A21 IR sensors via aliexpress. This is my first time purchasing from alibaba. I’ve purchased lots of stuff through ebay; most of it comes from Hong Kong.

Sharp IR sensors typically cost in the $12 to $16 range. I ordered several from China at $6.50/unit. I tested each one to make sure each was worked as was within specification. I plotted (sorry not going to publish) the returned values. I am surprised how close each sensor was to the average. I’m thinking the amount of jitter in the readings may be from dust in the air.

Raspberry pi Model A with Edimax

I got my Model A Raspberry pi working with the Edimax EW-7811 USB wifi adapter and no additional network connectivity. I used a cheap USB hub and could power the mouse, keyboard, and wifi with no external power.

There are a few tricks: the first is to use the most recent version Raspbian.

The second trick is to edit the /etc/wpa_supplicant/wpa_supplicant.conf file and manually join to an SSID:


ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

network={
ssid="luben"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
psk="*password*"
}

The /etc/network/interfaces file looks like this,


auto lo

iface lo inet loopback
iface eth0 inet dhcp

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

Kids project: wood toolbox

I did this project with my eight year old boy in about one and a half hours. It uses a 1/2 dowel and a six foot pieces of 10″ wide pine. Cost is about $14 with a bit of leftover wood.

I used a table saw to rip the 10″ pine into pieces measuring:

  • four 12″ pieces (two of these are ripped lengthwise at 5″ height)
  • two 14″ pieces

I used a small bowl to trace the curve at the top of the 14″ pieces for nice radius, then used a Ryobi scroll saw to cut the radius.

Measure the center of the radius (or whatever looks good to you) and mark with a pencil, then use a 1/2 paddle bit to drill a hole (both 14″ pieces) for the dowel.

I used a Kreg pocket hole jig to put pocket holes on the inside of the pine pieces. Glue the edges then use Kreg 1.25″ course screws. The Kreg screws hold tightly and will not go through the pine pieces. This project could easily be done with a harder wood (use fine thread Kreg screws instead of course).

I let the boy put nails in the ends for fun (all boys love hammering). A bit of 100 grit sand paper takes the rough edges and sharp corners off.

DSC02961

DSC02963 (1280x748)

Rice University r-one robot

I saw this notice via Pololu. Rice University has designed a researching/teaching robot r-one. It looks a lot like Pololu’s 3pi, but has a lot more sensors, 2.4ghz radio and an ARM processor.

At $400 each, it probably won’t attract the hobby crowd.

Raspberry pi model A versus B

Received my first raspberry pi. I’ve been looking for a use for one of these for a while and finally found it. Come to find out there are three different types of pi’s on the market: Model A, Model B Rev 1 and Model B Rev 2. The Model A has no ethernet. To get connectivity, you must use a USB adaptor. Model B Rev 1 has wired ethernet whereas Rev 2 is the same, but with an extra 256mb RAM (512 total).

Raspberry Pi’s are now starting to show up on Amazon Prime, but the price is a bit higher than ordering from Sparkfun or Adafruit, but it will appeal the instant gratification crowd.

Hurricane canless air

We started using these Hurricane canless air tool to replace the cans of air we purchase. Canned air has additional chemicals in it that are not good for the environment, and you pay a lot for compressed air. The Hurricane is a high speed air pump with a nozzle. Its power source is rechargeable battery.

We use the ESD-safe model (a bit more expensive) to blow the dust out of computers. The air output is not quite as focused or as high a velocity as a traditional can of air. This tool is also noisy. It has a high pitched shriek. Across the office it sounds like a dentist drill. Even through these shortcomings, it is a cheaper and greener solution than canned air.