« ‹2 3 4 5 6 7 »

handskar2

2023-07-12 23:43 electronics

Another simple and minimal circuit built around the ESP-WROOM-32 DEV KIT module. This one is for taking in data from eight touch sensors and send that over WiFi (Open Sound Control) or serial to a laptop.

With the three pin headers the ESP32 can be configured to...

  1. not use WiFi at all,
  2. create a WiFi access point (SOFTAP),
  3. connect to an existing WiFi network.

Serial output via USB is always active.

The board is powered with a micro USB cable. Connected to a powerbank the whole thing is wireless.

handskar2 photo

Schematics, firmware and SuperCollider + MaxMSP example code attached.

Attachments:
handskar2_schematics.pdf
handskar2_firmware.zip
handskar2_examples.zip

f0pwm

2023-07-09 21:53 electronics

This board is built around the ESP-WROOM-32 DEV KIT module and has 20 pulse-width modulation outputs. These outputs can be controlled wirelessly via Open Sound Control (OSC) or using the serial port (micro USB cable). Examples of usage: dim high power LEDs, control the speed of DC motors, turn on and off solenoids. Supply voltage between 7V and 36V, duty-cycle resolution is 10-bits and the frequency adjustable from 1 Hz to about 70 kHz.

The last four outputs (16-19) are bit-banged. That means they have some jitter and will not be as stable in frequency as the other outputs (0-15). Also the bit-banged ones can not go above 1 kHz, but for most applications they will function good enough.

The MOSFETs are powerful and all connections on the backside are tinned extra thick, so they will be able to drive quit a few amps.

f0pwm photo top f0pwm photo bottom

Schematics, firmware and SuperCollider + MaxMSP example code attached.

Attachments:
f0pwm_schematics.pdf
f0pwm_firmware.zip
f0pwm_examples.zip

RPi1 as a simple video player

2023-03-23 18:43 visuals

Just some notes while setting up a video looper on an old Raspberry Pi 1...

ssh root@192.168.1.107  #edit IP, default password is dietpi
apt-get update
apt-get install openssh-client vlc
usermod -a -G audio,video dietpi
exit
scp mymovie.mp4 dietpi@192.168.1.107:

Finally log in as user dietpi and set up VLC to autostart...

ssh dietpi@192.168.1.107  #edit IP
crontab -l | { cat; echo "@reboot cvlc --loop --audio-desync=-100 mymovie.mp4"; } | crontab -
sudo reboot

This should loop a video file in fullscreen with sound output via HDMI. --audio-desync is optional and can be used to sync the audio to the video track (here audio is adjusted to be 100 milliseconds early). mymovie.mp4 is the file name of your movie.


Speaker Pot

2022-07-16 11:25 electronics

As part of the outdoor installation Pop-Up-Sound-Garden, I wanted to put a speaker inside a massiv concrete drain pipe.

speaker in a concrete pipe

I found an unused flower pot that happened to fit the speaker element I had at hand perfectly, and inside the pot there was enough room to add electronics. So this flower pot now runs on 12V and contains a Raspberry Pi Zero W with a USB sound card, a DC-DC converter, and a 3W amplifier. On the Rpi I installed piCore Linux and SuperCollider.

speaker in a pot

The music that SuperCollider is generating is based on tweet0406 with some added bass notes. It all sounds pretty good and loud for such a small mono speaker setup.

Finally, I attached a distance sensor so that the synthetic sounds only start playing when someone passes by or stands in front of the speaker.


f0dist - Wireless Distance sensor OSC

2022-07-04 21:26 electronics

Yet another simple wireless sensor circuit that sends Open Sound Control messages. Here the sensor is the VL53L1X time-of-flight laser module and the microcontroller an ESP8266-01 - all powered by two AA batteries.

There are settings for smoothing, update rate and thresholds which can be controlled by sending OSC messages to the ESP module. See the examples.

Under optimal conditions the sensor can measure accurately up to 4 meters, but in practice I found the maximal range to be more around 3 meters. Speed and precision is fantastic though. It reacts very fast and with millimeter resolution.

Attached below are examples for SuperCollider and MaxMSPJitter, schematics and the firmware (PlatformIO).

distance sensor distance sensor out in the wild
Attachments:
f0dist-examples.zip
f0dist-schematics.pdf
f0dist-firmware.zip

iMac G3 restoration - Tripple Boot

2021-12-20 14:01 other

This old Blueberry iMac G3 350 MHz was given to me for free many years ago and last winter I finally got around to fixing it up.

iMac G3 blueberry

Trippel booting

I set up the machine with three different operating systems...

and this computer I use for running various software from back in the days - mostly audio applications like SuperCollider 2.2.16, MaxMSP 4.0.9 with nato.0+55+3d, Mosaic 1.58 and Digital Performer 2.7.
The machine runs well and feels snappy despite it being so old. I optimised Mac OS X Tiger a bit by turning off Spotlight and Dock animations and I also installed ShadowKiller. In Mac OS 9 I removed some unnecessary extensions. OpenBSD is using the lightweight window manager dwm and in order to get the ATI Rage 128 graphics card working I configured Xorg as described in this forum post.

Battery

The internal 1/2 AA PRAM battery was dead and I replaced it with a CR2032 coin cell. The holder for the coin cell I soldered right on top of and across the old holder. It should be easy to remove and restore the original battery if ever needed.

iMac G3 battery holder

Recap

Some of the electrolytic capacitors inside looked suspicious and bulged so I replaced the seven SMD variants I found on the motherboard. The big through hole capacitors in the power supply section I left untouched. They seemed okay.

SSD

The old spinning hard disk was replaced with an SSD. To connect the SSD I bought an IDE to SATA adapter and used the existing 40-pin and power cables. I used velcro to fixate the SSD in place.

iMac G3 motherboard

Unfortunately, this type of IDE adaptor is a bottleneck and will make the SSD underperform. Xbench report that the SSD perform only marginally faster than the original HDD for sequential reading and writing. Random access read/write on the other hand perform 4.5x faster. Taken together, the SSD is not more than around twice as fast as the HDD. Still, it was worth the cost and hassle to swap out the old spinning hard drive. A big plus is that the machine now runs completely silent.

TYPE                SSD       HDD
sequential         44.86  /  39.71
random r/w        136.77  /  30.36
overall disk test  67.56  /  34.41

Freeze issue

I had a strange problem with the OS X system freezing at random times. I suspected the SSD adaptor and the power supply. By coincidence, I later noticed it would take longer until it froze if I only worked in the terminal. As soon as I touched the mouse, the system would lock up. So I tried replacing the optical tracking mouse (manufactured by sempre - model MOU-1T) with the original puck mouse, and then the system ran flawlessly. So the LED mouse caused the system to freeze!
This modern optical tracking mouse must be generating current spikes that the USB port can not handle.

Other things fixed

Things still broken

Conclusion iMac G3

Even though this is such an old and slow machine (22 years, 350 MHz), it is a lot of fun to use and play around with. It can also be of use as it runs some software that no longer exists and the CRT display gives out a warm nostalgic feeling.
A drawback is that it draws a lot of power. 75-85 Watts in use (mainly depending on screen brightness), 64 Watts in standby (sleep mode with CRT off) and 5.5 Watts when powered off! The change to SSD helped reduce power consumption a little bit (around 8 Watts), but overall it is still high compared to, for example, a Raspberry Pi.

Total cost of restoration: €32

Updates:


MacBook Pro restoration - Kitchen Radio

2021-12-13 14:24 other

My 14-years old MacBook Pro Core 2 Duo/Late 2006 is since a year acting as a kitchen radio.

The laptop is set up to dual-boot Mac OS X 10.6.8 Snow Leopard and FreeBSD (13.0 at the moment) via the rEFInd boot manager. Though I end up using OS X most of the time just because it boots a lot faster. The battery pack is dead so I need to power it on and off each time I use it.

SpiderWeb is my browser of choice, but I also have ArticFox and InterWeb installed. Performance is alright and I can stream radio and play YouTube videos in 480p - my preferred quality setting. In FreeBSD, I run a recent version of Firefox.

The computer is connected to a set of external computer speakers - a 2.1 subwoofer system - that I got for free and had laying around.

Internet access is handled via WiFi (AirPort Extreme) and the DVD burner (SuperDrive), Bluetooth, microphone, speakers, trackpad, sensors and the camera (iSight) all work.

But this laptop has had a hard life and was with me on many adventures. Quite a few things were broken and I had to repair the keyboard, battery, power supply and fans.

Keyboard repair

The machine suffered a beer accident in Japan in 2008 and after that about a third of the keys on the keyboard wouldn't work. I kept using it for several years with the help of an external USB keyboard.

Last winter I spent a lot of time trying to finally repair this broken keyboard using a multimeter, tape and thin conductive wire...

Many tracks were broken and corroded but amazingly I got it to work! At one moment, all keys functioned except the led in the caps-lock that wouldn't light up. Also, during the repair, I broke off one of the springy supports for the space bar, so it tilted and didn't react on the left-hand side. Very irritating and impossible to fix (at least by me).

And my repair attempt didn't last. After about a month, a few keys started acting funny, intermittent and finally wouldn't work at all. When even more keys broke, I gave up and ordered a replacement keyboard for this model (A1211) on AliExpress.

Fans repair

The right-hand side fan needed repair. It was stuck as the casing somehow got dented. I cleaned both fans thoroughly and added new silicone grease.

Memory upgrade

I maxed out the RAM by buying two 2 GB memory modules on eBay. There is an issue with this machine though as it can not address more than 3 GB. So even if I now have 4 GB installed, only 3 can be used.

Other things

Conclusion MacBook Pro

The machine uses between 20 and 35 Watts in standard operation, and the cost of fixing it up was around €40 in total. It gets a lot of use and will probably last many years to come.


TiBook restoration - Offline Laptop

2021-12-10 21:04 other

Last autumn I spent time restoring my old computers. I wanted to start using them for various things again. One, a 20-years old Titanium PowerBook G4 667 MHz, was in good shape and didn't need much work. My idea was to have it as an offline laptop - a distraction-free machine for reading e-books and playing around with a BSD operating system.

offline laptop

I thoroughly cleaned the keyboard and removed dust from inside the fan and air vents. I also replaced the old thermal paste with new. That required some work because to get access to the CPU and heatsink on these models one need to unscrew and disconnect nearly everything inside. But it was interesting and worth the effort. This computer now runs cool and the fan hardly ever turns on. The good guide on iFixit was helpful.

In the process, I also replaced the hard disk with a 16 GB Asiproper mSATA SSD and an mSATA to 2,5" 44pin IDE adapter. That made the laptop faster overall and also made it run much quieter. The old spinning hard disk was quite noisy. There is now only a tiny vining sound during operation (from a coil I believe), but that does not bother me much.

The laptop battery was dead so I removed it and recycled the cells. It is a slight annoyance to have the laptop plugged in with the power adapter cable at all times. I might try to reconstruct the battery pack with new LiPo 18650 cells.
Another drawback with an old PPC machine like this is that its current consumption is fairly high - at least compared to how slow it computes. In use, this laptop draw 21-35 Watts depending on the screen brightness and what I do with the computer, and when completely powered off 3.8 Watts! So I make sure to always unplug it when I'm done using it.

The built-in speakers and the matte display are okay, the DVD player is working and the trackpad and keyboard are very nice to use. It is a joy to type on this laptop and without the battery, the machine doesn't weigh much.

The display hinges feel good but I take extra care not to twist or put stress on the lid as I know these can break on these PowerBook models.

There is 512 MB of RAM installed (2 x 256 modules). I thought of buying more and upgrading to the maximum of 1 GB, but these types of SO-DIMM memory modules are both hard to find and I feel I can't justify the cost as the operating system I'm running (see below) uses less than 70 MB.

Whenever I need to transfer files or get network access I connect an ethernet cable. There is no WiFi or Bluetooth. It should be inconvenient to get online - it's a feature.

OpenBSD

For the operating system, I picked OpenBSD. Mainly because I wanted to study and learn more about it, but also because it is still updated and supported for PPC 32-bit machines.
In the process, I also tried FreeBSD, MintPPC, VoidLinuxPPC, Debian and Adelie Linux but encountered various problems. Nothing worked as good and was as easy to install as OpenBSD. Mac OS9 or OSX (10.4 perhaps) would have been other options, but I already have several machines that run these systems.

The following instructions show how to set up OpenBSD version 7.0 on a macppc laptop using another laptop plus a USB stick to prepare the installer.

Note: The internal hard disk will be erased and overwritten.

Preparation and Open Firmware boot

On another machine (here macOS):

Now move the USB stick over to the PowerBook for installation and...

If that does not work try changing from usb0 to usb1 in the line above. Also, note the space after ofwboot and perhaps edit 7.0 to match the version you downloaded.

The laptop should now have booted and started the OpenBSD installer.

Installation

This is easy. Just answer some questions accepting the default answer for the most part. For this PowerBook, there were only two things I choose to do differently: said yes to start X window system by xenodm and said yes to continue without verification.

i #for Install
HOSTNAME #system hostname?
[gem0] #network interface
[autoconf] #IPv4 address
[none] #IPv6 address
[done]
PASSWORD #for root account
[yes] #start sshd by default?
yes #X window system started by xenodm?
[no] #change default console?
USERNAME #for user account
FULL NAME
PASSWORD
[no] #allow root ssh login?
[wd0] #wd0 is internal SSD disk, sd0 is USB
[MBR]
[yes]
[whole] #use whole disk
[a] #auto layout
[done]
disk #location of sets?
no #already mounted
[sd0] #which disk contains the install media?
[7.0/macppc] #pathname to the sets?
[done]
yes #continue without verification?
[done]
Europe/Berlin #enter a valid timezone
[done]
[reboot] #press and hold down O+F+CMD+ALT

Back in Open Firmware set up a few environment variables (it also seem to work without these but for safety)...

printenv
setenv auto-boot? true
setenv skip-netboot? true #optional - speeds up booting a little bit
setenv boot-device hd:,ofwboot
shut-down #remove the USB stick, start again and log in as USER

Customisation

Now OpenBSD should be up and running. Here are a few things I did to set up and customise my system...

Allow doas, do not ask for password for reboot and shutdown:

Replace USER with your username from above...

su
echo 'permit persist keepenv USER' >> /etc/doas.conf
echo 'permit nopass USER as root cmd reboot' >> /etc/doas.conf
echo 'permit nopass USER as root cmd shutdown' >> /etc/doas.conf
exit

Save the SSD a bit by enabling TRIM:

doas cp /etc/fstab /etc/fstab.bak
doas sed -i 's/rw/rw,softdeb,noatime/g' /etc/fstab

Update the system:

This requires internet access.

doas fw_update -a #optional: install non-free firmware (I didn't)
doas syspatch #patch the system
doas pkg_add -Uuv #update apps and more
doas reboot

Install suckless window manager, terminal, status and launch menus:

It is also possible to skip this section and instead install a more traditional desktop environment like Xfce.

doas pkg_add git nano

git clone https://git.suckless.org/dwm
git clone https://git.suckless.org/dmenu
git clone https://git.suckless.org/st
git clone https://git.suckless.org/slstatus

cd ~/dwm
nano config.mk #uncomment FREETYPEINC = $(X11INC)/freetype2
ftp https://dwm.suckless.org/patches/functionalgaps/dwm-functionalgaps-6.2.diff
git apply dwm-functionalgaps-6.2.diff #optional: patch dwm to use gaps
cp config.def.h config.h
nano config.h #edit the resizemouse line to use SHIFT+ALT+MOUSE for resizing windows
  { ClkClientWin, MODKEY|ShiftMask, Button1, resizemouse, {0} },
make
doas make install

cd ~/dmenu
nano config.mk #uncomment FREETYPEINC = $(X11INC)/freetype2
cp config.def.h config.h
nano config.h #optional: edit number of lines in launcher...
  static unsigned int lines = 12
make
doas make install

cd ~/st
nano config.mk #uncomment CPPFLAGS etc. (4 lines)
ftp https://st.suckless.org/patches/alpha/st-alpha-0.8.2.diff
git apply st-alpha-0.8.2.diff #optinal: patch terminal for transparency
make
doas make install

cd ~/slstatus
nano config.mk #and add -lsndio where it says OpenBSD
cp config.def.h config.h
nano config.h #optional: edit status bar...
  { cpu_perc, " cpu: %s%% |", NULL },
  { ram_used, " mem: %s |", NULL },
  { datetime, "%s", "%F %T" },
make
doas make install

Unfortunately, slstatus does not work well on this old PowerBook. E.g. cpu_perc returns a constant of 100% and the sensor for temperature is not found.

Turn off additional console window at login:

doas sed -i 's/xconsole/#xconsole/' /etc/X11/xenodm/Xsetup_0

Switch to ZSH shell:

doas pkg_add zsh
chsh -s zsh

Set up the .xsession file:

Adapt en and US below to match your keyboard layout and preferred language.

nano ~/.xsession #and add the following

  export ENV=$HOME/.zshrc
  export LC_CTYPE=en_US.UTF-8
  setxkbmap us
  xidle -program "/usr/X11R6/bin/xlock -mode blank -lockdelay 10 -timeelapsed" -timeout 480 &
  xsetroot -solid black
  slstatus &
  exec dwm

Log out and in again to make the changes work.

Set a wallpaper:

Optional: with feh it is easy to set a desktop background. compton together with the alpha-patched st from above results in a semi-transparent terminal.

doas pkg_add compton feh
nano ~/.xsession #edit and replace xsetroot with the following two lines

  compton &
  ~/.fehbg &

mkdir -p ~/.config
ftp https://wallpapercave.com/wp/QjyrBg9.png #or some other png or jpg
mv QjyrBg9.png ~/.config/wallpaper.png
feh --bg-fill ~/.config/wallpaper.png

Install pdf and epub readers:

doas pkg_add zathura-pdf-poppler epr-reader

Reduce the boot time:

A bit of an annoyance is that OpenBSD takes a long time to boot. 1 minute 45 seconds in my case. This is mainly due to security features that for example shuffle around the address space layout at each boot (ASLR).
To save 25 seconds in boot time I turned off ASLR with the command...

doas rcctl disable library_aslr

This is of course not recommended, but for a machine like this that is mainly offline and for what I'm using it for, I believe it is alright.

Conclusion TiBook

All in all, I am very happy with this laptop and that it continues to function and be of use after 20 years.
The cost of fixing this up - the new mSATA SSD plus IDE adapter - was around €20.


« ‹2 3 4 5 6 7 »