Thursday, July 25, 2024

0000 0000 1110 1101

Audiophiles look away now

In the 1970s an uncle of mine spent t-h-o-u-s-a-n-d-s of dollars on audio equipment. High end speakers, valve amplifiers, turntables, tape decks, etc., etc.

I was in awe, and the sound was so amazing as to be akin to a religious experience. He was so into it that he paid for an audio engineer to come in and "ping" his lounge room so that the speakers could be precisely placed in the exact spots to eliminate any dead zones.

Of course his wife shifted them that afternoon due to her interior design concerns. They are not married anymore - coincidence?

Fast forward to 2024 and his nephew (that's me!) has just bought a TDA7297 based amplifier from AliExpress coming in at the princely sum of AU$2.57. Embarrassing - and even more so because it doesn't seem to work.

Or does it?

Also, a colleague at work handed over some ear pod thingies that weren't going the distance in terms of charging - I have no idea what to do to help, and there is now video evidence of that fact!



Friday, July 19, 2024

0000 0000 1110 1100

Mailbag #41 - Droning on and a noisy dog

This is an unusual mailbag in that in amongst some electronics there is the odd drone accessory.

We don't know why.  Enjoy!



Tuesday, July 16, 2024

0000 0000 1110 1011

Primed for discovery

This is not electronics but a weird combination of coding and mathematics! Young children look away now.

Some time ago I thought it might be useful to look for patterns in primes because, well, it's like a mountain to climb! If it's there then you gotta do it.

Also there has been a LOT of work done in this field before.

Here's some light reading:

https://www.nature.com/articles/nature.2016.19550

https://www.scirp.org/journal/paperinformation?paperid=74345

https://www.youtube.com/watch?v=EK32jo7i5LQ

So during a lull in my holidays (?), and after attending a math conference recently, I decided to start a coding journey that examines the position of primes in geometric patterns for both squares and hexagons.

Here's the square version:

from math import sqrt
from turtle import *

xrow = 10
ycol = 11
count = 2
squaresize = 4

tracer(False)
speed("fastest")

pendown()

def isPrime(n):
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            return False
    return True

def makesq():
    forward(squaresize)
    right(90)
    forward(squaresize)
    right(90)
    forward(squaresize)
    right(90)
    forward(squaresize)
    right(90)
    forward(squaresize)
    return    

def turn():
    right(90)
    forward(squaresize)
    return    

fillcolor("red")

begin_fill()
makesq() # 1 is not prime
end_fill()

fillcolor("blue")

while(count < 25000):
    for laying in range(1,xrow):
        if(isPrime(count)):
            begin_fill()
        makesq()
        end_fill()
        count = count + 1
    turn()
    for laying in range(1,ycol):
        if(isPrime(count)):
            begin_fill()
        makesq()
        end_fill()
        count = count + 1
    turn()
    xrow=xrow+1
    ycol=ycol+1

update()

And here is the more interesting hexagon version.

from math import sqrt
from turtle import *
import os
from turtle import Screen, Turtle

height = 900
width = 900
screen = Screen()
screen.setup(width, height)

short = 1

global count
count = 1
hexsize = 10

turnarray = [4,3,3,3,3,2,3]

#tracer(False)
speed("fastest")

pendown()

def isPrime(n):
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            return False
    return True

def makehex(sides):
    for making in range(0,sides):
        forward(hexsize)
        right(60)
    return    

fillcolor("red")

begin_fill()
makehex(6) # 1 is not prime
end_fill()
makehex(2) # 1 is not prime
left(120)
count = count + 1

fillcolor("blue")

def turn():
    global count
    if(isPrime(count)):
        begin_fill()
    makehex(6)
    end_fill()
    makehex(3)
    left(120)
    count = count + 1
    return

def straight(numhex):
    global count
    for length in range(0,numhex):
        if(isPrime(count)):
            begin_fill()
        makehex(6)
        end_fill()
        makehex(2)
        left(120)
        count = count + 1
    return

while(count < 9):
    if(isPrime(count)):
        begin_fill()
    makehex(6)
    end_fill()
    makehex(turnarray[count-2])
    left(120)
    count = count + 1

for layer in range(1,65):
    for sides in range(0,4):
        turn()
        straight(layer)
    turn()
    straight(layer+1)
    turn()
    straight(layer)


update()

Now I'm keen to "fold" the shapes and have a look at the 3D possibilities - anyone with me?



 

Monday, July 15, 2024

0000 0000 1110 1010

All night long

The next phase of the NiMH replacement project is to test if a Super Capacitor can power a PFS154 through the night - pumping out candley goodness via it's three PWM channels.

Since the last video and blog I have continued to work on the code - a subscriber picked up a SNAFU from the last video, and as well I am not yet convinced that the PFS154 is sleeping.

Here's the video - suggestions welcome!