For the last 9 months, we have been developing Wiren Board - a compact industrial computer with many built-in interfaces (Wi-Fi, GPRS, GPS, NFC, Ethernet, etc.). We have already
written about it, and received a bunch of feedback and suggestions. As a result, many changes have been made to the new version, and this article is about the most significant of them.
Compared with the April prototype, 2 USB-host, RS-485 interface and 8 GPIO connector appeared on the board. In addition, we made a new power supply circuit that supports input voltages from 5 to 22 volts, Passive PoE and a Li-Pol battery connection, added low-voltage load control and analog inputs on the terminal blocks.

')
How we did it, what difficulties we encountered and what happened in the end - read our article.
What and where on the board?
Wiren Board with the removed processor module:

The inner side is usually closed by the processor module:

Analog Inputs and Outputs
In the new version of Wiren Board, we added the ability to connect analog signals and sensors (digital, resistive, “dry contact” sensors), as well as control of low-voltage loads.
The SoC we use has two 12-bit public ADC channels. To increase the number of available ADC channels, we use the SN74HC4851 multiplexer, which connects one of the 8 channels to the processor's ADC input.

One channel of the ADC is used to measure the supply voltage, seven are led through resistors to the terminal blocks. To protect the outputs from high voltages, resistors are sufficient, since the multiplexer has built-in protective diodes. The ADC channel of our SoC has a programmable current source. The values ​​of the resistors were chosen in such a way that, with the current source on, be able to measure the resistance of resistive sensors.
To control low-voltage loads (motors, LED strips, locks, etc.), it is convenient to use open collector outputs (see fig.)
To save space, the analog inputs were combined with low-voltage load control channels. The disadvantage of this solution is a small current flowing through a closed output at voltages above 3.3 V.
Power Adventures
The task was to come up with a power scheme for the board. Requirements for the power scheme are as follows:
- The output current of the buses 3.3V and 5V is not less than 500mA for connecting USB, UEXT-modules and others.
- To power a GSM modem, it is necessary to provide a voltage from 3.5V to 4.6V, with impulse currents up to 2A and voltage drops of no more than 300mV.
- Ability to work on the Li-Ion battery, battery charging. Battery overdischarge protection.
- Extended input voltage range, at least 5-15V.
Other conditions:
- Do not use chips in cases without legs - QFN, DFN and the like - to mount them in Russia is very expensive
- Low cost
- Minimum dimensions
Decision:
Since it is supposed to power the circuit from the battery, it is impossible to do without a step-up DC-DC converter for the 5V line. An inexpensive NCP1450 chip was chosen (as it turned out later, not the best choice). This is a step-up DC-DC converter with an external transistor.
The voltage on the Li-Pol battery is 2.7..4.2V, but the “plateau” on the discharge curve is around 3.7V. Therefore, it is possible to use LDO to get 3.3V.
We chose the linear regulator MCP1826, it provides current up to 1A. Given the requirements of the GSM modem for voltage and current, it should be connected directly to the battery. And it is better to add more capacitors. So, while the circuit in which everything is connected to the battery.
And then not so obvious.
To charge the battery requires a special chip that will properly charge it. You cannot charge the usual DC-DC, because it is necessary to maintain a constant voltage (4.2V) with high accuracy and limit the charging current (CC / CV mode). But to be able to work without a battery, one cannot do without a step-down DC-DC converter!
To resolve this contradiction using power management systems.
In our case, it would look something like this:

But this option did not suit us in terms of cost and footprint.
We decided to make a feint ears and went the other way.

The LTC4002 is a simple and inexpensive Li-Ion battery charger with a PWM controller operating as a step-down DC-DC converter. The charger operates in constant current / constant voltage mode: it maintains a constant charging current until the battery voltage reaches 4.2V. After that, it maintains a constant voltage of 4.2V on the battery with great accuracy.
The microcircuit determines the charging current by measuring the voltage drop across the external resistor R_sense using the SENSE input. After this, the charging current is set to I_c = 100mV / Rsense.
For small batteries at 1500-2000 mA * h, the charging current should not exceed 500-700 mA, and the power supply should provide up to 2 A in pulsed mode for the GSM module. In order to simultaneously fulfill these two conditions, it is necessary to “deceive” LTC4002.
Using two Rsense resistors, we ensure that the charging current of the battery is no more than 100mV / (R1 + R2), and the current per load is up to 100mV / R1.
We check: we pick a handkerchief with a power scheme, we collect, everything works fine. The voltage gives out as it should, the battery is charging.
Miracles 1
We order a fee in Rezonita, collect the whole scheme, turn it on - it does not work.
We look with an oscilloscope - it turns out that the NCP1450 (step-up converter 5V) outputs the required voltage, but not the current :) Without a load at the output of 5 volts, as it should be. But a small load of 10 mA - and the voltage drops to the input.
In the power line, a ceramic capacitor is needed as close as possible to the legs of the NCP1450, as advised in datasheet :) 1 cm from the legs - and no longer works. Still need to output capacitor was not less than 330 microfarads. Capricious microcircuit, in the next version we will change.
Okay, soldered more capacitors - it works.
Miracles 2
We put Olinuksinka on (our processor board - OLinuXino-MICRO), turn on - does not work. Turn it off, turn it back on - it works.
It is switched on randomly with a probability of ~ 50%. Magic.
Cause:
The LTC4002 charger has a tricky mode of charging half-dead batteries, in which it tries to charge the battery with a current of 10% of the nominal (trickle mode charging).
The mode turns on when the battery voltage is less than 2.9V, and the 5V boost converter starts operating from 2.2V.
And then who is faster: if the LTC4002 has time to charge the output capacitors up to 2.9V faster than the converter starts working, the power will turn on and continue to work normally. If it does not have time, then NCP1450 starts to consume current, the voltage does not reach 2.9V, and LTC4002 considers our system as a dead battery, without increasing the current.

Bring to mind
We will have to assemble a circuit that will disconnect the load until the voltage rises to 3V in order to “slip” the trickle-charging mode of the LTC4002.
Well, we put a bipolar transistor with an ultra-low voltage drop and a three-output zener diode (also known as a programmable voltage source, also known as shunt regulator) to its base.
Resistor R3 sets the base current, divider R4-R5 sets the threshold turn-on voltage, and positive feedback through R6 creates a small on-off hysteresis - 3.1-2.9V. Resistor R7 provides the minimum current of the cathode.
At the same time, this solution will protect the battery from overdischarge and allow you to make the shutdown button. With one crutch we solve three problems!
Miracles 3
We continue testing the board with the power scheme.
Input voltage 5V - everything works! 12 volts - NFC stops working, can not read the card: ((
Cause:
The power circuit creates strong interference that interferes with the operation of NFC.
Maybe it's in unshielded coils?
Ok, turn the coils to the side so that their field lines become perpendicular to the NFC antenna.
We are checking. 12 volts - works, 22V (power is supplied via PoE) - does not work. So you have to put shielded coils, even though they are twice as large.
Okay, let's add filter capacitors to the right places in the power supply circuit.
And now NFC works in the entire range of input voltages.
Miracles 4
We check the work under load on lines 3.3V and 5V at 0.5 A. Using an infrared thermometer we control the temperature of the elements, the board heats up a little, but everything is within reasonable limits.
But at 22V, the Schottky diode burns in ten seconds.
Diode PMEG3010 - to 30V 1A. In the step-down converter circuit, the higher the voltage, the more current flows through the diode at the same output power.
Ok, we put the diode more powerful.
The benefits of reading datasheets
We redraw the board under shielded coils, add filter capacitors, shorten the tracks with impulse currents as much as possible. We change the burned-out Schottky diode to 2 amp, transfer it to the outside and draw polygons for better cooling.
We test the board - the diode burns in the same 10 seconds: ((It's time to carefully read the datasheets for these diodes.
Looking carefully at the graphs, we note that the reverse current through the Schottky diode depends exponentially on both the temperature and the applied voltage. And at a voltage of 22V at the diode at 30V reverse current is not so small. The breakdown mechanism is something like this: while the diode is cold, the reverse current is very small, and the diode is heated only by direct current. The diode is a little warm - the reverse current increases and increases the heating. The temperature rises - the current even more.
And now - an avalanche-like rise in temperature and an end.
In practice, it looks like this - turn on, the diode is cold, warm, even warmer, burned out.
In general, you must read the datasheets very carefully and not believe what they write on the first page.
Lyrical digression
In this place, I want to convey heartfelt greetings to the
marketing engineers of NXP, who actually write these datasheets. Here, for example, Schottky diode PMEG4050. The stated characteristics: 40V reverse voltage, 5A maximum current. Looks good!
However, if you read what is written in small print, it turns out that 5A is measured at an air temperature of 0 degrees (sic!) For a diode brazed on a ceramic printed circuit board. Here it is asked why it was not to write an honest 3 amps in the characteristics? Riddle.
As a result, we put a diode with a voltage of 40V, the circuit works stably and without overheating. Got a workable power scheme, which is used in the first series of devices.
Plans
Despite the fact that in the end we got an inexpensive and stable power supply scheme operating in the whole range, we already had a couple of ideas on how to improve it. First, you can replace the linear stabilizer for the 3.3V line with a compact step-down DC-DC converter. In addition, you can change the boost converter for the 5V line with a less demanding and higher frequency chip. Such a conversion will slightly increase the efficiency and free up space on the board for some other module.
Conclusion
Detailed description of the Wiren Board and wiki with the documentation
here .
We collected the first small batch of 55 Wiren Board in Russia and distribute them among developers and users. Looking forward to your feedback!
UPD: devices from the first batch still remain, you can buy them on our website
- Wiren Board Team