Skip to content

Dave Jones hosts Shahriar Shahramian and the discussion is something else.

It’s a geekfest. Shahriar Shahramian from The Signal Path met up with Dave Jones of EEVblog and discussion is well worth some time. It’s broken up into three videos each with their own focus.

1. Youtube & Bell Labs

2. Science, Debunking & Education

3. about the millimeter wave electronics and 5th generation RF

These two are been there, done that communications and electronics engineers who have created successful YouTube channels that provide a no holds barred education to improve technical and scientific literacy. 

CI-V simplified by modern tech for Icom radio control

There’s a simple eighth inch jack on the back of most Icom radios that provides a communication interface for control purposes. If you look around for how to tie this into a computer, most of what you’ll find is about converting to a standard RS-232 serial port. That is soooo old tech! I like what Guy Dickinson says about this.

Googling around, we found lots of level converters for RS-232 serial ports, but very little with USB in mind. In addition, most of the circuit designs for homebrew cable assemblies were quite complicated, and generally speaking, published in about 1992.

It turns out that the Icom CI-V interface is TTL-based, with the TX/RX cables bridged together, with a ground reference on the sleeve of the 3.5mm connector. Given the popularity of Arduino and similar chipsets that require a TTL serial interface to program and operate, we figured we could do better with a prefabricated USB-TTL cable like the TTL-232R-5V from FTDI. It turns out the resulting build is stupid-easy.

Prefab USB to serial cables are available for under $5. They sport a popular chip like the Prolific PL-2303HX Edition (Chip Rev D) USB to Serial Bridge Controller or the Silicon Labs CP2102/9 sinlge chip USB to UART bridge. See below – gpsd and finding the GPS via USB for using one of the cables with a GPS module.

As Guy notes, this is a “stupid-easy” method using cables originally intended for the maker crowd to program their microcontrollers. It is also ‘stupid-cheap’ and it is also open ended with the ability to add PTT or whatnot. If isolation is a concern, you can add an optoisolator or other protections. This is right down the maker alley and there are inexpensive breakout boards for optoisolators, relays, and whatnot. It’s be easy to make your own super duper rig control with, say, a small usb hub, usb to audio dongle, and some other modules.

CO detectors

The attraction of a First Alert model CO1210 was the promise of a ten year life on battery. It was installed on 1 May 2015 and declared defeat on 26 March 2017. That was a disappointment. The battery is a cr17335 Manganese Dioxide-Li/Organic Electrolyte (Maxell Datasheet) for 3 volts and 1.75 Ah. The Sanyo (datasheet catalog) indicates a ten year life at 23C at 20 microAmps with a final voltage of 2.5 volts. The battery on this detector after almost 2 years was down to 1.7 volts so something was wrong (overnight it recovered to 2.1 volts after being pulled from circuit despite the device being turned off). Here’s the disassembled detector:

First Alert CO1210 innards

and a closer view of the circuit board:

co detector circuit board

The brown AA sized thing in the picture is a Figaro TGS5042 is the CO detector (datasheet). It generates 1.2~2.4nA/ppm CO and you have to be careful not to apply anything more than 10 mV to avoid damage to the sensor.

The big chip is a PIC16LF1937. It’s an 8-Bit CMOS Microcontroller with LCD Driver and nanoWatt XLP Technology. To its left is is the RE46C107 for driving a piezoelectric horn. The op amp to get the nanoVolt signal up to the microcontroller’s ADC levels looks to be a MCP6V01.

So, it’s a straightforward microcontroller with sensor, display, and noise maker. The special thing about it is the use of low power components. In this area, the CO detector is the key item. The operating principles describes it this way:

Figaro Electrochemical-type gas sensors are amperometric fuel cells with two electrodes. The basic components of two electrode gas sensors are a working (sensing) electrode, a counter electrode, and an ion conductor in between them. When toxic gas such as carbon monoxide (CO) comes in contact with the working electrode, oxidation of CO gas will occur on the working electrode through chemical reaction with water molecules in the air (see Equation 1).

Two other types are also available. These are the MOS and Catalytic types. The Electrochemical-type is very low power but that means a very weak signal. Now the question is whether or not to put in another battery or just replace the device. 


Complicating decisions about small computing for low power stand alone devices

The Raspberry Pi Zero W was announced on the fifth anniversary of the original RPi. TechRepublic has the story — Raspberry Pi Zero W: The smart person’s guide. “This comprehensive guide covers everything you need to know about the $10 Raspberry Pi Zero W, the latest tiny computer from the Raspberry Pi Foundation.”

The price is getting down to where it fades into the noise for onesy projects. There are competitors like the C.H.I.P. that promise a bit more for a bit less but these currently suffer availability and support. This is full scale modern computing getting into the price range of the microcontrollers that generally have 80’s era computing capabilities plus special hardware capabilities.

A complimentary trend is that many sensors now have internal processing to convert some physical phenomena to a measurement that can be communicated via I2C or SPI or other established protocol. The RPi is well suited for this sort of thing. The microcontrollers maintain the lead when the ADC comes into play to convert analog voltages to a digital measurement. They also lead when it comes to very low power capabilities. EEVBlog has a discussion about Everything including the Kitchen sink under $1.

Another difference is about real time response in a known time frame. This could be important in a device like the NTP Stratum 1 server based on a GPS pulse per second signal in order to assure the best possible accuracy. The small computers often run Linux which is not a real time operating system and that means that there could be some latency between a PPS signal and the computer’s doing something with it. The issues are described on the Free RTOS page. The ESP8266 is a microcontroller that uses RTOS in order to multitask its WiFi radio needs and allow other processes to get done as well. The clock rate on modern devices reduce the real time issues even though higher clock rates usually mean higher power draws. The ESP8266 runs at about 80 MHZ and the RPi at 1 GHz. Contrast that to digital audio where the highest sampling rate is under 100 KHz. Even the ESP8266 can get in 800 instructions between audio data chunks.

Memory is another factor. It determines the programming for the device and impacts power draw. The ESP8266 depends upon external memory which was a major factor in its popularity. It’s internal memory for running programs is rather limited. Most microcontrollers use internal memory and that is often well under a MB in size. The small computers need a half GB for software plus external memory that often runs into multiple GB size. 

User input and output can be another issue. Microcontrollers are usually quite limited in this area as they are intended for special use devices. Computers are more generic and have more memory for user interface software. Video in this graphical interface era can be a major factor as well as it needs a lot of memory and a lot of processing capabilities.

The things you can do! That’s perhaps the biggest problem is that of trying to figure out what to do.

GPS and time

What time is it? and Where am I? – two seemingly simple questions but just look what happens when you start to explore the depths of the questions.

Mario Corchero is doing a talk on It’s time for datetime at PyCon coming up in May. “We will also speak about different standards of time, time zones, Daylight Saving Times, leap seconds, serialization and datetime arithmetics.”

Working with time is not a trivial challenge. Python includes a native module in the standard library to work with it but datetime keeps being together with unicode a common source of errors. This often leads to the widespread of many other libraries in the attempt of easing the work of working with datetime. Datetime is one of those API that looks easy to use but given the many concepts around time, is it easy to get backfired if the developer has not solid knowledge about the them.

Those are the issues at the bottom of an NTP stratum server based on GPS time. Fortunately most of the shenanigans can be left to the client so the server part can be simplified.

Another case where these issues got interesting is trying to put together a standalone clock with a Picaxe board and a clock chip. Setting the clock was a challenge for human interface ideas. Automatic DST adjustments were another can of worms entirely.

On the ‘where am I’ front is Chris Rizos And Donald Grant with How GPS keeps up with a continent in constant motion. How can you keep GPS and the map copacetic?

The Australian continent, perched on the planet’s fastest moving tectonic plate, is drifting at about seven centimetres a year to the northeast. This is taking features marked on our maps out of line with the global navigation satellite systems (GNSS) such as GPS.

These reference points and their coordinate system of latitudes, longitudes and heights are called a geodetic datum. Every country has its own datum, and the one Australia has used to date is called the Geocentric Datum of Australia 1994, or GDA94.

Satellite positioning systems – such as GPS, the Russian GLONASS, the European Union’s Galileo and China’s BeiDou – give coordinates based on a datum that is not fixed to any continent, but rather the average of all continents. So the coordinates of fixed features on the Earth’s surface, such as the Australian continent, are always changing, like slow-moving ships at sea.

Historically, coordinate differences of a metre or so have not been an issue, because positioning systems have not been accurate enough for users to notice. When GDA94 was first introduced, the GPS locations were only accurate to around 100 metres and sometimes much worse.

But two important things have happened since then. Australia has moved about 1.6 metres northeast, effectively moving the location of mapped features and their associated GDA94 coordinates.

At the same time, positioning technology has evolved considerably.

There are really two issues here. One is a model for the shape of the earth for an accurate location coordinate and the other is a map of features on that earth. Most GPS systems use a fairly simple sea level datum but allow you to choose from among the most common.See Wikipedia on Geodetic Datum. The math can be rather interesting at it is trying to model complex shapes in three dimensions and those shapes have a lot of interesting important features.

Chasing Australia as it moves northeast presents another challenge. Rather than update maps on a regular basis, the GDA94 datum might be updated instead. See Esri Australia Technical Blog Australia is on the move GDA2020.

Fasten your seatbelts!

The persistence of technological creativity explored

What makes Western Culture to nest for the wealth of modern society and the path for getting out of the mire of human misery? Joel Mokyr has some ideas: The persistence of technological creativity and the Great Enrichment: Reflections on the ‘Rise of Europe’ [Editor’s note: This column first appeared as a chapter in the Vox eBook, The Long Economic and Political Shadow of History, Volume 1, available to download here.]

This difficulty was resolved in late medieval and early modern Europe. What emerged and turned out to be of great importance, is that political fragmentation was coupled with an intellectual and cultural unity, a more or less integrated market for ideas, that allowed Europe to benefit from the increasing return associated with intellectual activity. This unity was rooted in Europe’s classical heritage (with the widespread use of Latin as the lingua franca of intellectuals), and the structure of the Christian Church. While, for much of the Middle Ages, the intensity of intellectual activity (in terms of both the number of participants and the intensity of the debates) was light compared to what it was to become after 1500, it was transnational. By 1500 or so, national boundaries mattered little in the thin but lively community of intellectuals in Europe. Many of its leaders moved back and forth within Europe, despite the slow and uncomfortable nature of travel. Two of the most prominent leaders of 16th century humanism, the Valencia-born Juan Luis Vives and Desiderius Erasmus embodied this footlooseness: Vives studied in Paris, lived most of his life in Flanders, but was also a member of Corpus Christi College in Oxford and served for a while as tutor to Henry VIII’s daughter Mary; Erasmus moved back and forth between Leuven, England, and Basel but also spent time in Turin and Venice. In the 17th century such mobility among intellectuals became even more pronounced.

Moreover, through the printing press and the much improved postal system, written knowledge spread faster than ever.

The book might be a slog but maybe worth registering with the site to download

Buckaroo Banzai weird?

It’s cited as one of 366 Weird Movies.

“Would a watermelon in the midst of a chase sequence not be, in its own organic way, emblematic of our entire misunderstood enterprise? At once totally logical and perfectly irrational?”–W.D. Richter, explaining why there is a watermelon inside the Banzai Institute

Any movie that successfully incorporates a band of rock and roll scientists, an invasion by aliens uniformly named “John,” the Eighth Dimension, inexplicable watermelons, and Jeff Goldblum as a New Jersey neurosurgeon who dresses like a cowboy—while working inside the Hollywood system, with a $12 million dollar budget—has worked hard enough to deserve a space on the List of the Best Weird Movies ever made.

By the way, the reason that they put a watermelon in the vice is because a grape wouldn’t have shown up on camera.

IMDB link: The Adventures of Buckaroo Banzai Across the Eighth Dimension (1984)

What’s weird about all that?

Young men from A to Z

TXRed posts From “Animal House” to “Zulu”?.

“So, if I, a female-type person, want to sum up the best and worst of undiluted guy-ness, Animal House and Zulu would be it?”

But as an outsider, I think Dr. McD was right. From everything I’ve seen and heard, and hidden my eyes from, you had to sum up young men on their own, without the leavening (or encouraging) presence of ladies, those two films might make a good start.

vive la difference! no matter how un-PC or out of style it may be people know and some are even self aware.

gpsd and finding the GPS via USB

gpsd has a goal of finding the GPS receiver when it is attached to your system invisibly and providing data via a network port so an application doesn’t have to worry about what kind of receiver, its particular protocol, or how it’s connected. Doing that is a can of worms.

The current most common method for connecting a GPS receiver to a computer is via a serial port that runs through a serial to USB converter. That converter is usually a single chip and it shows up as a USB TTY device. When UDEV sees such a device, it looks in /lib/udev/rules/60-gpsd.rules to see if gpsd should be launched to check it out. That rules file is installed with gpsd. What is interesting is that both the Prolific Technology, Inc. PL2303 and the FTDI 8U232AM / FT232 are “disabled in Debian as it matches too many other devices

That’s why that cable didn’t work to get the serial output from the GPS module. It would work if I was using the USB port on the module itself as that’s U-Blox but doing the serial to USB off the module pins with a Prolific based patch cable didn’t. So I removed the comment indicator at the beginning of the rule and, whatdoyouknow?, it works. On ttyUSB1 no less.

The lesson out of this is that gpsd is most likely to find a GPS receiver on a USB port if you use the converter chip that comes with the receiver. Using a couple of the most common serial to USB converter chips is going to need some rules adjusting.

I bought a couple of simple converters that are intended for microcontroller access. While the ESP8266 boards I have, a NodeMCU and a Wemos D1, both have onboard USB and the handshake lines that can be used to put the ESP8266 into firmware download mode, I still needed the simple converts to examine the debug output from the second, output only, ESP8266 UART. I am also using one of them so I can monitor the GPS receiver output via the RY835AI pins to see what I2C configuration from the ESP8266 is doing. I don’t want to use the USB port on the RY835AI because it would supply power to the module and I want the module to get its power from the microcontroller board.

The next question is why all the fuss about gpsd? The NTP stratum 1 server will be able to do a lot more than just dish out time based on GPS clocks. One option is to serve up the data on a web page. Another option is to stream it out a network port compatible with the gpsd schema. So I need to understand gpsd. Next on that process is going to be some Python gpsd client code experiments. 

NTP via GPS on an ESP8266 using MicroPython: design issues

It’s been done before, lots of times. Sort of. But maybe not just this way. The collection of parts and pieces provides for a broad curriculum of learning possibilities. Here are some of the issues that have come up so far.

SNTP vs NTP. NTP has a long history and it is intended for always on computers where the clock needs tweaking over time to keep it ‘close enough’ without any hiccups (the principle of least surprise for any software using the clock). The simple version doesn’t have the sophisticated algorithms to correct errors gently. It is designed for computers that are turned on and off and it just bangs the clock to the correct time and doesn’t worry about what anybody using the clock might think.

The first issue is about the nature of keeping time. There is general agreement on the length of a second based on the TAI (International Atomic Time).  In the 70’s gravitational time dilation became a concern so that getting clocks all over the world in sync meant making adjustments to a chosen altitude on a chosen geoid. Then there’s the the issue raised by tidal and other forces that influence orbital and rotational periods. Navigators need time to sub-second resolution that accommodates these astronomic variations so there’s a difference between whether adjustments are made to the atomic seconds in sub-second sizes for navigation or in leap-second sizes for most everybody else.

This is the first step in timekeeping: counting seconds and trying to fit the count to the earth’s current rotational period. Next up is when  to start counting. They call this the epoch. NTC uses 1900, POSIX uses 1970, MicroPython on the ESP8266 uses 2000, GPS uses 1980. The reason behind this is about how high a computer can count easily. Converting between these counts is complicated because some use leap seconds and others do not.  After you’ve got the seconds since some known time and date and the leap seconds settled, you can then figure out the current date and time. Of course, at that point, you have to start looking at time zones and daylight savings times rules. 

At least, with a GPS based NTP server, the GPS receiver does the conversion between GPS time and UTC and the difference between UTC and NTP is fixed (2,208,988,800). NTP is a bit more concerned about leap seconds than UTC because NTP likes smooth transitions but my server isn’t going to worry about that. Both SNTP and NTP use the same UDP packet containing several timestamps for measuring transmission lag and other critical parameters. As with most computer clocks, the timestamp counts seconds.It has a 32 bit part for seconds and another 32 bit part for the fraction of a second. That means it can count for 136 years with a precision of 232 picoseconds [NTP Era and Numbering]. The rollover in 2036 is farther out than the expected lifespan of the hardware so I don’t worry about that. The fractional seconds is another problem as the ESP8266 doesn’t clock time in binary fractions.

The idea is to use the high precision pulse per second (PPS) line from the GPS receiver to mark the start of each second and then calculate the NTP fraction of a second from this using the time functions in MicroPython. The PPS triggers an interrupt, the interrupt service routine reads the ESP8266 clock and stores it in a global variable. When NTP needs a timestamp, it reads the ESP8266 clock, finds the difference to the Top of Second value in milli or micro seconds, converts that value to modulo 2^32 and posts the result into the NTP timestamp. That conversion may be obvious to many but it took me a while to figure out what people were talking about.

To convert a decimal fraction of a second like milliseconds to the NTP fraction is an equal ratios problem. How many milliseconds is to 1000 milliseconds in a full second has to be the same as how many NTP fractional parts there are in 2^32 fractional parts in a full second. That becomes a simple A/B = C/D algebra problem where B is given as 1000 for milliseconds or 1,000,000 for microseconds and D is 2^32 or 4294967296. If you are converting from NTP timestamp to decimal fractional seconds, then you know C and can calculate A. If you are going from decimal to NTP (like in our NTP server) then you know A and solve for C.

After all this, we get into computer word sizes and binary value representations. MicroPython has some facilities for this but it is a bit of shoehorning to make it fit, I’ll have to use Python arrays to get unsigned 32 bit integers and the struct class to handle bytearray packing for the NTP packet. Nifty compsci stuff that is.