Category Archives: Computer

Too many services/ports/ip numbers in your network to remember?

Use a web server with a simple php script.

<?php
$host = $_SERVER['HTTP_HOST'];

$redirects = [
    'torrent.local'     => 'http://192.168.1.1:9091/',
    'nzb.local'     => 'http://192.168.1.1:8080/',
    'squeezebox.local'  => 'https://192.168.1.2:9000/',
    'squeeze.local'  => 'https://192.168.1.2:9000/',
];

if (isset($redirects[$host])) {
    header("Location: " . $redirects[$host], true, 302);
    exit;
}

http_response_code(404);
echo "Unknown host";

Add your webservers IP number to your local DNS server or hosts file

192.168.1.4 torrent.local
192.168.1.4 nzb.local
192.168.1.4 squeeze.local
192.168.1.4 squeezebox.local

Now you can use http://nzb.local in your browser and you will be redirected to http://serverip:port
No need to remember IP numbers or ports

Made a JavaScript plugin for Hydra

Control your effects using MQTT.

You can add anything to control your effects using RotaryEncoders, sensors and other data values.

I’m fixing the code to make use of free MQTT servers on the internet.
Then I’ll post the JavaScript in the Hydra forum or discord.


Calling the JavaScript in https://hydra.ojack.xyz/ website

https://gist.githubusercontent.com/fashice/2098d1301117b86caed94aca8f2101ff/raw/7d2a7300e7ddf42d4f1793f693dbb517e09bd2d8/gistfile1.txt
change mqtt server and add to hydra using
await loadScript("https://domain/script.js¨);

Giving people ability to control my Xmas lights

At the WHY2025 hackers event, we used bigred’s antenna pole to make a huge sign using leds.

It gave me the idea to make a pole which displays digital “fireworks” using leds.
Fireworks are becoming illegal the next year in the Netherlands, I think.

So why not going digital?
12 Meter pole, 300 Leds.

There is a QR code and a website link mentioned on a page at the gate.
10 presets to select via a website.

Notification on my TV

While waiting for the first visitor I made a magnetic game.
Using a bunch of magnets, and 3D printed hexagon rings.
Two players try to place magnets in a small area without moving the others. If magnets slam together, you have more pieces to place.
(Below, last player has to take those 6 pieces)

CODE for website index.html

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>WLED Mast</title>

<style>
body {
    background: #111;
    color: #fff;
    font-family: Arial;
    margin: 0;
    padding: 20px;
    text-align: center;
}
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}
button {
    padding: 25px;
    font-size: 22px;
    border-radius: 20px;
    border: none;
    background: #333;
    color: #fff;
    font-weight: bold;
}
button:active {
    background: #555;
}
</style>
</head>

<body>

<h1>WLED Mast</h1>

<div class="grid">
    <button onclick="run('b1')">off</button>
    <button onclick="run('b2')">fireworks</button>
    <button onclick="run('b3')">sound<BR>reactive</button>
    <button onclick="run('b4')">bounch-balls</button>
    <button onclick="run('b5')">fire</button>
    <button onclick="run('b6')">juggle</button>
    <button onclick="run('b7')">swing</button>
    <button onclick="run('b8')">sparkle</button>
    <button onclick="run('b9')">popcorn</button>
    <button onclick="run('b10')">comet</button>
</div>

<script>
const API_KEY = "misuse-prevent";

function run(action) {
    fetch(`/action.php?action=${action}&key=${API_KEY}`)
        .then(r => r.json())
        .then(j => console.log(j))
        .catch(err => alert("Error"));
}
</script>

</body>
</html>

CODE for Wled API

<?php

$public_api_key = "misuse-prevent";
if (!isset($_GET['key']) || $_GET['key'] !== $public_api_key) {
    http_response_code(401);
    die("Unauthorized");
}

$action = $_GET['action'] ?? null;

// Map 10 buttons → WLED preset numbers
$allowed_actions = [
    "b1"  => 19,
    "b2"  => 22,
    "b3"  => 23,
    "b4"  => 20,
    "b5"  => 21,
    "b6"  => 3,
    "b7"  => 8,
    "b8"  => 2,
    "b9"  => 4,
    "b10" => 14
];

if (!$action || !isset($allowed_actions[$action])) {
    http_response_code(400);
    die("Invalid action");
}

$preset = $allowed_actions[$action];

// ---- WLED IP address ----
$wled_ip = "http://WLEDDEVICEIP";   // <-- CHANGE THIS

// API endpoint
$url = $wled_ip . "/win&PL=" . $preset;

// Call WLED directly
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_TIMEOUT, 2);

$response = curl_exec($ch);
$error = curl_error($ch);
curl_close($ch);

header("Content-Type: application/json");

if ($error) {
    echo json_encode(["ok" => false, "error" => $error]);
} else {
    echo json_encode(["ok" => true, "preset" => $preset]);
}

An idea I had to detect and count pages

One of my old ideas, never made or tested.
I saw a post on Reddit with this question, I decided to post a little drawing using my idea.

Center of below picture shows pages (the lines), with coppertape going front to back and connect to following page

Inductive copper tape

Taking resistors of the same value, you’ll get a logarithmic voltage divider.
If you want the values evenly spaced, to make sure you are not misreading the value you have to make the resistors more like:
10k,6k,3k3,2k5,2k,1k68,1k5

Working on a (C64) handheld probe oscilloscope

These will be available in my shop.

Probably a webpage with measured examples are usefull.

There is a cover for the pogo pin which holds the ground clamp

Handheld device to measure voltages and make screenshots using an application.

Control over serial

  • Select USB device to connect
  • Start a capture to screen
  • Clear (redraw probe screen)
  • Rotate screen for left/right-handed people and easy reading
  • Sample time speed in microseconds
  • 5V reading but 15 volt tolerant, due to the SID pins
  • ??? love to hear ideas

I’m currently working on streaming output.

Below, an example of screenshotting.

Below, measuring outputs from a NE555 (dutch comments)

Working on the garden lights POC

Working on my garden lights

Working 12V relay bottom left, and upper right the Raspberry $ compute module board with NodeRed.

I made a little board to program the ATTiny85.

The RS485 chip I wanted to use (SN65HVD3082) came as SMD, luckily I have some SMD to THT/DIL boards. (breakoff)

Above on the breadboard : The SN65HVD3082EP on a little pcb, the ATTiny85 .
4×4 WS2812 led matrix will be my dimmable RGB garden light.

Easy cheap touch light

Remember those expensive touch lights you can buy?

This is a less than 5 euro version.

Warning : Some tricks I used

  • Using D5 as GND (I didn’t want to splice GND Wire.)
  • Using PWM for dimming
  • Using 5V led, use resistor if using a generic LED (220ohm)

TTP223 sensors are only a few cents!
And react even without touching (< 5mm)
So, you can build this in a case or behind fabric!

NOTE: If you are using an ESP32 you can configure a pin as touch!!!
So no TTP223 needed.
But ESP32 are more expensive as Wemos mini.

Code:

#define TOUCH_PIN D2 // My video has D7
#define LED_PIN   D6
#define FAKE_GND D5

// Brightness steps (0 = off, 255 = full bright)
int brightnessLevels[] = {0, 25, 125, 255};
int currentLevel = 0;
bool lastTouchState = LOW;

void setup() {
  
  pinMode(TOUCH_PIN, INPUT);
  pinMode(LED_PIN, OUTPUT);
  pinMode(FAKE_GND, OUTPUT);

  digitalWrite(FAKE_GND, LOW);  
  analogWrite(LED_PIN, brightnessLevels[currentLevel]);  // start OFF
}

void loop() {
  bool touchState = digitalRead(TOUCH_PIN);

    if (touchState == HIGH && lastTouchState == LOW) {
      // Advance brightness step
      currentLevel = (currentLevel + 1) % 4;  // 0-3 steps
      int pwmValue = brightnessLevels[currentLevel];
      analogWrite(LED_PIN, pwmValue);
    }

  lastTouchState = touchState;
}

Dim levels less obvious on recording, but you can change the levels in the code!

DIY Garden Lights.

We are planning to redo our garden. And I am making a water and light plan for it.

I thought I could do it myself using 12V and RS485/Modbus.

So these are my plans. (NOTE, this is a work in progress)

I’m going to put 4-wire ground cable in our garden, and a RS485/Modbus master controller in my shed.
4 Wires will have 12V low voltage, ground and RS485 A/B wires.
This way I can control till 64 devices on a single cable.

Below, a USB stick to connect the RS485 cables to a Raspberry Pi?
Software is probably going to be a NodeRed instance connected to Home Assistant.

On/Off lights using a RS485 board and relay. These can be bought on a single PCB and can control 220V. I am probably going to use generic outside lamps and refit them for 12V led or 220v, with those RS485 controllers.

The above left part will be encased in resin or alike.
Right PCB is for testing only.

For dimming RGB lights, I made the below design.

NOTE: This needs 120ohm end resistor and capacitors over the 7805.

12V to 5V using a 7805, RS485 8pin DIL/DIP and a ATTiny85 8pin DIL/DIP. Plus a 4×4 RGB Matrix.
These also encased in resin.

More information on the ATTiny85 and programmer can be found here:

Modbus using NodeRed (I’ve used this to control my RD6006 Lab Power Supply)

Bare minimal to control the relay.

HA control via MQTT

C64 ROM switcher, Hidden cam viewer, Motorized fader pot and PCB sponsor

Lol, got an email from a PCB sponsor!

Deeply impressed by your blog content which means a lot to electronic enthusiasts.
I'd like to sponsor your project by providing free PCB prototyping,

ROM SWITCHER

I made a rom switcher in the past.
Now I’m using an Arduino to switch Kernal and Character rom.
(Partly idea from Adrian)

Where the F* is my schematic. Ah here it is.

Above right picture:

  • Tactile button (emulates restore key)
  • Red led – reset
  • Yellow led – Exrom
  • Blue leds, Address lines select ROM part in 27512 EPROM
  • Green leds, Address lines select ROM part Character ROM

Motorized Fader Potentiometer

I don’t trust some B&B’s so I made a camera detector.
(I always scan the wifi and Access Points)
This one lets you know if there are IR enabled camera’s.
(Night vision)

Picture 1:

  • 1 = org camera module, IR filter is hard to remove. (See pink color)
  • 2 = other module, IR filter is at bottom
  • 3 = IR Filter, I removed this.

Picture 2:

IR light blast from a “hidden” camera. (I need to adjust focus of lens)