11 July 2020

My current LoRA "DX" is 64 km

After few experiments with spread factor and the GP antenna, thanks to TTN Mapper service I can visualize which gateways have received my LoRA signal on 868 MHz.

On the South facing balcony the signal travels 64 km at SF7 BW125 and the RSSI is still respectable. The strongest link at SNR = 8 dB is "just" 48 km long. Both of these long distance paths are in line of sight or very close to it. A total of 5 gateways received my transmissions.

When I moved the transmitter on the North facing balcony I hit 3 new gateways, two of which are available on TTN Mapper. The maximum distance here is about 38 km, but there is absolutely no line of sight path between us.

That makes a total of 7 (8) TTN LoRAWAN gateways that can receive and relay to the cloud my LoRA messages

10 July 2020

How to calculate LoRa GP antenna

Say you want to try a GP antenna on your LoRa module. How long should it be? A Ground-Plane antenna consist of 1 radiator and a number of elements mimicking an elevated ground plane. All of these pieces of electrically conductive material (preferably copper wire) should be long one-quarter of wavelength.
Since the wavelength depends on frequency, you need to apply the formula:

element length [m] = 300 / 4 / frequency [MHz]

This means that each element will be:

 Lora Frequency Band [MHz]
GP element lenght [cm]
 868 8.6
 915 8,0

Don't be too picky about millimetric precision of your cuts.

How many elements should you use for the ground plane? In my experiments I used two, 180 degrees apart, because that's the amount of wire I had within hand's reach. If you can use 4, each spaced 90 degrees. With reference to the horizontal plane, ground plane elements should be bent 45 degrees downwards. Again, don't be picky with the angle, but try to be consistent with all elements.

09 July 2020

LoRA GP antenna

Now that I can map my LoRA signal, I can play with RF and try to get the most out of it. The most straightforward way is to use a better antenna, and probably the only chance to increase range/coverage.

SX1276 with a directly
attached GP antenna.

To keep things simple and straightforward I replaced the helically wound antenna with a ground-plane directly at the SX1276 board. While this is not a real-life situation, it works well for side-by-side comparison. Also I should have tuned the GP to resonance, which requires a connector and/or some coax.

The signal strength as measured by far away TTN gateways is some 7 dB better. If I understand correctly LoRA terms, 7 dB means you can reduce the spread factor by two and achieve the same signal quality. Or quadruple the bandwidth.  And you LoRA experts know the role of SF and BW on airtime vs bps vs whatever_LoRA.

The expert eye should note that the helical antenna was used without an explicit ground plane, so this experiment is probably not meaningful at all. I need to go back to the bench and re-install the coil with the same ground plane.


07 July 2020

Simulating a LoRA node GPS position on TTN

A simple way to see your LoRAWAN node or gateway coverage is to use the TTN Mapper service.

In order to get my node visible on TTN Mapper I had to enable the Mapper Integration within my Application and output notes's position. TTN Mapper documentation says that either the node sends its position in the payload or you can "pair" it with a smartphone app and keep both close to each other (ie the same vehicle, the same bag, ...).

OTOH if the node sends its position it must be decoded into a JSON through some code written in the web console, Decoder section under Payload Formats. So, why not write a static Decoder function that returns the required variables?

You need to produce latitude and longitude. Optionally altitude and hdop. If a node isn't moving, that's quite easy! Recover the coordinates in your preferred way (smartphone GPS app, GPS tracker, a web mapping service, ...) and fill in your code like this:

function Decoder(bytes, port) {

  var decoded = {};

  // your node's actual coordinates
  decoded.latitude = X;  // a value like 10.456 (this is North-South or equator)
  decoded.longitude = Y; // a value like 80.123 (this is East-West of Greenwich)
  // your node's height above ground (or is it m.a.s.l.?)
  decoded.altitude = Z;
  // your position accuracy, 5 is fine
  decoded.hdop = 5;

  return decoded;

Once the Decoder function is saved, all further transmissions within your TTN Application will carry those variables (added cloud-side once the data is received through a gateway).

Can you see a cheating danger in here? I do. But fortunately there isn't a LoRA distance competition, yet.

Let's get my signal as far away as possible, as strong as possible!

03 July 2020

RaspberryPI and LoRAWAN with SX1276

I had laying around a SX1276 LoRA module for some months and following an IoT discussion at work I thought it would be the right time to play with it.

Instead of wiring an Arduino board with level converters (or use a 3v3 Arduino Nano, which I have), I opted to use an old, single-core, 512 MB RAM, Raspberry Pi B+: wiring is straightforward and I can debug+control it remotely over SSH.

Not that I have meaningful data to transmit. I am interested in the RF part of the whole thing since 868 MHz lies between 70 and 23 cm HAM bands and everyone writes wonders about the LoRA modulation scheme. Because of that I chose the software that offered the fastest way to get a signal on the air with the support of TTN. I used arduino-lmic-rpi with bcm2835-1.64 driver. The RPi distro is based on Debian 8 with kernel 4.9.35, don't ask me its name.

The TTN part is well documented: you need to create an Application and register your device on their portal. Then get Device EUI, Application EUI and App Key which have to be inserted into the .cpp file. Pay attention that DEUI and AEUI need to be reversed, so LSB first. Compile and run.

If everything is correct and your LoRA node can reach a gateway nearby, your transmissions will begin to appear on the web console. You need a TTN gateway in your area and it must be able to receive your transmission!!

Performance? My signal is being received by 4 gateways and a couple of them seem to be quite far away (but in line of sight).

Nothing new so far, I have only replicated someone else's work.

30 June 2020

Update on iWatRoad scooter

Once I replaced the melted XT60 battery connector in the R9 iWatRoad scooter, the user interface powered up. While the battery measured full 42V, the display said it was empty. So I wired it up to a lab PSU that could provide no more than 400 mA at 42V. It did take current for some 10 minutes and then stopped, still showing empty battery. When we plugged the original charger the LED stayed green, meaning "it's charged".
I think the culprit now lies inside the heatsink box that holds the control board. It is glued to the chassis and it will be removed sooner or later, to have a look inside or to look for a replacement.
Wired-up for charging.

18 June 2020

Dentaku, a Japanese calculator museum (online)

I was looking for info on a quite old Toshiba calculator and Serge Devidts's CalcMuseum had no information about it. Instead I found some data and much more at Dentaku Museum.

The website is in Japanese and you will need the help of Google Translate to go past pictures, dates and prices in the text. There is a whole new world behind the language barrier.

I do not own enough calculators to open a whatsoever museum (23 items at the moment). I had planned to show them at work on my desk, but with the 2020 pandemic that idea has been put on hold.

10 June 2020

Melted XT60 in iWatRoad electric scooter

An dead-in-action electric scooter has been brought to my attention. It is an iWatRoad R9 eXtreme. After reaching a full stop, it shut down and did not move, nor power up again. Nice problem indeed!

Initially I suspected a failure in the one-and-only user interface control: a cheap push button. Too easy, wasn't that.

So I moved to the battery compartment under the footboard. Down there, waiting for me was the battery connector. An XT60 couple mated forever through overcurrent meltdown. Look at the picture! The red pole was moving towards the black one, leading to a big short and probably a fire.

Melted XT60 connector
Melted XT60!

The XT60 couple is not interrupted, but possibly the red wire was disconnected since I pulled it away with no force.

There is one interesting finding. The outer label says the battery is 42V 10.4Ah while the battery itself states 36V 7.8Ah. This means that one charge will last less km. Moreover, if both the scooter producer and the battery producer lied about the capacity, the real capacity might be even lower than 7.8Ah. Note that this iWatRoad R9 was bought in May 2019. Currently, June 2020, their website states the battery is 7.0Ah with 25 km.

External and battery labels don't match.
External label and battery label don't match.

Wait, now that I look closely at the outer label I see that the whole product is something else! It says "E Kick Scooter Model:9X" produced in 2018, distributor Floatup S.L. .What the ...?

04 June 2020

When you think you've got enough parts to complete a project

... and realize you ran out of IC sockets!

That is what happened when I started building the first display board (...clock...) with eight TIL308 displays. I had many sockets around but not enough with 16 pins. I know I can use pin headers but I would like to keep a consistent look. I had to desolder sockets from old boards I built 20+ years ago.

Nevermind, the display board is now alive. I ordered 5 of them from JLCPCB. I have used all I/O pins of Arduino Nano. While I wanted to be able to control the brightness of each digit, I had to resort to group them in couples. I will complete one board and see how it looks if some displays are left out: the two outermost, #3 and #6.

Because the lack of inputs I grouped together (in series) the incoming light detection (day/cloudy/night) with the user interface pushbutton and solve the puzzle in software. Another ADC-only input is for the linear potentiometer which will be used as in the 4x TIL311 clock board.

Hardware plans and firmware will be published on githib.

03 June 2020

NanoVNA as Frequency Counter

Disclaimer. This post describes a proof-of-concept experiment. It can damage your instrument(s). DO NOT replicate unless you fully understand all possible risks, both stated in this document and those not described. If in doubt, do not do it. I cannot be held responsible for any damage caused by attempting the theoretical procedure described below. That said, enjoy reading.

This post answers: "Can a NanoVNA (or a generic VNA) be used as a frequency counter?" Yes, with many quirks and don'ts! So, how?

Using both ports of the (Nano)VNA, we can see the transfer function of a device over a given range of frequencies. A signal is generated at Port 1, which we inject into the device under test, and we read the DUT output on Port 2. If DUT is a band-pass filter we should get the "hill" shape once we configure the VNA to display a trace in format "LINEAR".

In this configuration the VNA measures power at Port2 and shows the difference of Port2-Port1 versus frequency. So, if Port1 is terminated on the 50 ohm dummy load and we let Port2 pick whatever signal is coming from the air, the VNA almost becomes a spectrum analyzer. A pretty deaf one, but it sweeps over the set frequency range.

So, let's say you know more or less where your signal generator is (between 50 kHz and 300 MHz). You configure the VNA to display just one "LINEAR" trace and set the frequency range around the expected frequency. The displayed line should lay on the bottom of the screen because nothing is passing from Port1 to Port2. Now feed the unknown signal to Port2 (more later on how to do it): a peak will build on the line, and that's the frequency you are looking for. I suggest to zoom-in to get a more accurate measurement.

How to feed the signal to Port2? It depends on how powerful it is. My 5W HT could be picked without anything connected to Port2 at 1 metre distance. A weaker signal could be heard with a small wire acting like an antenna. A very weak signal could be fed through a pick-up loop. You would need to experiment and be careful not to fry your VNA input!

Or, better, get a frequency counter.

16 May 2020

Honey, I shrunk the loop

Like most amateur radio antennas, magnetic loop do not receive positive looks from relatives, neighbors and by-passers. My 20m magloop on the balcony could be seen by us and very few other people, but would still hurt the eye when looking out in that direction.

So, I shrunk the loop, from 2.3 m circumference to 1 m. Of course it now operates on a different frequency: 50 MHz. It has been chosen on purpose, since May and June are the Sporadic-E ("ES") season. Thanks to the lockdown and work-from-home situation I stand more chances to be in the shack when ES hits, unpredictable as usual.

I changed the tuning capacitor from an air variable to a RG-58 coax stub, meant to withstand higher voltage, thus input power. It did work on the 20 m loop, but it doesn't on 6 m.

This is what happens. On the VNA the antenna is perfectly matched. On the transceiver the SWR meter is happy.  Then, if you keep the key down, SWR increases to well over 10:1. On the 20m loop the stub tip would produce a bright white spark when I raised the RF power above 30-40W, which was solved by making a bit more space between the braid and the inner conductor. On 6m there was no spark: the RG58 stub would heat up and change the impedance.

IMPORTANT. How to check if it heats? Either use a thermal camera or touch the stub once that both these conditions are met: you have produced the SWR increase AND you have have switched off the transceiver completely (so that it doesn't transmit while you sense the temperature with your fingers).

This is a sign that the voltage at the open loop side is high, so the match is good. Also, being the circumference close to lambda/4, the efficiency is higher and the same holds true for the voltage.

The maximum power the loop can withstand depends on the environment temperature, but the heat produced with 5-10W is negligible and has no effect. At least at 20 °C!

14 May 2020

NanoVNA as Signal Generator

If you are in a hurry and need a quick & square wave signal between 50 kHz and 300 MHz the NanoVNA can come to the rescue. Just set the centre frequency of the stimulus at the value you need and a span of 0 Hz. The signal is then available at port 1.

Be very careful not to overload the output or feed a voltage/signal to it, else the NanoVNA would be damaged! If the procedure and implications are unclear to you, do not try it.

Why does it not work all the way to 900 or 1500 MHz? Because the NanoVNA(-H) uses some clever tricks using harmonics at frequencies above 300 MHz, but you always get the basic signal 0-300 MHz at port 1.

28 April 2020

Longer delay modification for TDL-2023 PIR sensor

I have a TDL-2023 pass-through motion activated sensor that turns on a device. While I have already set the delay to the maximum value with the internal trimmer, the advertised 360 seconds were not enough.

Click to zoom.
On the small board there is a BIS50001 IC, whose datasheet can be found online. The delay is set with an RC combination and can be seen on some schematic diagrams that use the same BIS50001 chip. Starting from the trimmer pins I poked around and found a series of 1 Mohm (trimmer) and 56 kohm (fixed resistor marked R0). Since I need a longer delay I decided to replace the fixed resistor with a larger value, 1 Mohm being probably enough.

Click to zoom.
The smallest resistor I could find is 1/4W but it fits into the case if installed as seen on my picture. The delay is now over 8 minutes. Since I have not been able to locate the capacitor of the delay circuit I cannot confirm the datasheet formula, but the ON time "feels" like twice as much as before.

25 April 2020

An update to my KiCAD library for obsolete LED

I got a new batch of old LED displays and before doing something with them I needed a KiCAD symbol and footprint.

So I added TIL308 and TIL309 to my KiCAD libraries. Also fixed TIL306 and TIL307 that were missing their respective symbols.

My KiCAD library of obsolete displays (Nixie, VFD, LED) is published on a github repository.

Meanwhile I confirm that TIL311 symbol and footprints are correct since I got PCBs, built them and I am enjoying the result.

24 April 2020

Blue dot and leg glow in Z520M Nixie

I love Nixie tubes, and I especially love round top-view ones. Perhaps that is because the first ones I bought were of this kind.

Lately I got one Z520M with the red coating quite damaged (pictures seem to make it look even worse!). Since the red coating can be restored/replicated, I proceeded to test the tube. I was not surprised to find out that it needs to be driven a bit harder than newer Nixies, both because this one is quite old and probably it has been used a lot.

Digits 0 to 2 were behaving normally. When pulling low other digit cathodes only the leg was glowing. If left ON for few minutes the glow transferred to the digit from the area close to the pin. Unfortunately if the digit is switched off for a while the malfunction comes up again the next time the same digit is lit.

Now that I own a variable HV power supply I could experiment with the current through the tube, and saw that the "leg" does not glow if the current flow is lowered closer to the datasheet value. Even 0.1 mA makes a difference. But then the digit is faint or not completely lit (like "5" and "7").

Since the red coating is cracked I could see through the plain glass and note that the leg glow releases the infamous blue dot. It is caused by mercury and overcurrent. Since it does not happen on digits 0-1-2 it could be just a deposit on unused digits/wires and might be cured throughout hours of operation of the same symbol. Perhaps. I will not go further and keep the tube as-is in the collection. (Or make a test harness where I can leave it running for days out of the way in the lab?)

Can you see the infamous blue light through the crack in the coating?

16 April 2020

TTL integrated circuits "collection"

Not a real lockdown project, I tried to organize my "collection" of TTL integrated circuits. These have been piled up in numerical order to ease a future search for a specific part. The picture shows all of them and it is posted here for my own future reference.

I thought I had more laying around, actually. The 74(1)41 Nixie driver are not amongst them because they are the only 74-series ICs that I still use.

At least now I have a group picture in case I (or someone else) need one of these, or I really run out of interesting projects and start designing something out of them.

15 April 2020

Another HV DC power supply

DISCLAIMER. This "project" handles lethal voltages and currents. Do NOT replicate. I take no responsibility for any damage that might occur from replicating or imitating what is illustrated below.

Having lots of time to spend at home to do "whateveryouwant", I started to clean the lab: move stuff around, make room on the desk, prepare a trip to the recycling facility, see stuff under a different light.

I happen to have two 12V power supplies from 1980's, when heavy transformers were dominating the scene and guaranteed RF silence. The first purchase was 12V/2A, then upgraded to 12V/5A (not that I cared about RF noise back then in my CB years!).

Both power supplies, as of April 2020.
They took space in the lab, one partially broke, one was recently upgraded with a step-down converter in place of 7812 so, as the headline suggests, I made a high-voltage DC power supply out of them.

What was (left) inside. Dust included.

D-C rectifier and back2back trafo.
How? I wired the two transformers back-to-back and rectified the AC output. Bonus, since transformers were both centre-tapped, I can select two outputs just by switching the intermediate connection: 170V or 340V. And both transformers fit into one original case!

According to transformer ratings I should be able to draw about 100-120 mA at 170V and half of that at 340V. Then the voltage drops, transformers vibrate and overheat.

The transformer receiving the mains is the bulkier one, from the former 12V/5A PSU, so there is some room for a low voltage output with decent current.

Final look, with HV output yellow/black.
Needed improvements:
  • fuse the AC input
  • fuse the HV output
  • add a damping resistor on the HV output
  • attach the HV output selection switch to the case 
  • add a status LED/lamp
  • add the low voltage output circuit
Unloaded 340V.
Unloaded 170V.

13 April 2020

Cleverly hidden reset button

Like many people involved in COVID-19 lockdown, I am using the opportunity to tidy up home and reorganize things. Something that popped up was a couple of tiny mp3 players/radio/voice recorders, size roughly 4x5 cm.

One of them was "fat", an obvious sign to the trained eye that the Lithium-based battery inside has gone bad. So .... an excellent candidate for looking inside! The second specimen does not hold the charge, so I think it is going down the same road of its brother.

I didn't expect fancy technology, and I was surprised I could read markings on ICs: (RDA)5807M I2C FM radio and AK2117C "Artek Digital Multimedia Chip" (an 8051-like MCU with multimedia I/O).

While looking around the board I noticed a strange "white" component behind the 3.5 mm audio socket. Looking closer I saw that it is a pushbutton! That's why in the picture there is a small screwdriver stuffed into the audio socket.

I tried to push it on the still-intact yellow player and it seems to act as cold reset button. Probably it works for something else too, like triggering firmware update, but I don't really care.

Still, that button has been hidden in a very smart way!

By the way, the RDA5807M chip tunes from 50 to 150 MHz WBFM!

01 April 2020

High voltage DC power supply

Most hobbyist electronic labs are equipped with a variable voltage power supply of some kind. It could be a benchtop commercial box, a modified AT PC PSU, a variable step-down circuit on the output of a 20-30V upcycled (laptop) power supply.

At some point I realised I was missing an important power source for my never ending learning experiments: a variable high-voltage DC power supply. I mean something that would output as much as 300Vdc regulated (I've build it with a switcher, with back-to-back transformers and voltage multiplier) and high current, possibly limited (neither easy nor cheap).

Not long ago in the neonixie mailing list someone mentioned buying a second-hand electrophoresis power supply. A quick check on eBay showed it would cost me 60-100€ for a device capable of 300V and few hundred mA. Unfortunately all of them are in USA or in UK, with large shipping cost. I think there is very little Italian second-hand market for these devices because professional labs need lots of certifications etc etc and probably rent/lease them.

So I patiently waited for something in Italy to be sold online and before the COVID-19 lockdown I bought a second-hand Bio Rad Power-Pac 300: a whopping maximum of 300Vdc at 400mA, digitally controlled.

The power supply at 300 V output between older devices. The Philips DM needs calibration...

The voltage regulation goes from 10 to 300V, while the current can be limited between 5 and 400 mA. Or vice-versa. The only drawback is a minimum load of 4 mA regardless the output voltage, that I can overcome inserting a fixed resistor in one of the 4 parallel outputs.

With 400 mA available I can power a lot of Nixie tubes and valve-based equipment. Or experiment the beauties of electrophoresis!

27 March 2020

Texas Instruments TI-1500

What I found!!
Texas Instruments TI-1500, that's the third calculator I bought at "Barattolo" flea market in Torino. This one was also battery-heavy, with LED display. There were several versions of TI-1500 back in its days, but I think they all share an enclosed rechargeable battery pack. Mine had two Ni-Cd AA that had gone bad. Quite bad, actually.

The leak has spread almost everywhere on the board leaving intact the display (looks good at visual inspection) and probably the keypad (cannot inspected, but the back is clean).

Without batteries.
After removing the batteries I have cleaned the board with white vinaiger and then water. Since the keypad is blocked to the top shell of the calculator, I had to wash it trying to keep water away from it. Also on one side of the top shell the leak had sneaked under the silver coating and water+vinaiger effect broke it from the inside. This is becoming challenging.

I left it dry on the radiator and tried a power up with an external 2.4V power source. Well, the display showed something but no reaction to keypresses.

I've got too many open projects to take properly care of this calculator. It could stay as is, or it could become a sort of numeric display/clock, as usual.

25 March 2020

Canon Palmtronic 8M

Palmtronic LD-8M 3
After the Litronix 2235, I found a "Canon PALMTRONIC LD-8M 3". That is what tells the battery cover in the back. This calculator was being sold without batteries and with the faux-leather soft case.

After the routine cleaning and some action on the power button, it comfortably showed "0" in the rightmost position.

This is a basic calculator with square root, percent and memory.

Buttons feel OK and don't bounce causing typing errors.

Calculator and soft case.
Battery cover with "LD-8M 3".

Now I own two working Canon Palmtronics, the first being a LD-84. Both came without battery damage. A curious coincidence.

Negative number.

24 March 2020

Let it loop

Being in COVID-19 lockdown gives me the opportunity to be on the air during the day, once work time is over. I tried a magmount 20m Diamond mobile antenna on the East-facing balcony, but I managed one contact with my sloppy CW. Well, RBN receivers had me around Europe. But no contacts were possible in PSK31, neither a report on pskreporter service!

So I moved to something different: a magnetic loop. It had to be build with readily available materials: a hula-loop diameter 70 cm (then not needed to keep it in shape), 4 mm solid coax cable (it's too thin for a permanent loop!), a dual-gang air variable capacitor (two sections in series giving 10-130 pF) and FT817 to tune the antenna sur place.

The feeding loop is just a piece of coax "1/5th of the main loop" long. From the coaxial line, the center goes to braid of the small loop on one side, and the coax braid to the braid on the other side. In other words the feedline is terminated with a 44 cm long loop made of thick wire.

It took me a couple of hours to build. Most of the time was spent looking and implementing a solid mechanical solution for the variable capacitor.

The picture shows the resulting loop. It tunes 30 to 10m. On 20m it is about 20 kHz wide for 2 SWR bars on the FT817.

11 March 2020

Litronix 2235

Litronix 2235.
I had the opportunity to visit Torino's flea market "Barattolo", that is (currently) held every Saturday and Sunday. This is where you can find the cheapest used garbage things. It is not as large as Hrelic in Zagreb, but it shares the same philosophy.

I did not have much time and it was almost time to pack up for everyone. Nevertheless I could find three 1970's pocket calculators, which required a bit of successful price negotiation.

How I got it.
First in the blog show is Litronix 2235 with very curious LED display from 1975.

It felt heavy, a sign that batteries were inside but it did not switch on. Good cosmetic conditions, though. When I removed the battery compartment lid, I saw a little horror show (see picture). One AA battery had even cracked! Nevermind, that is the kind of trouble that I am looking for.

Fresh batteries!
Fortunately the leak had not spread to the circuit, probably because both of the position of batteries within the case and how it was stored. The worst block of salt was on a removable part, that had a bath into pure white (apple) vinegar and a was under tap water. All within 10 minutes time. The plating is now gone, but contact is restored.

Three AA batteries later the Litronix 2235 LED display said hello. It is an 8 digit calculator, but it has a 9-digit display. That's because a decimal point is shown in the position of a digit instead of being subscript intra-digit. What makes it even more peculiar is a dim LED showing that there is Memory content in the upper-left corner of the display.

The LED display. Can you see the small dot in upper-left corner?

27 February 2020

DOS saves - A tale of retrocomputing

It is early 2020 AD and I am developing some Arduino firmware for a friend. I chose Arduino for several reasons, one of them is that the friend in his 70's can program Arduino clones using a legacy PC that runs Windows XP. You know, HAM and electronics enthusiasts have a bunch of equipment that requires software/drivers that have never been updated/ported to newer operating systems: so why change it, when it works?!

My computer runs a supported Ubuntu distribution and the latest Arduino IDE. Actually our Arduino IDEs are not too far apart version-wise, so I started sending him updated .ino source code.

First problems appeared with I2C LCD driver libraries that misbehaved: there are too many with the same name and you can't know which one is being used at compile time. This forced me to find an I2C LCD library with a different name than LiquidCrystal_I2C, which is actually better than others:

#include <hd44780&.h> // main hd44780 header
#include <hd44780ioclass/hd44780_i2cexp.h> // i2c expander i/o class header

This solved it, but the same firmware worked differently on his hardware than mine. What broke was a function that picks a random value and looks it up in a static table, which went out of bounds. This happened at the second iteration of the main loop() and then the firmware basically crashed.

Since it didn't happen on my side, one solution was to send him the compiled firmware (.hex) and burn that directly. It is fairly easy: have Arduino IDE print out the avrdude programmer command and replay it with the .hex that you want to load. I planned to do it over TeamViewer, as I had done few years ago.

Second problem: his WinXP has TeamViewer 10 and cannot be upgraded, while on my Ubuntu I got TeamViewer 15. They don't talk to each other. Fair enough. TeamViewer guys let you download old versions (excellent!), so I installed 10 on my Ubuntu, but it still refused to connect. No time to troubleshoot that, so I switched to Plan B which required a bit of preparation: blindly write down the instructions and have my friend do it without my real-time assistance.

Once I got from him the complete avrdude command (in form of screenshots because you cannot copy the debug output in Arduino IDE!), I needed the safest way to get him on the right track. Consider that I do not have a Windows machine to try the procedure beforehand.

So, I produced a DOS batch file hoping that the Arduino board would end up always on the same COM port. The simplest thing was to put everything in C:\ so to avoid long paths. A .bat file cannot be sent over email, so it was a .txt then renamed. Once I explained to click on the batch file, nothing happened: the DOS window just flicked quickly. I needed to see the error message.

We worked out together an old DOS trick: pause the execution of the batch. He remembered the right command was "pause", so he did everything on his own to edit the file, rename and run again. I could now see (a screenshot) that I had misread an avrdude flag in "1" rather than "i". So, one more edit and run and .... mission accomplished! DOS saved us.

Even better, he managed to program a second Nano board that ends up on COM10 simply editing the batch file.

My binary firmware works as expected on his hardware, no more array out-of-bound and firmware crashes. His Arduino installation probably has stale libraries or doesn't work properly on the experimental now-dead WinXP 64 bit.

For the next updates I will send him the .hex microcode and all will be fine. And if something else goes wrong, there is always DOS!

11 February 2020

TIL311 clock and fun KiCad project

PCB travel box :)
While in the past I tried (and not documented) to wire four TIL311 displays on perfboard, I quickly realized the project would need too much wiring to be fun and relaxing. Fast forward a couple of years and a positive experience of PCB design with KiCad, I decided to refresh the whole process.

PCB under vacuum
This time I would design a PCB composed of two detachable parts: one with the logic and another with the display. This way I can choose between two physical layouts and reuse the logic board for other projects, provided a new display or daughter board is designed.

Few requirements for the logic board in order to exploit TIL311 peculiarities:
  • per-digit independent dimming control (needs PWM outputs),
  • per-digit latch control (obviously),
  • common BCD DCBA bus to all displays,
  • independent LED voltage vs logic voltage (to reduce heat generation and thermal stress on TIL311),
  • free form management of embedded decimal points (provide pads on PCB, wire later).
 Further on, from my previous experience as clock builder:
  • interface to common I2C RTC board
  • interrupt driven time base,
  • build-time choice of 1 pps or 32 kHz interrupt from RTC
  • LDR for dimming
  • button + potentiometer to handle user interaction

Click and zoom for details.
This time I ordered 10x PCBs from JLCPCB.com . I chose black finish because I think it matches best the red-purplish displays. I did a DIY panelisation in the sense that I drew a line where it should be cut, and I do it with a cutter if needed. They arrived in a sturdy cardboard box. Click and zoom in the picture to see how the small font has been printed.

And here it is, #1 clock resulting from this project. It turns out that the RTC module doubles as a standoff, so the whole thing stays upright in a nice-looking position for a desk.

A 4x TIL311 clock with Arduino Nano.

10 February 2020

Sostituzione pistoni a gas sul pensile della cucina

Nel 2008 ho comprato una cucina con due pensili in vetro/alluminio con apertura a vela, sostenuti con un meccanismo a pistoncini a gas: lo scolapiatti (90 x 70 cm) e sopra i fornelli (90 x 62 cm). Nel giro di tre anni i pistoni si sono scaricati ed ho provveduto alla sostituzione. Passano altri tre anni e di nuovo, i pensili non stanno su. Altra sostituzione, questa volta con pistoncini Effegi Brevetti Stabilus Lift-o-Mat 6011SE da 450N contro i 350N originali (stesso produttore). Questi durano 4 anni sullo scolapiatti, ma alla fine cedono.

Siamo nel 2020. Già da tempo ho maturato l'idea di sostituire le molle a gas con qualcosa più moderno, dato che le stesse case produttrici non li usano più dal 2008-2009! Faccio un breve giro in mobilificio per curiosare cosa montano, salvo scoprire che non sembrano più fare pensili così grossi con anta unica.

Non importa, insisto e scopro il catalogo della Blum. Hanno meccanismi per aperture di tutti i tipi e tutti i pesi, incluse le mie vele da 8.5 kg! Studio il catalogo, capisco i pezzi che servono ed arrivo a queste cifre:
  • due coppie di pistoncini Stabilus Lift-O-Mat, 50€/coppia, totale 100€
  • meccanismo completo Blum (molla, bracci, ancoraggio anta), totale 204€
Il meccanismo Blum Aventos HS consente inoltre di fermare l'anta a mezz'aria (una volta regolato), cosa non possibile con il meccanismo originale.

Non avendo intenzione di cambiare cucina a breve, ho scelto di spendere il doppio e liberarmi del patema di ottimizzare le aperture delle vele per ridurre i cicli. E divertirmi con un po' di sano bricolage da raccontare agli amici. Senza contare che i pistoni a gas sono sempre più merce rara.

Ho fatto il lavoro in autonomia e senza smontare il pensile dal muro. L'anta ovviamente deve essere rimossa (in due persone!), va fatto qualche foro con attenzione, ma soprattutto ci si può liberare dei pistoncini a gas!!

Le foto mostrano l'interno del pensile prima e dopo l'intervento. Ci tengo a precisare che sono semplicemente un cliente soddisfatto e non ho avuto contatti con la casa austriaca. I pezzi Blum li ho comprati online, in Sicilia. Lascio a voi individuare la casa produttrice della cucina.

Prima, il "peccato originale" della casa.

Dopo, meccanismo Blum.

Cortesemente lasciate un commento se questo post vi è tornato utile, perché in rete non ho trovato praticamente nessun riferimento ad interventi come questo: ho avuto solo io il problema, o nessuno ha condiviso?

21 January 2020

Arduino Nano has no INPUT_PULLUP on A6 and A7

I discovered it the hard way: Arduino Nano has no INPUT_PULLUP on A6 and A7. That's because the ATmega328 in tiny SMD package has two extra pins (vs. the DIP processor), which are tied directly to the A/D converter MUX without the digital I/O logic.

I discovered it once I received and assembled PCBs for a TIL311-based clock, where I used most - if not all - I/O and analog functions were left to "pure analog input" pins A6 and A7.

Well, wiring an LDR between A6 and ground lead no readings. Few measurements later, and a quick Internet search, revealed this hard truth.

Fortunately I have an easily accessible 5V point near A6, so I could throw an external pull-up resistor.

14 January 2020

Voltage multiplier

It is all right at IK1ZYW's Labs, it's just that I had no opportunity to update the blog.

Last experiment has been a voltage multiplier as Cockcroft-Walton designed it in mid 1930's. Why? Apart my quest for a HV PSU (in the order of 300 Vdc), Xmas lights came with powerful 24 Vac 20VA transformers that should be enough to power some Nixies, once voltage-multiplied.

The hardest part has been to locate high value capacitors with high voltage rating in and around the junk box. While 2-300V rating is not hard to come by, the high capacitance is required in order to keep low its AC resistance at 50 Hz. Diodes need to sustain at least 60V reverse polarity, so 1N4003 and above.

I started with 220 uF capacitor, but it got too warm. Then I replaced it with 2200uF 63V in the first stage and everything got better. With 4 diodes I reached more than 160 Vdc which happily light up an IN-14 Nixie without dropping more than a Volt.

Nice experiment so far. A final circuit would allow to pick different output voltages stepped at (24*1,41) Volts, which can be useful.

Or just put back-to-back two of these transformers, rectify the output and find a way to drop it to the desired value. Thinking ...