Search This Blog

Tuesday, October 25, 2022

RC servo PCB replacement PCB

I bought some NE544N Servo Amplifier chips from a surplus place in the US a long time ago. That was long before the risk of getting fake chips from China.

I haven't fixing my old servo as I can get cheap micro servos from the usual place for a few dollars.  Those servos are very fast and quite strong for their size.



Old servo vs newer Tower Pro S90

I took the 10 minutes to make a replacement Servo arm out of FR4 PCB.

 This is one reason why I don't trust scanned datasheet and inconsistent component values labelling.  On the old datasheet scan I had, the critical '.' was missing.  Had they use a '0' in front consistently, that wouldn't have been a problem.


I knew something was wrong as the motor spins for a few seconds when I applied power. Cs for the Pulse Stretching is labelled as .22uF, but the '.' was missing on one of the datasheet.  I didn't know at the time that the value I put in was 2 orders of magnitude higher!  

I figured that Rs * Cs time constants should be on the order of 20ms (1/50Hz). 50Hz being the frequency of the control PWM.   ~ 0.266uF close enough to the 0.22uF value.

I still have some doubt to the actual value as they used 0.1uF else where on the datasheet with a leading '0', but without one on the .22Uf.  The first value I tried was 0.56uF as it fitted the footprint I had for Cs.  It was a luck of the draw as it work better than the 0.22uF.  There was some rattling with the 0.22uF, but 0.56uF was fine.  It might be something related to dead band setting as that servo have a lot of backlash.

I just noticed that C4 filter cap for the feedback signal also has the extra '.' in front!  I used 1uF as the old datasheet scan didn't have it.  For my slow servo, it makes very little difference.


I had to make up the proper values of the resistors as I don't have them in my parts box.


I have enough space, so I also put in the two optional PNP transistors on the PCB for high currents motors.

PCB back side

PCB Top side

I drilled extra holes for a 1uF decoupling cap across pin 5 & 11 of the NE544 as I missed that on my PCB.

Old picture with a 0.22uF decoupling cap on back side.

I used my Component Tester to generate a PWM as the test signal.  The 100Hz was as low as the tester would go.  The nominal PWM frequency for servos are around 50Hz.  The NE544 circuit and 70% of my servos works at the faster rate of 100Hz.

This PCB could be useful if I ever need to make a servo out of some random geared motor assembly.

Saturday, January 8, 2022

Intel heatsink mounting brackets on my AM4!

 I bought a Zalman ENPS10X Optima tower heatsink for my old FM1 a long while ago.  It was overkill, but I bought it at a discount. AMD changed the mechanical spec for AM4 socket, so it couldn't be used.

AM4 vs FM1/FM2/AM3


Mounting kit for my old heatsink

Zalman updated the rev. 2 of the heatsink by changing the backplate and the 2 pieces of springs for the AM4 with both sets of mounting holes.  

New heatsink mounting kit

They offer an AM4 upgrade kit for some of their other heatsinks for $11, but not my old model.  That's 1/2 the price of what I paid for and I'll be taking a gamble.  The old springs are too narrow.  I'll have a very hard time trying to drill it without good carbine drill bits and a drill press.  I am using the Intel mounting kit as it leaves just the right amount of space for the extra screws holes.

I placed the heatsink on top of the AMD Wraith Spire.  It turns out that the fan mounting hole lines up with the Intel 775 mounting holes.  I took advantage of that for my alignments.

Zalman heatsink (with Intel mounting kit) on top of Wraith Spire

I use some scrap piece of "stiffener" 0.06" thick plated mild steel from a server card to make my adapter.  I measured off 54mm spacing for the backplate mounting hole.    The hole sizes are 9/64" and all the screws for this project are 6-32.

I use cooking oil as cutting oil for drilling.  Once that's done, I lined it up to my set up and mark off the mounting holes for the springs.  I used the first mounting bracket as a template for the second piece.

My mounting bracket

I got a bit head of myself without thinking about how to equalize the spring tensions of the four corners. The original screws (metric) have short threads. I only have the full thread screws.  I made a wild guess and used some #8 nuts as thick washers that acts as a stop.

Bottom view of the finished bracket
Heatsink mounted using the backplate that came with the motherboard.

The heatsink fits

How well does it works?  I ran P95 for stress testing the set up with a 3.7GHz Overclock and 1.275V undervoltage. The CPU junction temperature is at 75.3C with CPU at around 131W when all fans are running at 100%.  This is actually slightly better than the other heatsink I was using before for the same PC.

Thermal result on my Ryzen 1700

I decided to swap the old heatsink back and use this heatsink with my Ryzen 5800X PC.  I did some minor clean up to replace the screws with pop rivets to make more height clearance for the motherboard components.  This time I super glued the 4 nuts/spacers in place.  I also have to trim off the top left bracket as it was running a bit too close to the VRM capacitors on my new motherboard (not shown).

Heatsink bracket with some minor clean up.

I ran Cinebench as a way to warm up the thermal paste before removing old heatsink.  I used a 2 fans push-pill configuration trying to get the 5800X thermal under control.

The Before picture with the old heatsink (Thermaltake Contac Silent 12)

Here is the same test again with this heatsink also in a push-pull configuration.

The After thermal with this heatsink (Zalman ENPS10X Optima).

The Zalman is about 2.3C cooler and has a slight higher Cinebench R23 score (15225 vs 15133) as it has a slight higher (thermal throttle) frequency limit (4480MHz vs 4475MHz).

Thermaltake probably sourced a commodity heatsink that have the cutouts that supports a rotated orientation not used here. The bottom part (5mm or so) of the fan is not fully covered by the heatsink allowing for  some airflow under the heatsink. For some reasons, they added fins on the baseplate perpendicular (instead of parallel) to the airflow. This messed up the airflow and collects dust.  They also did not include a pair of clips for adding a second fan.

Zalman fan has a higher top RPM and interesting enough they didn't mill the heatpipe flush with the rest of the aluminium baseplate. The top part of their baseplate is smooth.  This would probably help cool the short VRM heatsink down stream.

Thermaltake heatsink side view. Blue arrow show air flow from fan below the heatsink.

The Zalman in my Ryzen 5800X PC.

P95 stress test at Package Power = 100W


Thursday, December 23, 2021

Flashlight 3xAAA replacement

​I got a flashlight as the first ever kind gesture from my apartment management for the most recent schedule 24+hours maintenance power shutoff. It has a very nice reflector for a square LED and a smaller chip inside that controls the 3 operating modes. 

Off course I had to open it up right away.  It uses 3AAA on the usual battery holders for cheap flashlights.  I smell trouble or an opportunity for some corrective active.  I am not fond of using odd numbers of AAA batteries as I have been using rechargeable since NiCd days.  I don't know if they use a constant current driver, so could be trouble for 3 fully charged NiMH (1.4V x 3 = 4.2V) with low internal resistance.

I used the parts from a 5V booster board I bought from the usual places, but modified the feedback divider for 3V which is just bright enough to drive LED, but low enough to not go into thermal run away.

U1 has the same pin out as the unknown part used on the board.

As my replacement board has 3 contacts - 3V and 2 GND, I had to move the battery off centered to avoid shorting the 3V output to the front of the PCB.  

I used easily soldered and bent metal strips  to form a battery guide and the hinged -ve terminal.  They are used to crimp the end of plastic mesh for store bought onions and garlic.  

My battery terminal help to make better connection between the offset battery and the spring loaded terminal the of the flashlight cap to the right side of the picture below.


It also acts as a pull tab for the PCB assembly when it is time for replacing battery.


Attack of the blinking dimming flashlight

I would never have thought that the blinking dimming light movie tropes is being kept alive by poorly made flashlight clicky switches.

I managed to extract the mechanism that was pressed fitted into the end cap of the flashlight.  They use some iron strips as part of the contact.  There are 2 such contacts in series and they gets even worse as I use the switch for the boost supply with about 3X currents.


I cut2 pieces of gold plated (15um) pin from a 2mm connector.


I soldered them onto the contacts.  The contacts needed to be bent flat as the pins adds extra thickness.


There is a metal piece that looks like a top in the previous picture.  I had to bent the circular part down to make more clearance for the pins. I reassembled the switch and soldered a short piece of bare stranded wires.  This wire helps to make better contact to the side wall of the end cap.


Unfortunately the plastic they used is too soft and I do not have the right jig to press it back in place.  If there were a time I wish I had a 3D printer, this would be it.

Anyways this fix got rid of the flimsy flickers and the light a lot brighter.





DIY Amplifier collection

Here are some of my DIY amplifier collections:

I built one of these back in my school days out of a pair of TI/National Semiconductor's Class A-B LM1875 20-W Audio Power Amplifier. Build straight out of their application circuits. I mounted in 2 of these amplifier into a 60W heatsink.

I recapped, cleaned up the layout and mounted it with a Transformer (33V CT 1A), rectifiers (200V/3A) and filter caps (1000uF x 4) onto a piece of board from a clementine box.  It served as my TV/Computer amplifier for about a year.



It was from the days of good old analog design with honest specs.  Note their 20W is at the lowest THD.  



They have excellent PSSR (Power Supply Rejection Ratio) around 95dB at 120Hz.  I can simply run it off a full wave rectifier from a transformer.  They aren't too efficient, so my choice of 60W heatsink was appropriate for continuous operation of 2 amplifier at full power.


I later built a few of the 60W module out of a pair of TI/National Semiconductor LM3886 68W Class-AB amplifier.  (I didn't have a LC meter, so the inductance value on that coil as way too low.)


Sadly at that point I gave into craze and bought myself a  surround sound receiver. I sworn to rip out and replace the "discrete" amplifier at the expiration date of the warranty, but didn't follow through.

They are probably one of the better if not the best chip amplifier that a lot of the DIY amplifiers designs are based on.

However you would want to use 4ohms speakers to take advantage for the full rated power at low distortion.  


Recently, I started playing around with those Class D modules from China to connect to my computer surround sound analog output.  I tried the $0.30 PAM8403 modules but there was a lot of noise for my rear speaker probably due to the parasitic of the longer cables.  I went for the PAM8610 "10W" modules.  The first one was bad as it took too much design freedom.  

I then read the reviews and moved on to the "better" version of the module that did follow the reference design. I wish they break out the volume control and the balanced input.

I mounted 3 of those modules onto a extruded heatsink from an old monitor.  The heatsink is probably good for up to 10W. I covered area on the bare aluminium heatsink  with "Kapton" tape where I have wire connections.  I used pieces of thermal conductive tape on the thermal vias under the chip to carry heat to the heat sink.  The heatsink tape I used was electrically conductive, so the heatsink and the metal case was grounded because of that.

I ran a power bus with a 1000uF electrolytic cap and a few 1uF ceramic caps near each of the power input of the amplifier blocks.  There is a ferrite bead for each amplifiers to block the high frequency noise injecting back to the VCC bus rail. I didn't have the same layout for the amplifier at the bottom and it was a bit noisier.  The layout in the picture below fixed that.


The heatsink was mounted at the opposite to the messy wiring which helps a bit to balance the drag from the wires.


Here is why i used air quotes on "10W" as I am using a 9V supply, so I would be happy to get 5W out of mine.

The PSRR isn't as good as my other amplifiers.  I actually can hear 60Hz hums using AC transform + rectifier.  I ended up using a good quality 9V 40W brick, so 5W per channel was the best I can hope for anyway.
Either I have insanely good ears for the hiss or the -90dB isn't quite feasible without a lot of work.  I can't hear any noise from my 20W Class A-B.


It is not a perfect set up, but it is good enough for me for now.


Friday, December 10, 2021

NiMH Battery backup

Battery compartment of my digital clock project (Caller ID case)

The power in my apartment used to be very reliable, but things have deteriorated in the last 10 years or so.  I have experienced serval power outage and some up to 6-7 days.

The Supercap I have is only good for a few minutes as the STM8 clock uses around 2mA to keep its firmware RTC working at the minimal state.  It requires a minimum of 3V, so Li coin cells are out. I don't quite trust Li-ion batteries enough to be trickle charge 24/7. 

I use some old NiMH batteries.  They lost most of their capacity, but they are still good for a few mA load. They are sitting in a compartment at the bottom of the clock, so gravity would protect the electronics from any leaks.

Here is a battery backup for the digital clock. +5V is the power source (e.g. USB) that can go away and +UB is the backup rail.


So, NiCd's are super easy to charge. You just throw current into them at about 0.1C, and once they're full, they turn the rest into heat. Harmlessly, and forever. You can just slowly overcharge NiCd and it's fine with that. Lots of old two-way battery cradles did just that, and it's why the radios were always warm when you picked them up. 
Do that to NiMH, and they "vent". NiMH needs charge termination, or needs to be floated at a lower voltage so it never gets quite "full". Right around 1.35 volts per cell seems happy.

You'll notice it a bit funny as the LTC4054ES5 is a Li-ion charger chip and I am using it for NiMH. It turns out that 3 NiMH has just around the same charge voltage as Li-ion battery.  (The minimum charging current for this chip is 50mA.)

The -ES5 part has a recharge threshold of -150mV, so it would starts charging the batteries when they drop to 1.35V each.  It charges the cells at 50mA to about 1.4V and stop charging when the charge current is below 5mA.  

I use a P-MOSFET (Q1) as a switch for the back up rail to reduce the voltage drop vs a Schottky diode.

This has been working for close to half a year now without any leaks.  It also survived a 24+ hour of back out with plenty of  juice left.