ISP adapter for Arduino Pro Micro

I have started using Arduino Pro Micros recently, and sourced inexpensive clones from China.

Experience is that all manner of inexpensive small microcontroller modules from China are likely to have issues with the bootloader: it isn’t there, it is back level, not suited to the actual clock speed.

I have come to routinely install a current / known / working bootloader to avoid wasting time down the track.

The Pro Micro does not have an ISP header, and the QFN package does not suit a chip adapter, so the next option is an adapter that can connect to the board with no pins, male or female headers, top or bottom.

Above is an adapter built on a small piece of Veroboard. If you are ging to copy it, make it one row of holes higher. I did initially, and in a miscount of rows, I incorrectly removed the top row. The black mark identifies the USB end of the Pro Micro, and the adapter connects to the side with the /RST pin. Continue reading ISP adapter for Arduino Pro Micro

Yet another change of Internet broadband access

We have had wired broadband service delivered to these premises for almost ten years, supplied by three vendors: Telstra Bigpond, iiNet, Amaysim, Southern Phone and now Exetel.

Download speed

Download speed is an important performance characteristic, and fairly quantifying it is a challenge.

If I were to express my service expectation as “I want it to deliver most of the rated speed, most of the time during the hours that I want to use it” we can express that by better defining the three terms:

  • most of the rated speed;
  • most of the time; and
  • the hours that I want to use it.

Most of the rated speed

Let’s consider that most means 80%, so the critical value of speed is 80% of the rated speed, eg 80% of 12Mb/s is 9.6Mb/s.

Most of the time

Let’s consider that most means 80%, so the critical value is 80% of the time.

During the hours that I want to use it

I sleep at nights, and use the Internet variously during the day, the most important times for service to be adequate are from 06:00 to 20:00.

Critical speed requirement

Capturing the foregoing, I could write “Download speed must exceed 80% of the rated speed, 80% of the time between the hours of 06:00 and 20:00” each week.

This is known as a Service Level specification.

Statistically, this is stated as the 20 percentile speed measured between 06:00 and 22:00 over a week must be greater than 80% of the rated speed.

Test results

A realistic simple HTTP download is scheduled every half hour, and the effective download speed is recorded. This data has been gathered for many years.

Over the nearly 10 years of service, the rated speed has varied, 8, 12, and 50Mb/s at different times. To compare these, the speed in any one observation needs to be normalised to the applicable rated speed, so for this purpose speed is calculated as a percentage of the applicable rated speed.

Telstra

Above is a plot of the measured speed over a period of many years. Continue reading Yet another change of Internet broadband access

IoT – exploration of LoRa – part 3

This series documents a set of experiments to explore LoRa for a telemetry application. Note this is simple multipoint to point LoRa, it does not use LoRaWAN.

IoT – exploration of LoRa – part 1 outlined a simple direct RESTful submission to Thingspeak from the LoRa – Wifi gateway.

IoT – exploration of LoRa – part 2 outlined a simple RESTful submission to Node-Red from the LoRa – Wifi gateway.

This article describes a direct MQTT submission from the gateway. In this case the gateway converts the binary LoRa payload into more friendly MQTT key,value pairs.

The block diagram above shows the information flow between the main elements. Continue reading IoT – exploration of LoRa – part 3

IoT – exploration of LoRa – part 2

This series documents a set of experiments to explore LoRa for a telemetry application. Note this is simple multipoint to point LoRa, it does not use LoRaWAN.

IoT – exploration of LoRa – part 1 outlined a simple direct RESTful submission to Thingspeak from the LoRa – Wifi gateway.

This article introduces an intermediate flexible and extensible Node-Red flow.

The block diagram above shows the information flow between the main elements. Continue reading IoT – exploration of LoRa – part 2

RFPM2 – calibration files

The RF Power Meter 2 (RFPM2) stores calibration constants in a file located in the (SPIFFS) file system in the microcontroller flash.

The file opened by default when RFPM2 starts is /default.cfg, the following is an example.

{
"name":"dBm",
"hostname":"rfpm201",
"vref":3.3,
"avg":3,
"slope":0.12991,
"intercept":-91.406,
"unit":"dBm",
"lcdfsd":16
}

The parameters above capture the most basic operation of RFPM2 as a power meter directly displaying dBm with bar graph in fixed 2dB increments to 16dBm FSD. These values serve as a basis for some other applications as they capture the basic intercept and slope of the AD8307 module in this instance.

Current probe calibration

Alternative config files can be loaded on the fly from the webserver interface, for example http://192.168.0.86/config?filename=/dBA.cfg will load the dBA config file for a certain current probe. Continue reading RFPM2 – calibration files

RFPM2 – calibration

The RF Power Meter 2 (RFPM2) stores calibration constants in a file located in the (SPIFFS) file system in the microcontroller flash.

The WiFi credentials are stored separately at the default location in the flash.

Calibration constants

The AD8307 outputs a voltage from zero to about 3V for inputs from around -90 to +15dBm. The nominal output has a slope of 25mV/dB and intercept of -84dBm.

A starting point for RFPM2 calibration constants is intercept=-84 and slope=0.129.

Modules such as that used here may have pots to adjust the gain and offset of the output. Adjust the gain so that the maximum output voltage is a little lower than 3.3V (the maximum ADC input), say 2.7V.

Clip 194

The response of the AD8397 has some ripple in the transition between log amp stages. The log cell ranges are 14.3dB, so min error repeats every 14.3dB. My own practice is to calibrate at -62 and -5dBm input as they fall approximately on the mid line of the ripple trend (4 cycles of the error curve). Continue reading RFPM2 – calibration

RFPM2 – current probe

This article describes a current probe for use with a power meter calibrated in dBm (eg RFPM1 and RFPM2).

For use with RFPM1 and RFPM2, both of which read to 16dBm max, it is convenient that the scaling factor for the probe is 0dBA/dBm, ie that those meters read dBA directly, implying a current range of -75-16dBA or 0.186mA-6.3A.

The probe comprises a ferrite cored transformer that is clamped or placed over the conductor(s) of interest, and uses a 10t secondary which has a low value resistive load, across which the power meter connects.

Above is a screen shot of a spreadsheet calculation of relevant design values. Continue reading RFPM2 – current probe

RF Power Meter 2 (RFPM2)

The RF Power Meter 2 is a development based on the utility of  RFPM1, but it shares nothing with the RFPM1, save using an AD8307 as the sense module.

Design criteria

The design criteria are:

  • small, portable, battery powered;
  • direct reading dB scale;
  • flexibility for a range of adapters to measure power, current etc;
  • local display including bar graph, time, and dB value;
  • log measurements to a serial port of some kind;
  • offer remote access for recent measurement log.

Design outline

The RFPM2 uses an AD8307 log power detector to obtain a analogue ‘DC’ voltage proportional to the log of the input power. The input port is 50Ω SMA, and accommodates from about -75dBm (the noise floor) to +15dBm.

The analogue output of the AD8307 is digitised on a microcontroller board, a NodeMCU which uses an ESP8266 processor with integral WiFi. The board also contains a CP210x USB to serial adapter for programming, power, and serial logging.

The display is deliberately generic, the units are dBm at the SMA input, but they could be dBA with a suitable current probe, or +xx dBV/m with a field strength sense antenna. Continue reading RF Power Meter 2 (RFPM2)

Should you trust your VSWR meter – linearisation

Should you trust your VSWR meter? asked an interesting question, and Should you trust your VSWR meter – detector linearity discussed a problem apparent in may VSWR meters.

This article illustrates one method of linearisation of the detector response of a practical VSWR meter.

Radio-kits SWR meter

This article contains an analysis of the analogue circuitry of the Radio-kits SWR meter.

The directional coupler at top left contains half wave peak detectors for forward and reflected waves. They are wired to the two compensated op amps at lower right (the connections are not shown on the circuit as the coupler may be remote, follow the terminal designations). Continue reading Should you trust your VSWR meter – linearisation