Procedure to produce small batches of devices

Over the past years, I’ve designed and built devices in small batches such as 10-25 units at a time. I’ve gained some experience doing such small builds. The following is a procedure for building a small batch SDI-12 + Analog USB devices.

The device has a USB serial converter IC FT232RL, an MCU ATMEGA328P (same as Arduino Uno’s MCU), an ADS1115 16-bit analog-to-digital converter, precision resistors, fuse, screw terminal blocks, jumpers etc.

I build the device first by reflow soldering the surface components, and then hand solder the thru-hole components once I’m done confirming the reflow soldered components are working. You’ll see why these devices can’t be sold at $4 a piece, not just because the components cost more from legitimate vendors such as digikey, Mouser, Newark, etc. Most of the steps can’t be completed by someone without proper training of what the device does.

Here it goes. Any recommendation? Post a response!

Manufacturing and inspection procedure

Date: 2016-11-23

1.    Preparation and printing solder paste:

  1. Remove solder paste from refrigerator and set it in room temperature for one hour.
  2. Clean board with alcohol and lint-free wipe.
  3. Visually inspect board for defects and reject boards with visual defects.
  4. Align board with stencil.
  5. Print solder paste.
  6. Check registration especially for ADC, MCU and FTDI chips. Reprint in case registration is too far off.
  7. Wash and dry stencil.
  8. Return solder paste to refrigerator.


2.    Components placement:

  1. Place MCU. Check alignment with 3X loupe.
  2. Place FTDI chip. Check alignment with 3X or 10X loupe.
  3. Place ADC. Check alignment with 10X loupe.
  4. Place (5) 100nF caps.
  5. Place (1) 10uF cap.
  6. Place (2) 22pF caps.
  7. Place (1) fuse.
  8. Place (1) EMI bead.
  9. Place (3) 10K resistors.
  10. Place (1) 100K resistor.
  11. Place (4) 1K precision resistors.
  12. Place (4) 10K precision resistors.
  13. Place (1) crystal.
  14. Place (1) mini-USB connector.
  15. Check resistor values with loupe. Replace wrong resistors.


3.    Reflow soldering:

  1. Place boards on reflow over racks.
  2. Attach thermal couple to a plated hole on one board.
  3. Turn on temperature gauge.
  4. Connector reflow oven to power.
  5. Follow reflow specifics, make sure to time each step with stopwatches. STOP if expected temperature is not reached within expected time.
  6. Disconnect reflow over from power.
  7. Remove boards and cool them off.


4.    Visual inspection:

  1. Visually check for solder issues on chip resistors, caps and other components.
  2. Check for solder bridges on ICs with a 10X loupe.
  3. Check USB connector for bridges.

Found any issues?

  • Y: fix with flux paste, solder braid, and iron
  • N: proceed


5.    Flash firmware:

  1. Connector programmer to PC.
  2. Place board on pogo pins.

Programmer detected board?

  • Y: flash firmware

MCU detected after flash?

  • Y: proceed
  • N: check soldering near XTAL pins
  • N: inspect MCU for solder issues and other issues (IC in wrong orientation etc.). Add flux paste and reflow pins.


6.    USB connection and initial ADC check:

  1. Connect board to PC.

USB port detected?

  • Y: proceed

Device responding to ID command?

  • Y: proceed
  • N: check MCU and FTDI chip for solder issues

Device returning analog measurements?

  • Y: proceed
  • N: check ADC and MCU I2C pins for solder issues
  • N: inspect connector and FTDI chip for solder issues


7.    Check ADC and resistors:

  1. Solder headers and connectors.
  2. Connect different resisters to analog pins.
  3. Set HIGH jumpers on all channels.
  4. Read single-ended inputs.

Results are as expected?

Command ‘zI!’ should return ‘z13Liudr   SDITRD130\r\n’. Command ‘zM!’ should return ‘z0014\r\nz\r\n’. Then command ‘zD0!’ should return ‘z+0.xxxxx+0.xxxxx+0.xxxxx+0.xxxxx ‘ where x is arbitrary but the first x in each number is unlikely going to change if you poll again. Command ‘zM1!’ should return ‘z0012\r\nz\r\n’. Then command ‘zD0!’ should return ‘z+0.000xx+0.000xx ‘ where x is arbitrary and positive signs may be negative signs at times but both values should be very small with at least 3 zeros after decimal.

  • Y: proceed
  • N: check resistors and ADC for solder issue


  1. Set LOW jumpers on all channels.
  2. Read single-ended inputs.

Results are as expected?

  • Y: proceed
  • N: check resistors and ADC for solder issue


8.    Check SDI-12 bus:

  1. Connect SDI-12 sensor to one SDI-12 terminal.
  2. Poll SDI-12 sensor.

Does sensor return values?

Command ‘1M!’ should return ‘10012\r\n1\r\n’ Then command ‘1D0!’ should return ‘1+1.xx+2x.x’ where x is arbitrary but unlikely to change if you poll again. The second number is temperature so indoor reading should be above 20.0 C.

  • Y: Device passed QC test J
  • N: check MCU SDI-12 bus pin for solder issues

Teaser photo

What can this new board do?


Guesses? Comments? Answer revealed after US Thanksgiving holiday (2016-11-24)!

(There is nothing on the back side)

Read analog sensors on SDI-12 USB + Analog adapter

Reading analog sensors are easy. The adapter has SDI-12 address of ‘z’, lower case. So reading the analog sensor just involves querying the SDI-12 address ‘z’. There are two sensing modes: single-ended, and differential. If you have mixed single-ended and  differential channels, read single-ended, then differential. Discard channels you don’t need. It won’t hurt the sensors or the adapter if you wire them in differential mode but read in single-ended mode. The reverse is also true.

The sensing commands are ‘zM!’ for single-ended readings, and ‘zM1!’ for differential readings.

In both modes, you use ‘zD01!’ zee-Dee-zero-!, to get data. Essentially, the adapter itself is an SDI-12 sensor that reports 2 or 4 values, depending on sensing mode. This makes it very easy to integrate analog sensors into your existing data logger that is based on the original SDI-12 USB adapter. It is still advantageous to keep the original SDI-12 USB adapter so it can split SDI-12 sensors with the SDI-12 + Analog adapter. In case one SDI-12 sensor gets broken and interferes with the rest of the sensors on that adapter, the SDI-12 sensors on the other adapter will be unaffected.

To make this complete, the SDI-12 USB + Analog adapter also responds to the following commands:


Response: ‘z\r\n’ This means that the adapter is responding to queries.

Command: ‘z!’

Response: ‘z13Liudr   SDITRD130\r\n’ This indicates that the firmware is in version 1.3.0.

Command: ‘zM!’

Response: ‘z0014\r\nz\r\n’ This means that the adapter needs 1 second to acquire 4 single-ended auto-scale analog values. The second ‘z’ indicates it completed the acquisition.

Command: ‘zM1!’

Response: ‘z0012\r\nz\r\n’ This means that the adapter needs 1 second to acquire 2 differential auto-scale analog values. The second ‘z’ indicates it completed the acquisition.

C0mmand: ‘zD0!’

Response: ‘z+1.23456+2.34567+3.45678+4.56789\r\n’ or ‘z+1.23456+2.34567\r\n’ These are single-ended or differential channel readings, depending on whether M or M1 was issued before D0.


Update on the SDI-12 + Analog USB adapter


Here is an update:

In case you wonder what all those green screw terminal blocks are doing, here is a graphical explanation:

Both the SDI-12 USB and SDI-12 + Analog USB are explained in this illustration.

To maintain the same compact size, I printed all the pin information on the bottom of the board again. So if you don’t know what a certain pin on a block does, just flip it around and you’ll see it. The jumper information is all on top side.

The SDI-12 + Analog USB adapter comes with a jumper to select either internal 5V or external voltage at the Ext. Power screw terminal block. You may connect a small 9V battery to the Ext. Power screw terminal block. You can also connect your  12V battery that powers your logger to this pin. The external power is only sent to the SDI-12 sensors. It’s not powering the adapter or sent to the analog inputs’ “+” connections. Those “++ connections are always from the 5V USB power. There are 3 pins on the terminal block and the center pin is not connected to anything. It makes it easier to separate the + and – of the external power and I don’t have to source 2-pole blocks besides 3-pole blocks.

All four SDI-12 blocks have “+ S -“. The “+” is either USB 5V or external power depending on the power jumper. “S” is SDI-12 signal. “-” is ground. All grounds should be connected together. These four blocks are all connected. They are not four separate buses. There is no way to transparently bridge one USB serial port to more than one SDI-12 bus. If you wish separate SDI-12 bus for each sensor, which is unnecessary, get a separate adapter for a separate SDI-12 bus. This need for separate SDI-12 bus may come from some suspicion that if a single SDI-12 sensor breaks, it may take the whole bus down with it. I have not been so unfortunate and broken SDI-12 sensors I have had didn’t affect good ones. In any case, a broken sensor needs replacement. Unless you deploy redundant sensors one set on each SDI-12 bus, you are OK with a single adapter that bridges a single SDI-12 bus for all sensors.

The four analog channels are as accurate as 0.02mV when the signal is small, below 0.256V. The adapter automatically uses the best scale to determine the signal. The highest signal allowed is 6.144V on any channel. There are 6 ranges (gain levels), with maximal ranges of 6.144V, 4.096V, 2.048V, 1.024V, 0.512V and 0.256V. Within each range of voltage, the analog input is turned into a numerical value between 0 and 32767. So if you have a signal that is 0.1V, using the largest range of 6.144V will give an smallest change of 0.1875mV. This sounds very accurate, because this change is 0.1% of the signal. But the real resolution of the ADC is not the smallest change. It is usually many times that. Plus there is fluctuation in supply voltage and noise in the signal. The result is likely in the neighborhood of 2mV. This becomes 2% of the signal magnitude. But if you use the 0.256V range, its smallest change is 0.0078125mV. The accuracy is about 0.02mV to be conservative. Since SDI-12 standard has no way to change scale, the adapter does it automatically.

The auto scale is done with a 10%~90% range. The adapter starts with the largest scale to protect the converter and reads the signal. It then calculates the smallest scale that will fit the signal within 10%-90% of the scale. It reads at this scale and returns the value. Each channel is auto scaled independently from the other channels so you may have some larger signals automatically read at a larger scale and smaller signals automatically read at a smaller scale.

The meaning of single-ended channel is that each one of the four channels is read against the common ground. This is less accurate for small signals over long wires. If you have a pyronometer or some other small voltage signal sensor, you may want to use two channels in differential mode. In this mode, the “+” wire is connected to say channel 0, and the “-” wire is connected to channel 1. The difference between these two are read and the difference may either be positive or negative. Range of the difference between these wires can be +-6.144, … +-0.256Vetc.

(to be continued)


SDI-12 USB + Analog prototype

So finally the boards and parts are here and I built the first batch of 3 boards (purple as in Here is a photo of one of them with my hand as size reference:


This board is twice the size of the original SDI-12 USB adapter and features the following additional features:

  1. 4 SDI-12 screw terminal blocks. The original adapter can handle multiple SDI-12 sensors if you wire them all together to the single SDI-12 block. On the other hand, I can make this easier by providing more connectors. 4 connections don’t mean limit of SDI-12 sensors to 4. You can wire any number of sensors to the same connection. More connections just mean more convenience when building your logger or swapping sensors in the field.
  2. External power supply block. With the original adapter, SDI-12 sensors are powered by 5V from USB. If it is not enough, you need another power source and some additional wiring. With the new version, just wire external power to this connection and select the SDI-12 power jumper to Ext., less wiring.
  3. Analog channels: Many users asked about using analog sensors that are NOT SDI-12 sensors. That requires additional hardware and distracts you from focusing on making your logger. Enter 4 analog channels! Each channel is capable of 16-bit analog to digital conversion and can have up to 16X gain. The smallest voltage you can read is down to 8 micro volts! You are welcome, pyranometers! You can use them as 4 single-ended channels, for PT1000 or other resistive temperature sensors or as 2 differential channels, best suited for pyranometers.
  4. Resistance sensors: resistance measurements are available on every analog channel. The channels come with select-able high-precision low-temperature-drift pull-up resistors. You can select 1K resistor for PT1000 and anything with low resistance or 10K resistor for 10K thermistors or anything with high resistance. If your sensor generates a voltage, such as pyranometer, you can disconnect the jumper to disable this pull-up resistor. Each channel is separately configurable and auto-scales for best precision.
  5. Analog channels are sensed the SAME way you would sensor an SDI-12 sensor. The address is ‘z’ (lower case). Just in case you wonder, there is also a differential mode to further increase precision of small signals if you pair channels 0 and 1 as a differential channel, or 2 and 3 as another differential channel. Send zM! to the adapter for single-ended measurements. Send zM1! for differential measurements. If you have them mixed, say channels 0-1 is used as differential for a pyranometer and 2, 3 are single-ended for two PT1000 temperature sensors, sense it twice, once as single-ended, discard values from channels 0 and 1. Then sense as differential, discard value from 2-3 differential.
  6. Every key component, such as the analog-to-digital converter IC, the ATMEGA328 processor, the FT232RL USB chip, crystal oscillator, fuse, and precision resistors, comes from reputable vendors such as digikey, mouser, or newark. Every adapter is assembled by myself and tested with an actual SDI-12 sensor (also an analog or resistive sensor). I don’t know how else to ensure excellent quality! There is no guarantee coming with ebay purchases!

I expect this product to be available in a few weeks after I conclude my testing phase. My estimate retail price is $89. I will release data logger code that can log both SDI-12 sensor and the analog channels when this is offered for sale.