Arduino thermometer using DS18B20 and OLED display

This article describes a Arduino based thermometer using a 1-wire DS18B20 digital temperature sensor using a SDD1306 or SH1106 OLED display.

The DS18B20 is a digital sensor, used for relative noise immunity, especially given the choice of an OLED display.

This is a basis for tinkering, for modification and a vehicle for learning.

Above is the sample display.

The code is written to support multiple sensors on the 1-wire bus, it cycles through each of the sensors displaying them for 1s each. Continue reading Arduino thermometer using DS18B20 and OLED display

ISP programming of the (tr)uSDX – more on SPI

ISP programming of the (tr)uSDX (trusdx) showed that filtering on the MOSI pin in that kit distorted the MOSI signal significantly and suggested a workaround (reducing SCK rate) for reliable programming.

Some correspondence prompts a little more information on the nature of the ATmega328P ISCP signals.

The line protocol used is actually SPI, quite a common protocol.

ISP uses SPI MODE 0 (CPOL=0, CPHA=0), shift out on the falling edge of SCK, and capture input on the rising edge.

Let’s look at a three channel capture of SCK, MOSI and MISO of a AVRDUDE / USBasp driving an Arduino Nano.

The capture shows SCK at around 750kHz rate, the default (-B1) rate for AVRDUDE in this setup. Continue reading ISP programming of the (tr)uSDX – more on SPI

(tr)uSDX – review of the directional coupler ADC design

I noted some online discussions where some people had troubles with the displayed forward and reverse RF power  values, and the calculated SWR.

Some of the reports indicate non-zero RF power values displayed when the transmitter is off, symptoms which direct diagnosis in the first instance to review of the ADC input circuit.

This article reviews the hardware design based on documents as published at the date of this article.

ATmega328P datasheet

Let’s start by reviewing some relevant parts of the ATmega328P datasheet.

Above is a simplified schematic of the ADC pin input circuit. Note the current sources IIH and IIL. Continue reading (tr)uSDX – review of the directional coupler ADC design

USBasp – hints

The USBasp is a really useful and quit inexpensive ISP programmer that suits AVR 8 bit microcontrollers.

This article offers some hints on buying and using the USBasp.

There are lots of sellers of these on eBay, Aliexpress etc… but there are traps in buying them. I recall buying the USBasp with cable for less than $5, but they are more like double that now… or more

The adapters with the pogo pins are simply ordinary adapters with P75-xxx (eg P75-LM2) pogo pins inserted. Continue reading USBasp – hints

ISP programming of the (tr)uSDX

I noted some online discussions where some people had troubles using an ISP programmer to program the MCU.

I do not have a (tr)uSDX (trusdx), but inspection of the schematic does hint what those users are doing wrong.

Loading the SCK, MOSI and MISO lines risks problems with operation of the SPI protocol used, but the effect depends to some extent on the driver, length and type of interconnecting cable etc.

Here are some measurements of a USBasp driving an Arduino board with 5V Atmega328P 16MHz chip using about 200mm of ribbon cable… AND the MOSI line is loaded with a 0.01µF capacitor (as in the (tr)uSDX schematic).

As mentioned, ISCP uses an SPI protocol and the capture above uses blue for SCK and cyan for MOSI. Continue reading ISP programming of the (tr)uSDX

BME280 vs BMP280

Several of my projects use Bosch BME280 sensor chips for measuring temperature, pressure and humidity.

Some correspondents have expressed problems using BME280 modules that they bought online, and it is usually because they have been cheated by online sellers misrepresenting BMP280 as BME280.

My projects that include code to initialise and read BME280  humidity will fail on a BMP280… check to see if the humidity results returned look sane. A driver may read the ChipID and fault on the ID returned by a BMP280.

The Bosch chips are usually visually different, and most clones likewise.

BME280 – temperature pressure and humidity sensor.

Above, the BME280 is a small square package, about 2.5mm each side. Continue reading BME280 vs BMP280

ESP8266 IoT BME280 temperature, humidity and pressure – 06/2021 update

ESP8266 IoT BME280 temperature, humidity and pressure described an IoT project. This article documents an update for newer nodemcu core (NodeMCU 3.0.0.0) and the revised support for BME280 (the older method having been deprecated).

This project is based on ESP8266 IoT DHT22 temperature and humidity – evolution 3, but uses the Bosch BME280 temperature, humidity and pressure sensor. The BME280 has been around for a couple of years, though recently, modules using the chip have become more expensive on eBay, around $10. If you find BME280s listed for much less than that, it is probably Chinese cheats doing a bait and switch… delivering BMP280 (pressure only). Continue reading ESP8266 IoT BME280 temperature, humidity and pressure – 06/2021 update

PERL vs Python pre / post processing NEC

I have used PERL to script NEC runs, and then to read the huge volume of output to produce simpler summary tables. This has provided facility to run a very large number of models with some variation in one or more model parameters. One of the early published web articles was Feeding a G5RV published in 2005, but I had been using PERL for that purpose for quite some time before that, and in my ‘day job’ since early 1990s. Ham projects led to development of some application specific libraries to model transmission lines and ATUs.

Like PERL, Python had its origins in the late 1980s, but it has really only come of age in recent years with the release of v3. Python appears running on all sorts of things from microcontrollers up, and is probably the most popular scripting language today. Continue reading PERL vs Python pre / post processing NEC

Windows 10 – sound device Signal Enhancements

Recent versions of Windows 10 have made changes to some audio input processing.

Above is a screenshot of a Microphone Properties window, and attention is drawn to the section highlighted in pink which may appear in some devices.

The Signal Enhancements would appear to introduce certain non-linear behaviour.

I preface this with saying the ‘enhancements’ are probably hardware dependent (ie the chipset used and driver capability) but may also include Windows core, and this report applies to my specific configuration but hints issues that may be systemic.

That said, I performed a simple test switching an audio sine generator between two close frequencies and observed the level vs time in SpectrumLab.

The lower part of the screen is with ‘enhancement’ ON, the only change in the upper part is with ‘enhancement’ OFF. Continue reading Windows 10 – sound device Signal Enhancements

Leaflet / OpenStreetMap map rendering on devices with tiny pixels

I wrote an application that presents maps on a webpage using Leaflet and OpenStreetMaps, and some readers commented that the text was hard to read on their devices.

It turns out that this issue seems present on devices with high resolution small screen (ie high pixels/mm or small pixel size).

The reports raise the question of whether it is the compatibility of the device and the user’s Visual Accuity (VA).

VA is often assessed on the familiar Snellen chart which has characters of a 5×5 grid and normal vision is indicated by reading characters that subtend 5 minutes of arc (MOA), or 1MOA for each ‘pixel’ (px).

An example phone screen calculation

My Huawei dub-lx2 has a screen height of 1520 px and 144mm, so the px size is 95µm. Keep in mind that the size of this pic may be much smaller on the phone that on your viewing device. Continue reading Leaflet / OpenStreetMap map rendering on devices with tiny pixels