2018-07-21

It’s alive!

So it’s been a while. Basically when revision D of the PCB came in is when I tore my lab apart for a remodel. Well good news for everyone especially Neal (the dog) – the remodel is done and I’m back to pretending I know what I’m doing with a soldering iron.

The major changes between revisions C and D of the board were the following. More details on each item to follow.

  • Current limiting resistors
  • Polarity protection on all power outputs. Revision C already had reverse polarity protection on the main power input (and it was exceptionally effective). Revision D added protection to all power outputs as wel
  • Most of the components have been converted to surface mount.
  • New RS232 driver chip

Changes in revision D

Current limiting resistors

The previous revision of the board had an issue during power-on. Two boards stacked together would generally trip the power supply’s overcurrent protection. It would also wreck absolute hell on the power rails when the Beaglebone interface board would turn the power to the IO boards. Additionally(!) the temp/humidity sensor would misbehave when it was turned on.

The issue was a very large voltage spike on the power rails on turn on. One of the manifestations was a spike on the output from the temp sensor. The voltage at the 4-20mA input to the board would spike to 13+ VDC when the sensor turned on. This would cause the clamping diode to become forward biased and basically short the analog power supply to the 5VDC rails which would cause the analog power supply overcurrent protection circuit to kick in and shut the party down. This was not desired behavior.

The Beaglebone interface board suffered from the same problem. When the IO board pair would be turned on by the relay, there would be great disturbance in the power rails up to and including the power supply tripping on overcurrent.

The naive solution at the time was current limiting resistors. I added a 2512 in series with the power supply to the board. The idea was that it would limit large inrush current, but during normal operation, due to the fact that the boards do not draw a lot of power, the voltage drop and heat would be negligible. Well that did not work out as well as I had expected. See the ‘power supply voltage drop’ section under ‘interesting problems’. I also added 100 ohm current limiting resistors to each analog power supply and digital output terminals. That doesn’t seem to be causing problems.

Let us do some basic arithmetic surrounding the 100 ohm current limiting resistors at the analog sensor power supply output. Power supply voltage before the protection diode is 23.861V. After the diode it’s 23.615V for a forward voltage drop of 0.246V. According to the data sheet for the Toshiba CUS08F30, typical forward voltage at 10mA is 0.22 volts. The forward voltage drop has a positive correlation with increased current draw through the diode. The voltage of the power supply for the temp/humidity sensor is 20.696V. 23.615V (post diode voltage) – 20.696V (post resistor voltage) is 2.919V, which is our voltage drop across the 100 ohm current limiting resistor. Assuming that the resistor is exactly 100 ohms as the package says, the current through the resistor is V/Ohms or 2.919/100 or 0.02919A or 29mA. That’s assuming of course that the resistor is exactly 100 ohms. Measured with a 5.5 digit Rigol bench meter, the actual resistance of that specific resistor is 100.080 ohms. Redoing the calculation taking into account the corrected resistance value (2.919/100.080) we get 0.02917A or 29mA. No appreciable change. So how many watts are we dissipating. For watts we multiply volts by amps: 2.919V * 0.029A. The resultant wattage is 0.0847. The resistor is a Panasonic ERJ-P06F1000V – a 0.5W bad boy. Since 0.0847W is much less than 0.5W we’re in good shape.

Polarity Protection

All analog sensor power supply terminals as well as digital outputs now have polarity protection diodes. This is to keep voltage from accidentally being applied to the board via outputs.

Surface Mount Components

This was out of pure financial necessity. With the addition of all of the protection components I simply did not have room on the board for through hole components. I even had to switch to an 0805 package from 1206 in order to accommodate all of the extra components without expanding the board area. Additionally, all of the components are now on a single side of the board.

RS232 driver chip

I have replaced the Maxim RS232 driver IC with a Texas Instruments MAX232I. Reason was once again costs. The Maxim part I was using was $7.something per unit. The TI part is $1.something per unit. The only difference is that I had to add four capacitors to the board for the TI chip whereas the Maxim part was self contained.

Interesting problems

Ran into some interesting problems with revision D of the board. Well interesting to me, anyways.

Main board current limiting resistor

The issue here was too much of a voltage drop across the current limiting resistor. Please note that I’m going from memory here; I did not take any notes when working on this problem. I was testing the overcurrent protection of the digital outputs. The procedure is simple: turn on a digital output and short the output to ground. The expected behavior is that the circuit would sense the over-current condition, kill the FET drive, and raise the fault pin high which would then be detected by the microcontroller and communicated to the software. Everything would work as expected except when all four digital output were turned on. Which outputs were on did not matter as long as only three of the four were on. If all four were on the over-current circuit would trip, but the microcontroller would not sense the fault.

Bit of a back story. The IC that does overcurrent monitoring is the Microchip MIC5013. On a fault condition it raises pin 8 high, with high, in my circuit, being about 5.5V bellow the 24V power rail or about 18.5V. Since putting 18.5V into a microcontroller input rated for 5V works at most once, the fault output goes into a voltage divider and the reduced voltage is fed into the microcontroller. With a 24V power supply, the resultant voltage at the voltage divider is 3.9V. This is above the trigger voltage of the microcontroller pin and everything is good.

With the current limiting resistor in place, the power supply to the board was about 20 volts. The board draws around 85mA hence the 4V drop across a 47 ohm resistor. When all four digital output were on and their indicator LEDs lit, the voltage sagged just enough that the lowered fault output voltage and the resultant lowered voltage divider output was below the trigger voltage for the microcontroller input pin. And here is another interesting thing. According to the DC characteristics for the dsPIC4013 chip that I’m using, the minimum high voltage for the Schmitt Trigger is 0.8 VDD. Our VDD is 5V, thus the minimum high voltage trigger voltage is 4V. But the input trigger was triggered by 3.1V, but not 3.09V. Strange. I reused this particular chip from the revision C board. Wonder if all the hoopla and abuse of de-soldering and re-soldering the chip cause some sort of internal damage.

I2C pull up resistors

Another interesting issue is the amount of parasitic capacitance on the I2C bus between the communications controller and the IO controller. I started with a 4.7K pull-up resistors, but the waveform was exceptionally rounded. To be fair, the bus was functional, but not to my preference. I switched to a 1K resistor and the waveforms are looking much better, but am now concerned with the current draw on the I2C pins as the pin pulling the buss low will have to sink 5mA. This will need to be investigated further.

Analog input #8 least significant number flutter

This is another issue that will require more extensive investigation. The analog input is always reading 1mV when it should be at 0V when nothing is connected to it. The input terminal is reading 0V, but the opamp is putting out 1mV. Weirdness. This issue will definitely deserve it’s own post.

Closing notes

Couple small issues in this revision, but I’m feeling pretty good about it. Fun closing fact. The total capacitance of the board is 220uF. Assuming 2ohm resistance in the wiring from the power supply to the board, the inrush current at startup is 12A. With two boards in parallel, that’s 24A inrush current. That’s more than a standard house power receptacle is rated for.

Leave a Reply