24 februarie 2021

Software defined lab power supply


Sometimes in the lab there is need to monitor the power parameters during some period of time and put it on a nice graph.

Because I couldn't find something like this and because it is fun to make things, I start to wonder what if I put an Arduino on a power supply!

So, the lab supply must have:

-Variable voltage between 1- 14.4V

-Current monitor

-Start/Stop

-Overcurrent protection

-Serial output with time markers

Because I am lazy, I used some ready-made modules.

The main power supply is a modified 12V/5A SMPS; with a little tweak it now deliver 17V/4A.

The modification was made in the feedback circuit where the TL494 reference is compared with the output voltage.

The variable output voltage is made with a DC/DC Step down module able to handle constant voltage from 1.25 to Vsmps - 2V at around 5 A.

The output voltage and current are measured with the Arduino ADCs and I used two 2.5 LM4050 precision shunt reference in series to have Aref at 5V. 

The DC/DC Step down is controlled with a PCF optocoupler driven by a digital potentiometer MCP41010 on SPI.

The output relay is used for fast protection as a "crowbar" circuit and, in the future, will connect the output  to a controlled discharge circuit to characterise batteries.

By code, this power supply can be used to deliver regulated voltage and monitor the current or to charge various batteries.





The schematic:


The code is on Github.



23 februarie 2021

Bandpass VHF and UHF filters

 For the next project (IRIS) I need two small filters, one for VHF and one for UHF. 

The goal is to get rid of the out of band signals.

On modern (especially portable) radios, the front end receiving circuit is not so selective and the received signal to noise ratio is pretty bad, sometime making receiving impossible.

Therefore, wherever is possible, some good, selective passband filters has to be put in place.

The next project has to do with small signals and I must make those filters for VHF and UHF hamradio bands.

Fast and dirty tests looked OK so I made these filters. 

No drawings, just experience :-)









The VHF filters is inspired by a picture found on VE3IUL site.










A nice web page about filters here.

I tested with my IC E92 portable and I could be heard with SLO which, is around 100 mW.

19 februarie 2021

Xiegu G90 - backlight for Front panel keypad

There are not many features missing from the Xiegu G90... At least, when is about hardware, in the firmware, there is another story.

When I was replacing the STM32F103 in the front panel, I was asking myself if I can add backlight to the front panel keypad. At that moment I was focused on that repair job and I put the ideea on other shelf.

These days I will get involved into a big project and I will have to let down this kind of PMR (Pimp My Radio)  projects so I thought this is the right time to gave it a chance.

I have around some SMD LEDs and some ideea so, I get to the bench and opened, once more, the front panel assembly.

Xiegu G90 inside exploded view

I did some tests about how the light is diffused in the rubber keypad and I investigated the places where I can put some LEDs.

The space between the PCB and the keypad is none so we need some alteration in the keypad rubber to accomodate the LEDs and the wires.




First try was with the tip of the soldering iron but, to my surprise, nothing had happened.

Then, I tried to use a 3.5mm drill to remove the rubber in an "organised" manner... nothing! The rubber act like rubber and get back into the hole.

Short story: I couldn't found the proper way to make 3mm holes with low risk of destruction.

The problem is that I must embedd not only LEDs but also the wires that goes to them. About the wiring, I had in plan to use 26 Gauge wrapping wire (around 0.5mm) so a proper way to make them too has to be found.

Here is the optimal position for a bunch of wide angle SMD LEDs to diffuse the light into the keypad.

NOTE 1: the botom line of keypad is already illuminated by the backlight from the LCD. Not very bright but enough to be seen into the dark.

NOTE 2: the colour of the LEDs has to be different than the two LEDs for Function and CW decoder because the light will be conducted in those too and will cause them to appear lit.





18 februarie 2021

Custom ATMEGA328p board

 There is a time when an Arduino is too big and has useless features.

An ATMEGA328p on a breadboard, using internal clock at 8 MHz with a common Arduino Bootloader has to be made.

ATMEGA328 datasheet.

Some references here, notes to myself but also usefull (maybe) for others.

Pin map:



The Reset circuit should be a resistor from RST pin to Vcc and a 0.1uF capacitor from RST to whatever....



17 februarie 2021

Xiegu G-90 Audio Gain for quiet nights

 I use to listen to CW to train the reception but not always I am not so willing to use the headphones. Sometime, late at night when I am working at some projects the sound can be heard in the bedrooms and I already had some complaints about this.

On Xiegu G90, the minimum audio level is still too loud for this and some faint signals need to keep the RF Gain at higher settings so something about the audio has to be done.

The audio volume is digitally defined into the audio codec in the Main unit and even I sent the issue to Xiegu, nothing has been done yet (FW 1.77).

Therefore, I felt I must do it myself...

The audio amplifier is made around a wellknown LM386 in SOIC package, not the best for thermal dissipation, if you ask me...

LM386 is a very versatile audio power amplifier designed to be used in portable applications. 

It feature a wide supply voltage range, between 4V and 12V (some versions from 5V to 18V), and can deliver 125 mW on 8 Ohm speaker with 0.2% distorsion.

Because it is designed for minimum external parts, it has an internal fixed value resistor (1.35 kOhm) for an amplification factor of 20.

Internal schematic of LM386:




This internal resistor can be bypassed with an external network to achieve higher gain (up to 200 or 46db) and Xiegu put there a 10uF capacitor and a 100 Ohm in series.

Sidenote: I found a nice online gain calculator for LM386.

The values used by Xiegu in G90:


According to the formula, the Gain is 124.5.

After tweaking with some Rext values, I replaced the original 100 Ohm with a 300 Ohm for a Gain of 76.

Now, the audio is pretty nice, the first step of volume settings is just where it should be for a quiet night.

Audio circuit, PCB layout in Xiegu G90:


Yeah, in the picture is the original resistor. I didn't take a picture after the mod :-( 

I played a lot there with various values for resistor and capacitor then i remind to take a picture. Well... please forgive me :-)


Most viewed posts in last 30 days