Wednesday, September 19, 2018

MacOS Preview.app has a Signature Tool

When I receive a PDF file to be signed and returned I have generally printed it out to sign and scan back in... like an animal, as it turns out. On a MacOS system there is a convenient way to add a signature to a PDF file without needing to print it, using only the Preview.app which comes with the system.

In the toolbar is a squiggly icon with a drop down menu:

Clicking it allows one to create a signature by either signing with a finger on the trackpad, or writing a signature on a piece of paper for the camera to scan in. The camera option does a good job of edge detection to extract only the writing and not shadows on the paper.

The resulting signature can then be added to the document and dragged to the right spot.

Saturday, September 15, 2018

The Arduino before the Arduino: Parallax Basic Stamp

I recently had cause to dig down through the layers of strata which have accumulated in my electronics bin. In one of the lower layers I found this bit of forgotten kit: the Parallax Basic Stamp II. This was the Arduino before there was an Arduino, a tiny microprocessor aimed at being simple for hobbyist and low-volume commercial use.

The Basic Stamp line is still sold today, though with designs developed over a decade ago. The devices have enough of a market to remain in production, but are otherwise moribund. The past tense will be used in this blog post.

The Basic Stamp line dates back to the early 1990s. The Basic Stamp II shown here was introduced in 1995. It used a PIC microcontroller, an 8 bit microprocessor line which has been used in deeply embedded applications for decades and is still developed today. The PIC family is a product from Microchip Technology, the same company which now supplies the AVR chips used in the Arduino after acquiring Atmel in 2016.

The PIC contained several KBytes of flash, which held a BASIC interpreter called PBASIC. An external EEPROM on the BS2 board contained the bytecode compiled user BASIC code. Though it may seem an odd choice now, in the early 1990s the choice of BASIC made sense: the modern Internet and the Tech industry did not exist, with the concordant increase in the number of people comfortable with developing software. BASIC could leverage familiarity with Microsoft GW-BASIC and QBASIC on the PC, as MS-DOS and Windows computers of this time period all shipped with BASIC. Additionally, Parallax could tap into the experience of the hobbyist community from the Apple II and Atari/Commodore/etc.


' PBASIC code for the Basic Stamp
LED         PIN 5
Button      PIN 6    ' the BS2 had 16 pins
ButtonVal   VAR Bit  ' space is precious, 1 *bit* storage
LedDuration CON 500  ' a constant

' Init code
OUTPUT LED
INPUT  Button

DO
 ButtonVal = Button                 ' Read button input pin
 FREQOUT LED,LedDuration,ButtonVal  ' PWM output to flicker LED
 PAUSE 200                          ' in milliseconds
LOOP

PBASIC supported a single thread of operation, the BASIC Stamp supported neither interrupts nor threads. Applications needing these functions would generally use a PIC chip without the BASIC interpreter on top. Later Stamp versions added a limited ability to poll pins in between each BASIC statement and take action. This seemed aimed at industrial control users of the stamps, for example Disney used BASIC Stamps in several theme park rides designed during this time frame.

A key piece of the Arduino and Raspberry Pi ecosystems is the variety of expansion kits, or "shields," which connect to the microprocessor to add capabilities and interface with the external world. The ecosystem of the BASIC Stamp was much more limited, suppliers like Adafruit were not in evidence because the low volume PCB design and contract manufacturing industry mostly didn't exist. Parallax produced some interesting kits of its own like an early autonomous wheeled robot. For the most part though, hobbyists of this era had to be comfortable with wire-wrapping.

Saturday, September 8, 2018

code.earth hackathon notes

Project Drawdown is a comprehensive plan proposed to reverse global warming. The project researchers analyzed and ranked scenarios according to the potential reduction in carbon levels, and analyzed the costs.

Project Drawdown will continue the analysis work, but is moving into an additional advocacy and empowerment role of showing governments, organizations, and individuals that global warming can be mitigated and providing detailed guidance on strategies which can work. The audience for the project's work is expanding.

This places new demands on the tools. The tooling needs to be more accessible to people in different roles, and provide multiple user interfaces tailored to different purposes. For example, the view provided to policymakers would be more top-level, showing costs and impacts, while the view for researchers would allow comparisons by varying the underlying data.

The code.earth hackathon in San Francisco September 5-7, 2018 implemented a first step in this, starting to move the modeling implementation from Microsoft Excel into a web-hosted Python process with Excel providing the data source and presentation of the results. This will separate the model implementation from user interface, making it easier to have multiple presentations tailored for different audiences. It will still be possible to get the results into Excel for further analysis, but web-based interfaces can reach much wider audiences able to act on the results.

I was at the hackathon, working on an end-to-end test for the new backend, and plan to continue working on the project for a while. Global warming is the biggest challenge of our age. We have to start treating it as such.

Sunday, September 2, 2018

Carbon Capture: Cryogenic CO2 Separation

Sublimation is a phase change directly from a solid to a gas without transitioning through an intermedia liquid state. Desublimation is the opposite, where a gas crystalizes into a solid without becoming a liquid first. The most well-known example of desublimation is snow, where water vapor crystalizes into tiny bits of ice. When water vapor in the cloud first condenses into liquid and then freezes, the result is hail not snow.

Interestingly, and quite usefully for carbon capture, carbon dioxide will desublimate at -78 degrees Centigrade. This is a considerably higher temperature than the main components of the atmosphere like nitrogen and oxygen, and means that as air gets very cold that CO2 will be among the first components to turn into ice crystals. This allows the CO2 crystals to be harvested.

Several companies have working technology in this area:

  • Alliant Techsystems (now defunct) and ACENT Laboratories developed a supersonic wind tunnel which compresses incoming air, causing it to heat up, then expands the supersonic airflow causing it to rapidly freeze. CO2 crystals can be extracted via cyclonic separation, relying on the mass of the frozen particles.

  • Sustainable Energy Solutions in Utah uses a heat exchanger process to rapidly cool air, harvest the CO2 crystals, then reclaim the energy spent on cooling before exhausting the remaining gases.