23 January 2024

MESHTASTIC TTGO T-Beam V.1.1 Power On issues

 A few weeks ago, I start to play with Meshtastic using two TTGO - TBeam V.1.1 LoRa boards based on ESP32 MCU.

Because plans are to use them as ROUTER_CLIENT, I choose to recharge the battery using a separate TP4035 module and a solar panel.

Of course, I could very well use the built-in AXP192 battery management but the circuit was pretty unsuitable for small solar panels and the TP4056 offers a more stable configuration. 

In the tests I observed a strange behaviour that can negate the usage of these boards as a reliable remote installed device: 

if the battery voltage drops under the Low voltage treshold, the board will not boot into operating mode.

The same behaviour was consistently observed even the charging was resume on the USB port on the T-Beam board itself.

The ESP32 datasheet have some clues about why this issue occurs and how to mitigate it.

Once the power is supplied to the chip, its power rails need a short time to stabilize. After that, CHIP_PU – the
pin used for power-up and reset – is pulled high to activate the chip. For information on CHIP_PU as well as power-up and reset timing, see Figure 2-4 and Table 2-2.


• In scenarios where ESP32 is powered up and down repeatedly by switching the power rails, while there is a
large capacitor on the VDD33 rail and CHIP_PU and VDD33 are connected, simply switching off the
CHIP_PU power rail and immediately switching it back on may cause an incomplete power discharge cycle
and failure to reset the chip adequately.
An additional discharge circuit may be required to accelerate the discharge of the large capacitor on rail
VDD33, which will ensure proper power-on-reset when the ESP32 is powered up again.
• When a battery is used as the power supply for the ESP32 series of chips and modules, a supply voltage
supervisor is recommended, so that a boot failure due to low voltage is avoided. Users are recommended
to pull CHIP_PU low if the power supply for ESP32 is below 2.3 V.

I run some tests and found that if the above hints are observed, the recovery of the ESP32 from transient voltage induced coma is 100% so a supervisor chip was ordered.

The STM1001 microprocessor reset circuit is a low-power supervisory device used to monitor power supplies. It performs a single function: asserting a reset signal whenever the VCC supply voltage drops below a preset value and keeping it asserted until VCC has risen above the preset threshold for a minimum period of time (trec).

To be continued...

LATER EDIT:

The STM1001 finally arrived (after three days) and I was eager to test the validity of my rationale.

 
So, I installed it on the board; the Vss was soldered on a little island of Copper exposed by a sharp razor and the Vcc was tied to the Source pin of the P-channel NCE3401 MOSFET.

 

 

This transistor is there to protect the board against reverse polarity from the battery.

The RST of the STM1001 was tied to RST of the T-Beam board.

And here it is, the final installation:



Now, for the tests...

There are two distinct situations, depending on how the battery is charged; internal or external.

 

FIRST VARIANT - battery charged internally, using the AXP192

The battery is directly installed on the board and the AXP192 circuit is used at it's full. 

The battery is a small capacity one (1.28 Wh), to be able to have it quicly charged to observe the parameters.

The battery is charged by AXP192.

Going from a flat battery (around 2.5V), the  voltage of the cell, measured at STM1001 Vcc and Vss.

The blue LED is signalling the charging, the voltage is rising and when it reached 3.19V (on my DVM), the RST is released from Vss to 3.2 V (the Vcc of the ESP32).

The ESP32 start to run, the LoRa RTX is sending the first beacon.

This was consistent during a set of 5 tests.

SECOND VARIANT - battery charged externally through a TP4053 board.

The same battery is connected to a TP4053 board with protection and the output of the board is connected to the T-Beam board in place of it's battery.

The AXP192 is not able to manage the charging process because it cannot detect the external power presence.

Therefore, the AXP192 will not start and will not be able to Power On the T-Beam board, at least in the current firmware used for Meshtastic.

Due to the way it works (it is a very complicate process - if you don't believe me, read the AXP192 datasheet) it is mandatory to simulate PEK press (Power Enable Key) after the voltage reach 3.2V which is beyond my scope.

I did some crude tests and it is doable but the solution will be more complicate than the one I am searching for.





 


06 January 2024

TC4056 1 cell LiIon charger module

I have a lot of those little boards made around a TP4056 IC.

According to the datasheet:

The TP4056 is a complete constant-current/constant-voltage linear charger for single cell
lithium-ion batteries. Its SOP package and low external component count make the TP4056
ideally suited for portable applications. Furthermore, the TP4056 can work within USB and wall
adapter.
No blocking diode is required due to the internal PMOSFET architecture and have prevent to
negative Charge Current Circuit. Thermal feedback regulates the charge current to limit the die
temperature during high power operation or high ambient temperature. The charge voltage is
fixed at 4.2V, and the charge current can be programmed externally with a single resistor. The
TP4056 automatically terminates the charge cycle when the charge current drops to 1/10th the
programmed value after the final float voltage is reached.
TP4056 Other features include current monitor, under voltage lockout, automatic recharge and
two status pin to indicate charge termination and the presence of an input voltage.

This might be a problem with low capacity cells because to keep the charging in the safe area, the charging current must not exceed 1C (C=designed capacity).

Charging above this might give a temperature rise and this is not good for Li based cells. Of course, there are specific cells that accept charging currents above this safety limit but those are special ones thus not taking risks is a good approach.

Going to the datasheet of the TP4056 give us some interesting informations.


We can conclude that we can use this circuit directly connected to a small Solar panel able to output 6V.

But what about the current? 

Well, the charging current is set by the value of a resistor, Rprog in the test circuit below:

 The value of this resistor determine the charging current as per the table below:

On some modules, the resistor is marked "R3" but anyway, you can easily found it by tracing the circuit from the pin#2 of the IC; in the photo is the one below the little capacitor on the left side of the circuit:

From the factory it came with a 1K resistor which, according to the datasheet, correspond to a 1000mA (1A) charging current.

I changed it with a 2.2 KOhm one and the charging current dropped, as expected, around 500mA.



For final, here is what this module wants to tell us, based on the LED status:







 


06 December 2023

Portable GPS barometer UTC Clock

 

Often, in portable I have to use the phone to check for Maidenhead QTH Locator and UTC for logging purposes.

Looking into my junk box I found that i have a lot of ESP based development boards (NodeMCU) and even a uBlox GPS that I bought several years ago and never put it to work.

Also, a small 1.28" SPI TFT was there, waiting...

So, I made a little box usefull for portable/outdoor ham things...

The main feature of this box is to show the UTC and Maidenhead locator as we use this very often into the field but working on this project I thought why not add a barometer and see the pressure.
The next step was to show the evolution of the QNH in time to see if there are some worring variations and a little graph was added.

So, overall, here are the features:

- GPS Coordinates; Lat, Lon, Alt (this need good GPS reception).

- UTC time;

- Maidenhead Locator with 6 symbol precision, good enough for sending it to a correspondent.

- QNH with graphic representation.

- Battery voltage indicator for the LiIon cell.

 The barometric pressure is read at about 15 seconds and averaged for 10 readings then a pixel is drawn on the TFT graph area. For 126 pixels, we will have a history of atmospheric pressure for the last around 45 minutes.

The colours can be easy changed by changing the code.

My little box is powered by one 2000mA LiIon cell which can give around 7 hours of usage. 

The code is available on GitHub.



 


06 November 2023

Microphone preamplifier for DC powered (phantom) input

I found this by the grace of FB who reminded me about it (10 years).

A customer came with a specific request: to increase the volume of the headset microphone for his AM Air band transceiver.

If I remember well, it was a ICOM AM transceiver.

The problem was that the space was very small inside that helmet and the second, and bigger, problem was that the microphone had around 8V DC phantom power.

An intervention in the radio itself was excluded because, you know, "life support device" and going inside it was a no-no...

The solution I found was a small preamplifier for both of his headsets (two pilots there).

The schematic:


The PCB was draw by hand. Pretty ugly but it fitted perfectly in the helmet and by using SMD components, the result was very solid:

 

 

 

26 October 2023

RF Ammeter to trim antennas

 I started playing with End Fed Half Wave antennas this summer.

While I found some interesting facts about high impedance Un-Un transformers used on this type of antennas I felt the need to proper tune the wire but the "SWR" or "VNA" methods are not quite adequate, in my opinion.

Without making an in-depth theory, I will tell you why those two methods are not good for tuning EFHW antennas. By "tuning" I understand trimming the radiating element to transfer most of the energy from the transmitter into the 'air' a.k.a "RF radiation"...

But first, let's see (in short) what an EFHW antenna is?

We all know that an antenna, the radiating system, is made from two parts on which the RF current is fed.

Basically, it is a transducer that transforms the alternate current into electromagnetic radiation. Like any other type of electric circuit it need to be "closed" meaning the current has to be applied to apositive and a negative poles.

On the antennas, we might consider the "positive" one as being the radiator part and the "negative" the radial system or, like in the case of dipole antennas, the other wire.

The antennas might be symmetrical or assymetrical. in the first category we have the most simpler antennas, the dipoles. On assymetrical side, we might look at the vertical antennas or various types derived from dipoles, like theJ-poles or Zepp(elin) antennas.

Being a "radiating" system, the antenna must transfer most of the energy that is fed at the input and because we are talking about radio-frequency, we must match the impedance of the antenna with the impedance of the transmitter. Because the antenna transfer energy to and from 'the air" from and to the transceiver, matching them in the proper way will benefit for both transmitting and receiving the signal.

Antennas are bi-directional transducers...

What is "impedance"? Well, in direct current (DC), the load is pure resistive. Being a constant flow of electricity, the load will be just that, a pure resistor but in the presence of alternating current, the load will present also inductivity and capacitance due to mechanical features of the load. 

Some components like chemical or pelicular resistors will exhibit a very little capacitive and inductive reactance other like coils will have big inductance and capacitors bigger capacitance (they also have a small resistivity which define the "leakage current").

Thus, an antenna will have a complex reactance; the laws of Physics say that if we want to transfer the most energy to the antenna, the capacitive or inductive part must be as low as we can achieve, best being zero. 

"Reactance" is called like so for a good reason, inductive or capacitive part is "opposing" to the transfer of the energy to antenna by shifting the current regarding to the voltage resulting "reactive power" that goes warming the environment.

By choosing the correct dimensions of antennas, we can lower the reactive component of the impedance getting all the "juice" out of it. This is called "RESONANCE".

We can say that, at the resonance, the transfer of energy from the transmitter to the antenna is the best. The problem what arise here is that the antennas resonate at various impedances thus, the pure resistive part is not always 50 Ohm! 

A short note: because SWR meters are made to measure the reflected power (derived from the complex impedance, resistive and reactive part), a 1:1 SWR is often achieved when the antenna is not perfectly matched.

A necessary note: the impedance of a perfectly cut dipole WILL still have a reactive component and this is due to the thickness of the wire. For the sake of this article, I deliberately choose to ignore this annoying things. Just for you to know that I am aware :-)

Example:

An open dipole perfectly tuned at the resonance frequency will have a resistive component of ...72 Ohm! Measuring the SWR will give a 1.5:1 reading and if we will search for a perfect 1:1 match, actually we will decrease the 72 (some say 75) Ohms resistive impedance to a 72-j22 Ohms. But this will add a reactive component which will translate into loss.

The things are pretty similar on vertical ground plane antenna which have the impedance at resonant frequency of 35+/-j0 Ohms. Same 1.5:1 SWR reading...

OK, enough with this, we are going into the rabbit hole!

What is End Fed Half Wave antenna (EFHW)?

Well, the best reference antenna is a symmetrical dipole, fed at the center, made by two wires each being a quarter wave lenght; it is a single frequency resonant antenna as i'ts said.

The voltage/current distribution on this antenna is a high current and a low voltage at it's feeding point>

Current and voltage waveforms on a half wave dipole.

The 72 Ohms impedance is close enough to the 50 Ohms of the transceiver to not bother too much.

But this is a hard to deploy antenna in short field sessions so simpler antennas ar in use.

While "wonder" antennas can be very practical, when using low bands, the compact dimensions of those antennas make them pretty frustrating because of the losses; working QRP on 40m band with a 1.2m antenna is more like a punishment than a joy!

What if, we can combine the benefits of a half wave dipole in terms of efficiency with the ease of deploying a single wire, fed at one end?
Well, the antenna will resonate and transfer more energy than a short vertical or other type of compromising antenna, we will ease the deployment by giving the chance to use a tree to hang that wire and so on.

But there is a downside here; the theoretical impedance of this antenna is high, very high, up to 4000 Ohms, well away from the 50 Ohms required for a good match to the transceiver.

Because of the constraints in the mathematical model, the impedance is determined by practical observations and let's just say that those who pretend the antenna is a "monopole" are wrong because they neglect the common mode current which is there because the antennas need two part to work. Without "the other" part, there will be no current!

This is why a UnUn (Unbalanced to Unbalanced) transformer is needed. We need to lower the high impedance in range of  2-4 KOhms to match the 50 Ohms. So, a 49/1 will be in that range, a 2000 KOhms will give a 40 Ohms and a 5000 KOhm a 82 Ohms which will give us a 1.6:1 mismatch (at worst) for this kind of antenna. This is well between the limits that a transistorised final stage can cope with.

Because of the limitations of the theoretical model and some  deviations introduced by the "to infinite" impedance at the end of the wire, were we feed the antenna and the common mode current that is inherent to this kind of antenna, it is hard to say that we really got the wire to resonance.

The usual advice when trimming this antennas is to make the UnUn then to connect the wire and trim it for the lowest SWR but this will measure a complex system made from: the wire, the UnUn and the coaxial cable. All of this are part of what we are trying to use as a "EFHW antenna".

But, remember? Our interest is to put most of the energy from the transmitter into the air so we need an objective mean to measure that!

There are two such means that get into my mind: a RF field measurement device and an RF Ammeter.

While using the first it is very complicated and it is used by serious manufacturers in special test fields, the second one is easy to make and accessible to any ham that know how to use a solder iron.

The distribution of the current in EFHW antenna call for a high voltage at the feeding point and a low current. When the current is at minimum, we know we have trimmed the wire well.

And here I came to the little sh*** I made yesterday afternoon...

Sorry I made you read so much before you got to the pictures, HI HI!

 

I is a simple RF Ammeter made with a ferrite clamp-on RFI supressor. They are usually made from Mix43.

A 10 turns Enamelled Copper wire (0.6mm diameter but can be thinner) coil between the ferrite half and the plastic support.

 

The transformer is glued with epoxidic resin to a small PCB.

 
On the other side of the PCB we have the components. I plan to add a small metallic cover.

 

This is the test wire I made to "calibrate" the readings for a 500mW on 50 Ohm full scale.

The tests show a constant reading between 1.8 MHz and 30 MHz. in the picture the PWR/SWR meter is not shown but it is in the circuit.

This is the modified coaxial wire I used to check the current into the dummy load.

Now, I can play with it and trim the wire for my EFHW antennas getting the most out of them. After trimming the wire for the lowest current, if a mismatch is shown on the SWR meter, next on line for trimming will be the UnUn. The "legend" say that a 49:1 ratio UnUn is the best but I am curios what the field testing findings will be!

After getting the proper ratio, any variations in the field deployment will be resolved by the ATU. Or not bother if they are within resonable limits. 

We will see.

With this, I can also check for common mode currents into my shack.

After testing the concept, I made it to the final "product". A Peaktech uA was just right!







Cheers, de YO3HJV.

LE:

I made a second iteration of the final device, a more compact one for field use.

This one has two "sensors":

-a clamp-on RFI suppressor

-a Mix43 toroid with two BNC for situations were access to the actual radiator or radial is not possible.

I will put here only the pictures.

Some details: 

-no more doubling voltage detection; just one diode and the resistor is 100 Ohms/1W.

-each detector has it's own voltage preset so I can calibrate differents scales for BNC and clamp-on circuit. Now they are calibrated for the same values: 5W and 50W for full scale indication,

-the micro-ammeter is, in fact, a 100 mA full scale indicator; it is less sensitive but not so delicate like the previous one and this was deliberate as to resist the portable op ordeal :-)

-the secondary winding has 12 turns instead of 10 for more voltage on detector.

A very interesting conclusion when I tested it both for voltages and frequency:

The clamp-on RFI choke and the Mix-43 toroid exhibits the same voltage output regarding to the power and frequency strongly suggesting that the material used for the RFI supprofessor IS, in deed, Mix-43 as I assumend based on the colour and texture.

 





Most viewed posts in last 30 days