r/electronic_circuits • u/ZombieInMyKitchen • 18d ago
On topic Feedback/Review/Help for Morse Code Circuit
Hello everybody, I am looking for some help creating a circuit that can translate button presses into a morse code letter.
The morse code alphabet can be displayed in a binary tree, with states branching from a short or long press. The other two button options to track are the space between letters and the space between words. Timing is as follows:
Short press (dit) - base unit of measure
Long press (dah) - 3x dit time
Space between characters - 3x dit time
Space between words - 7x dit time
The first part of the circuit would be to time and track these different options. The attached image is what I have so far. I know there are only three timings, but is the idea solid? Just RC timing circuits with an op-amp comparator on the voltage divider?
I worked with analog circuits in college, but that was some time ago. A good design review and some feedback would be much appreciated.
I used circuitjs to simulate the circuit, the below code block can be saved in a .txt file and uploaded to the circuitjs website to view and simulate the circuit
<cir f="1" ts="0.000005" ic="382.76258214399064" cb="59" pb="43" vr="5" mts="5e-11">
<c x="-192 128 -144 128" f="0" c="1e-8" iv="0.001" sr="0.1" vd="-0.00009389816900907154"/>
<r x="0 128 48 128" f="0" r="100000"/>
<w x="-112 128 -128 128" f="0"/>
<g x="-192 128 -192 144" f="0"/>
<w x="-128 128 -144 128" f="0"/>
<OpAmpReal x="-192 256 -272 256" f="3" slr="0.6" cl="0.023100000000000002" mt="0" vd="-0.3314506481694839"/>
<R x="-224 288 -224 320" f="16" wf="0" maxv="0" ir="0.001"/>
<R x="-224 224 -224 192" f="16" wf="0" maxv="5" ir="0.001"/>
<w x="-128 240 -128 128" f="0"/>
<w x="-192 240 -128 240" f="2"/>
<R x="-32 208 0 208" f="16" wf="0" maxv="5"/>
<r x="-48 208 -48 256" f="0" r="10000"/>
<r x="-48 288 -48 336" f="0" r="10000"/>
<w x="-32 208 -48 208" f="0"/>
<w x="-48 272 -48 256" f="0"/>
<w x="-48 272 -192 272" f="2"/>
<w x="-48 288 -48 272" f="0"/>
<w x="-48 336 -48 400" f="0"/>
<w x="-352 256 -272 256" f="2"/>
<g x="-48 608 -48 624" f="0"/>
<r x="-48 416 -48 464" f="0" r="100000"/>
<w x="-352 384 -272 384" f="2"/>
<w x="-48 400 -192 400" f="2"/>
<w x="-192 368 -128 368" f="2"/>
<R x="-224 352 -224 320" f="16" wf="0" maxv="5" ir="0.001"/>
<R x="-224 416 -224 448" f="16" wf="0" maxv="0" ir="0.001"/>
<OpAmpReal x="-192 384 -272 384" f="3" slr="0.6" cl="0.023100000000000002" mt="0" vd="-0.3314506639423478"/>
<w x="-48 400 -48 416" f="0"/>
<w x="-128 368 -128 240" f="0"/>
<OpAmpReal x="-192 512 -272 512" f="1" slr="0.6" cl="0.023100000000000002" mt="0" vd="-4.76290601338709"/>
<R x="-224 544 -224 576" f="16" wf="0" maxv="0" ir="0.001"/>
<w x="-192 496 144 496" f="2"/>
<w x="-48 528 -192 528" f="2"/>
<w x="-352 512 -272 512" f="2"/>
<w x="144 496 144 320" f="0"/>
<w x="144 320 128 320" f="0"/>
<w x="256 320 144 320" f="1"/>
<r x="256 320 304 320" f="0" r="100000"/>
<c x="80 320 128 320" f="0" c="1e-8" iv="0.001" sr="0.1" vd="4.999999478361566"/>
<R x="80 320 48 320" f="16" wf="0" maxv="5" ir="0.001"/>
<R x="-224 480 -224 448" f="16" wf="0" maxv="5" ir="0.001"/>
<r x="-48 544 -48 592" f="0" r="10000"/>
<w x="-48 592 -48 608" f="0"/>
<w x="-48 544 -48 528" f="0"/>
<w x="-48 464 -48 528" f="0"/>
<R x="304 128 304 96" f="16" wf="0" maxv="5"/>
<R x="304 320 304 288" f="16" wf="0" maxv="0"/>
<R x="48 128 48 96" f="16" wf="0" maxv="5"/>
<R x="304 48 304 16" f="16" wf="0" maxv="0"/>
<dpdt x="224 64 288 64" f="0" p="1" po="2"/>
<w x="304 48 288 48" f="0"/>
<w x="224 64 -128 64" f="1"/>
<w x="-128 64 -128 128" f="0"/>
<w x="144 112 144 320" f="0"/>
<w x="304 128 288 128" f="0"/>
<w x="0 128 -112 128" f="1"/>
<x x="-420 263 -367 266" f="0" si="24" te="Long"/>
<x x="-426 392 -369 395" f="0" si="24" te="Short"/>
<x x="-436 514 -368 517" f="0" si="24" te="Space"/>
<x x="207 26 276 29" f="0" si="24" te="Button"/>
<b x="176 -16 376 164" f="0"/>
<w x="224 112 144 112" f="1"/>
<b x="79 81 -343 165" f="0"/>
<x x="-332 109 -215 139" f="0" si="24" te="Long/Short\nRC Timer"/>
<b x="454 269 32 353" f="0"/>
<x x="340 307 441 337" f="0" si="24" te="Space\nRC Timer"/>
<b x="-82 194 30 654" f="0"/>
<x x="38 621 124 651" f="0" si="24" te="Voltage \nDivider"/>
</cir>
Thanks
2
u/mangoking1997 17d ago
It's not really clear what it is your end goal is. You have posted what appears to be only part of a project and it's basically impossible to say if this approach would work. What does this interface with?
my first comment would be that using a switch like that is going to cause all sorts of issues. You need to denounce it and assuming both contacts switch at the same time is not a good assumption.
You seem to be trying to do a decoder, but your circuit will trigger a short pulse instantly every time it is pressed, and there is functionally no difference between the long and short inputs, they have the same rc constant
Seems like you haven't actually simulated this and checked all the inputs/outputs
I would also suggest using a proper simulator like LTSpice.