Wednesday, April 4, 2018

LoRaWAN in central New Jersey in early 2018?

I bought a couple of LoRa RF modules, including a 915 MHz Hope RF RFM95, last fall. The plan was to hook it up to an Arduino and use IBM's LMIC library to make a simple LoRa transceiver, get a developer account with a LoRaWAN service provider and start experimenting.

However, there was a snag. Senet does offer developer accounts, but doesn't currently have coverage in my neck of the woods, in central New Jersey, about halfway between Philadelphia and New York City. Comcast offers LoRa service, but calls it "machineQ", and also doesn't currently have coverage at my location. I didn't find any information about Comcast LoRa developer accounts. In fact it sounds like it's mandatory to use the Murata mQModule with the Comcast mQSpark dev kit to connect to the Comcast LoRaWAN, not very developer friendly.

So not only is there currently no coverage by commercial LoRaWAN service providers, they might not let you connect with your uncertified $5 RFM95 transceiver. The cheapest certified LoRa RF module I can find is the $15 RN2483, not only a bit pricey for use with an IoT sensor, but might still not let you connect with machineQ.

recent blog post by Omkar Joglekar documents how he built a LoRa transceiver very similar to what I had in mind, but much more ambitious with nice weatherproofing and a fancy monopole antenna with ground radials. He was able to get credentials to connect to the Tata Communications LoRaWAN. Clearly Tata Communications knows how to get early buy in from developers!

My current Plan B is to join The Things Network (TTN) by setting up my own LoRa gateway, since the nearest gateways on their coverage map are about 20 miles away, way too far even for LoRa. I have a single-channel LoRa gateway on the way on the slow boat from Shenzhen.

Wednesday, March 21, 2018

Bug zapper power supply

I have a $4 bug zapper that uses two AA batteries for a voltage source. I've measured the output voltage before to about 1.4kV and today I decided to measure the power supply operating frequency and ripple amplitude. Here's the bug zapper with an improvised high-pass filter and my trusty pocket scope standing by:

Hey, this actually works! Notice the hands-free high-tech solution for keeping the bug zapper on while I fiddled with scope settings:

And a close up of the scope:

So the operating frequency is a disappointingly low 18.8kHz, but the ripple amplitude is an impressively low ±30mV riding on 1.4kV DC. A modified bug-zapper booster design for neon glow lamps definitely seem worth revisiting down the road, but for now I'll stick to refining the voltage-multiplier version.

Voltage-multiplier boost converter for neon glow lamp

And now back to the regularly scheduled programming! I had second thoughts about pursuing the inductor-based boost converter design to power a neon glow lamp with a standard 9V battery. Non-ideal effects are significant for both the inductor and the transistor switch and it wasn't obvious that I'd be able to get the booster to operate above a megahertz. I might return to this design later and hope to ultimately replace the inductor with a flyback transformer, but for now I'm going with a more straightforward voltage-multiplier boost converter.

For the first iteration, the square-wave oscillator is unchanged except that it's input voltage is doubled to 18V by using two 9V batteries in series. I wasn't sure how many stages the voltage multiplier would need, but with 18V input I got away with using a 4-stage Greinacher (a.k.a. Cockcroft-Walton) multiplier. Here it is on two mini breadboards (voltage multiplier to the left and NE555 square-wave oscillator in the back to the right:

The components were what I had available. The diodes were bargain "germanium" diodes I bought a couple of years ago. I'm pretty sure they're just generic silicon signal diodes, but they seem to work well enough for this application. The voltage rating of the caps was a bit marginal and I used the lowest capacitance values a SPICE simulation told me I could get away with without reducing the output voltage. I did this over two months ago and I don't remember the oscillator frequency, but it must have been less than 200kHz. Anyway, this first crude attempt was encouraging enough. Here's a cheap multimeter showing an output voltage of 80.8V, more than enough to light a neon glow lamp:

Saturday, February 3, 2018

Humerus Varnhemiensis

recent imgur re-post  of a not-so-recent facebook post by Historiska, the Swedish national historical museum, has created a lot of attention for Humerus Varnhemiensis, the Varnhem humerus, a medieval bone repaired by a copper-sheet cylinder. The machine translation of the original FB post from Swedish to English is lacking, and a friend asked me for my translation. This piqued  my interest and since it seems that the authoritative scientific paper on Humerus Varnhemiensis is not as widely read as it deserves to be, I'll make this post with a link to it, a summary, and some of my own idle speculation.
Picture of Varnhem humerus (from Swedish Wikipedia page on Varnhem)

Varnhem is now a small, and shrinking, town in the middle of nowhere in south-central Sweden. The Varnhem Cistercian monastery is historically prominent as a center of early Swedish Christianity, with Christian graves dating back to the 800s, and as the burial place of Swedish regent Birger Magnusson, who founded the new capital of Stockholm in 1252. The Varnhem humerus was found in the cloister aisle in 1928. It probably dates to between 1260 and 1527 and is remarkable because it shows signs of healing after being repaired with a copper-sheet cylinder. It is a unique example of seemingly anachronistic, successful, advanced surgery from the Middle Ages. My initial reaction when I heard about it was very skeptical, but Hallbäck's scholarly work on the topic seems convincing to me, as a layman in this area.

With the usual search engines, I could not find Hallbäck's paper, published in the journal "Ossa: international journal of skeletal research". However, using LIBRIS, the catalog search engine for all Swedish libraries, I found a PDF with a scan of the relevant issue. I extracted a 1.1 MB PDF with the paper of interest: Hallbäck, D.-A. (1976/7). A Medieval (?) bone with a copper plate support, indicating an open surgical treatment. Ossa 3/4, 63–82. It's a 20-page paper, written in English, and well worth a read in its entirety. There are 12 figures, 4 of them X-ray images, providing very compelling evidence.

In summary Hallbäck finds that the humerus is probably from the late medieval time period, 1260-1527, and less probably from 1150-1260. There is also a slight chance that the bone is as recent as from 1674-1695 (hence the awkward question mark in the title of the paper), when the church was used for burials of nobility, but its location in the monastery, not the church, contradicts that. Carbon-14 dating could not be used without unacceptable damage to the bone. The bone is wrapped in a "remarkably pure copper" cylinder, 7.3 cm long, and and about 0.7 mm thick. The cylinder has three pairs of holes, where it would have been held together by rivets, or similar, now gone. When the holes are lined up, the cylinder snugly fits around the bone. The paper refers to the cylinder material as copper plate, but if I went to Home Depot to buy some, I'd ask for copper sheet. A plate would be thicker and not possible to bend with your bare hands. The bone has a healed fracture ("proliferative bone reaction"), a porous area indicative of infection, and two "exostoses", bone growths on the surface of the bone, the larger of which has begun to cover the copper sheet! There is thus overwhelming evidence that the patient survived the surgery and recovered.
Figure 5 from the paper. The copper sheet is marked "cp", the proliferative bone reaction "br" and the exostoses "e".

The paper concludes: "My assumption is that the injury was caused by a cut from, for instance an axe or a sword, which led to an open wound, with the bared bone visible. The bone was probably not cut in two pieces. The plate was placed round the bone to bring about stabilization. At the same time, the pure copper had an antibacterial effect on the wound. Whether this effect was deliberate or not is impossible to say. Judging from the bone, and considering the well developed exostoses and the proliferative bone reaction, as well as the lack of fracture notches on the X-ray pictures, the patient must have survived for years, may be decades. Note that nothing can be said about the function of the arm after the operation".

My speculation is that the patient was a warrior and local nobleman with rare access to state-of-the-art medical care provided by Cistercian monks at the Varnhem monastery. His left arm was nearly severed in combat when an axe splintered his shield, peeled the flesh off the bone on the outside of the upper arm and fractured the bone. By the time he reached Varnhem the wound was infected and his physician decided to kill two birds with one stone and use a copper sheet wrapped around the already partially exposed bone to both stabilize the fracture and fight the infection. The recovery of the patient is impressive, but I find the skill of the physician even more impressive. Quoting Hallbäck: "The fixation of the plate so closely to the bone as in this case entails seriously damaged soft parts, and it is a true surgical exploit to carry through this operation so that the patient survived". Where did this Cistercian monk learn to perform medicine at this level? Was this kind of medical knowledge widespread within his order? Did he attend medical school at one of the handful of universities that existed at the time in continental Europe (Sweden's first university, in Uppsala, did not open until 1477)?

Friday, December 1, 2017

Neon glow lamp centennial

On November 30, 1917, Pennsylvanian Daniel McFarlan Moore, while working for General Electric in New Jersey, filed the patent for the neon glow lamp. Here's the top of the patent filing:
The top of the first page of Moore's patent filing for the neon glow lamp (US Patent 1,316,967)
D-mac called his invention a "gaseous-conduction lamp". In my opinion an apter name would have been "negative-glow lamp". At the time, it was commonly referred to as a "Moore lamp" and today we mostly call it "neon glow lamp".
Early gas-discharge tubes of the Geissler type existed at the time. In a Geissler tube most of the light is emitted by the positive-column part of the discharge. The negative-glow region close to the cathode only occupies a small fraction of the length of the tube. Modern fluorescent lamps, including CFLs, and the gas-discharge tubes used in neon signs are direct descendants of the Geissler tube. Moore's invention was to tweak the gas pressure and electrode spacing to make the negative glow occupy most of the discharge. In plasma physics we call this a short, or restricted, glow discharge and some weirdos with too much time on their hands perform elaborate computer simulations of such lowly devices.
The value of Moore's invention is that a short glow discharge can be operated at much lower voltages. Moore used an 80-20 mixture of neon and helium and mentions in the patent that 220 volts is then sufficient to turn the lamp on. In the US at that time, 220 volts was a common line voltage for commercial lighting, so that was probably his target voltage. Moore also made his lamp mechanically compatible with incandescent light bulbs:
One version of Moore's lamp, compatible with an incandescent bulb. The electrodes (13 and 14) are mounted on glass rods attached to the base of the glass tube. Figure from the patent filing.

With an optimal Penning mixture (99-1 neon-argon mixture), mains voltages of 110 volts, or even 100 volts, are more than sufficient. Miniature neon glow lamps are a commodity and can be bought for 6 cents to 60 cents, depending on order size and if you have time to wait for the boat from Shenzhen. They can be operated at DC or AC (as discussed at length in the patent filing) at voltages from about 75 volts, to all common mains voltages globally, up to the point where the glow discharge transitions to an arc discharge and the inside of the tube becomes covered by cathode material, causing a short circuit.
So, well done, Daniel McFarlan Moore! A wonderful invention, with some properties that could enable some novel applications, but that's another post, or two...

Monday, November 20, 2017

Battery-powered boost converter for neon glow lamp

I'm working on a battery-powered DC-DC boost converter for neon glow lamps. It's a switched-mode booster with a 9-volt battery providing input power. The output needs to be at least 90 volts or so, with a current draw in the range of 10 μA to 1 mA. For the target application I also need it to be very quiet below 1 MHz. These constraints (relatively high voltage, very low current, high frequency) puts it in an unusual corner of design-parameter space where I haven't found any ICs (integrated circuits) for sale.

So I'm rolling my own that will ultimately use a CMOS 555 timer (LMC or TLC) as a switch. I'm working my way up in frequency and am currently using a standard NE555. I've been breadboarding square-wave oscillators to compare the recommended datasheet configuration to some alternatives. The other night I felt lucky and skipped ahead and quickly implemented the rest of the booster using an available MPSA42 "high voltage" NPN BJT, a 4.7 mH axial inductor with unknown stray capacitance and self-resonance frequency and a neon glow lamp as the load. Here's the result:
Neon glow lamp DC-DC boost converter MkI. It's beautiful to me!

Close up with NE555 DIP-8 IC on the left and TO-92 MPSA42 BJT to its east-southeast. To the left of the glow lamp is an oversized black diode, with the green inductor behind it and the brown filter capacitor behind its anode lead.

And zoomed out: no cheating, the 9V battery is the only power source
So I passed the first milestone: I am powering a neon glow lamp with a 9V battery! The open-circuit output voltage was 120V. The good performance of the MPSA42 transistor was a positive surprise. It probably wasn't intended for power supplies, but I'll keep it at least for the next few design iterations. However, getting the operating frequency above a megahertz will require some effort. While I'm waiting for promising inductors to arrive (hopefully with low enough stray capacitance), I'm doing circuit simulations with ngspice, but that's another post.

Friday, November 17, 2017

Calling computers names in Swedish

I wrote a correction to the very nice article "Carl-Gustaf Rossby: Theorist, institution builder, bon vivant". Rossby and Germund Dahlquist developed a numerical weather model for the BESK computer in 1953-54 and the article made the erroneous claim that "Rossby pursued numerical weather prediction in Sweden in an era in which there was no Swedish word for digital computer". I listed the five Swedish terms for digital computer that were in use at the time. My purpose was not to nitpick, but to make the point that Stockholm in 1953 might well have been uniquely fertile soil for developing novel applications for computational science because of BESK and Dahlquist.

Through luck and skill, Sweden managed to stay out of WWII and had a booming, technologically advanced, industrial economy in the post-war period. In 1947 the Swedish government initiated attempts to buy a computer from the US. A Swedish delegation of five young engineers got remarkable access to the principals behind the early computers in the US. However, ultimately the Swedish government was denied an export license for a US computer and BESK was rapidly designed and built in Stockholm (at my alma mater KTH) using know-how gained during the visit to the US. BESK became operational in September 1953 and was briefly the fastest computer in the world, capable of 16,000 additions per second. It was also the first computer to (partially) use semiconductor electronics (400 germanium diodes).

The Swedish government's primary need for a computer was to support their nuclear-weapon program, which could explain the denied US export license, and to decrypt intercepted Russian radio communication. The ability to decrypt all electronic communication between Berlin and the German embassy in Stockholm had been instrumental in keeping Sweden out of WWII. Continued access to encrypted Russian diplomatic and military radio communications to help navigate the cold-war political environment was a strong motivation.

In stark contrast to this political and military pragmatism was Dahlquist's scientific idealism. His goal was to disperse rigorous computation through all fields of science and technology. Together with co-author Åke Björck he wrote the world's first textbook on numerical methods, with an emphasis on numerical accuracy and stability. Dahlquist's collaboration with Rossby on numerical weather modeling was one of the main achievements of this quest. Their work enabled 24-hour national weather forecast in Sweden from September 1954, 4-5 years earlier than in any other part of the world. Rossby's decision to return to Sweden from the US in 1953 to pursue weather modeling on computers was a wise one, not the folly of trying to do state-of-the-art computing in a place that did not yet have a word for computer.