Repairing ZX Spectrum +2A tape deck

On ZX Spectrum +2A I have a tape deck was not working. Well actually it was working, but games were not loading as it seemed like the signal was missing. I will not go into details of disassembling ZX Spectrum +2 as it is pretty obvious. You get access to PCB of tape dec right away, to turn it around You have to unscrew couple of screws and that is all.

Without any deeper investigation after disassembly I decided to do couple of things right away:

  • replace all electrolytic capacitors with new ones,
  • replace HA17324 operation amplifier with LM324

But unfortunately and to my surprise, after this hassle nothing changed, still the same issue.

Then I noticed that something wrong with the powering on the board and it seems like the ground was missing.

After some further investigation, I have found that ground on the board was delivered by two bold that was holding the board, as the board was removed, there was no ground in one part of the board. And maybe due to oxidation or something like that ground initially was an issue. I have inserted back HA17324, added a jumper between grounds just to be sure and it seems problems were solved.

So here You go, if You have ZX Spectrum +2 tape working but no signal, check ground first.

 

LCR-T4 transistor tester original firmware

Bought cheap transistor tester from eBay and currently experimenting with firmware updates.

I was able to program it with this version of Markus transistor tester firmware:

https://github.com/svn2github/transistortester/tree/master/Software/trunk/mega328_T4_v2_st7565

To build, use a WinAVR programmers notepad, open Makefile and select Tools->Make all.

At first, was getting weir errors, but after adding msys-1.0.dll to \WinAVR-20100110\utils\bin everything built ok.

Before doing firmware experiments, I have made backup of original firmware, if somebody needs it, you can download it here:

Code

Data

Config

I tried to reflash original firmware and it worked fine.

For programming I use my MiniPro programmer.

Modify Arduino 5v relay module to work from 3.3v

I am implementing a power-off function for my Ender 3 using OctoPi. For that, I need a relay and I happened to have one.

Relay module I had
Relay module I had

Unfortunately, after connection relay to Raspberry Pi GPIO pin, the relay was always on and not listening to any commands from OctoPi.

It appears this module was designed for 5v logic levels and Raspberry Pi works with 3.3v logic levels.

After investigating relay one can see that its circuit is:

Original schematics of relay module
Original schematics of relay module

For JC817C forward voltage Vf=1.2V and forward current If=20mA

For Raspberry Pi output high (when VDD is 3.3V) is VO=2.3V 17mA

So, it seems that the output of Raspberry Pi is not enough to drive JC817C.

To solve this I decided to remove optocoupler from the module and connect the input pin directly to Q1 transistors base.

Modified relay module
Modified relay module
Relay module with optocoupler replaced by resistor
Relay module with optocoupler replaced by a resistor

To connect the output pin to a transistor you should limit output to appropriate current. You can do that by choosing the appropriate resistor value.

I calculated it like that.

From S8050 (J3Y) transistors datasheet:  DC current gain hfe ~ 120

From relay datasheet: Rrelay=70Ohm Vrelay=5V so calculated Irelay=Vrelay/Rrelay=5/70=71mA

Let’s choose Ic=100mA

To turn it on, we must have ~ Ib=Ic/120=100mA/120=833uA ~800uA

Vbe usually is ~0.7V

R9 voltage would be Vr9=Vinput-Vbe=3.3V-0.7V=2.6V

R9=Vr9/Ib=2.6V/800uA~3.2K

So I chose 3K resistor.

 

 

Learning the Art of Electronics, Week 2

 2L1.1

Ok, I  form a simple low pass filter using unknown RC values.

Then I measure time constant using scope and 500Hz square wave. Time constant is a time it takes for a voltage to reach ~63% of its total value.

Measured time constant using RIGOL DS1054z is 0.268ms

( measured using manual cursors: I set Percent for Vert. Units, then Set range of the wave with vertical cursors and then measure time to rise to ~63% (bx-by) )

Measured time constant using Tektronix 2221A is 0.270ms

( I position the wave from 0 to 100% and then using cursors get ▲T for ▲V to reach 63.2% )

t = RC

Now I need to find R. And task is to measure R without removing C.

We can do that by imagining that RC is just R, but we have to eliminate XC. We can do that by increasing frequency unti we get no phase shift. The higher the frequency the less XC there is. We can see that XC is not effective anymore when we see no more phase shift.

I add a known 1K resistor in front of RC filter.

Apply sine wave and increase frequency to such that there is not phase shift – it means we are now observing R and not Xc ( Xc ~ 0 ).

In scope I see input 5.12v and output 4.12v.

Using Ohms law: we loose 1V on R1 so current is 0.001A.

Knowing the current I calculate R2 and it is R2=Vout/I=4/0.001=4K

So R2 is ~4k

0.270ms = 4k x C

C = t / R = 0.270ms / 4k ~ 68nF

Actual values were 3.7K resistor and 683 capacitor (68nF).

2L1.2 Differentiator

Yellow input, blue output. Differentiator shows rate of change. We can examine it by applying sine, square and triangular waves to the input.

Especially it is seen by applying square wave. On rising edge or falling edge rate of change is very high.

On triangular wave rate of change is constant, just different directions so on the output we get square wave.

Its a high pass filter, so at f=0 impedance should be infinite, and at infinite f there should be no impedance, or impedance should be minimal.

2L1.3 Integrator

2L2 Frequency domain view

2L2.1 Low pass filter

I made such low pass filter:

By changing frequancy I found when the output voltage is attenuated by 3db i.e. is 0.7 of its original value. That frequency was 160Hz

Calculation confirms that f3db = 1 / (2×π×10k×0.1uF) = 159Hz

Result at 10 x f3db

Result at 20 x f3db:

Result at 2 x f3db:

Result at 4 x f3db:

Voltage vs f, the higher frequency the bigger attenuation.

2L2.2 High pass filter

f3db should be the same: f3db = 1 / (2×π×10k×0.1uF) = 159Hz

Rendered by QuickLaTeX.com

Learning the Art Of Electronics

I have decided to get my self together and systematize my knowledge of electronics. It is very similar situation as for this guy. Electronics is my hobby. And actually one of many hobbies. I would say I have a lot of knowledge it but there are plenty of gaps and places just for intuition. Especially in circuit design.

Once I have purchased a book “Learning The art Of Electronics” and used it as reference for this and that but never when through it.

But this is it.

My goal is to complete one lab at least once a week and post a report here.

Hopefully I will make it through 🙂

 

Essential toolkit from iFixIt

Love this toolkit. Nice packaging, tools seem quality made and should last more that one disassembly. Nice job iFixIt!

iFixIt tool kit
iFixIt tool kit
iFixIt tool kit
iFixIt tool kit
iFixIt tool kit
iFixIt tool kit

Kit Includes:
Custom iFixit Bit Driver
Angled Precision Tweezers
Spudger
Jimmy
iFixit Opening Tool
iFixit Opening Picks set of 6
Suction Handle
Easy-to-Open Magnetized Case
Lid with Built-in Sorting Tray
Sixteen 4 mm Precision Screwdriver Bits:
Phillips – 000, 00, 0, 1
Pentalobe – P2, P5
Flathead – 1, 2.5, 4 mm
Torx – T4, T5
Torx Security – TR6, TR8, TR10
Tri-Point – Y000
SIM Eject Bit

Making an adjustable “lab” power supply from scrap

Had an old power supply board lying around that was ripped from dead/old printer. PSU model is CZ57PSE EPSON

C257PSE

To make it work one should connect PSC line to ground.

Schematics of similar power supply:

CZ57PSE schematics
CZ57PSE schematics

To regulate output, made an adjustable voltage regulator using LM2575 that was ripped of some dead router or something similar:

lm2575
lm2575

Finished power supply in a box:

Regulated power supply
Regulated power supply
Regulated power supply
Regulated power supply
Regulated power supply
Regulated power supply
Regulated power supply
Regulated power supply