Advertisements

Archive for category Software

Astable Multivibrator: NP-BX1 Base

Adapting the NP-BX1 battery holder to use SMT pogo pins worked well:

NP-BX1 Holder - SMT pogo pins

NP-BX1 Holder – SMT pogo pins

The next step is to add sockets for those 14 AWG wires:

NP-BX1 Battery Holder - Wire Posts - solid model

NP-BX1 Battery Holder – Wire Posts – solid model

Start by reaming / hand-drilling all the holes to their nominal size and cleaning out the pogo pin pocket.

Solder wires to the pogo pins and thread them through the holder and lid:

Astable - NP-BX1 holder - pogo pin soldering

Astable – NP-BX1 holder – pogo pin soldering

That’s nice, floppy silicone-insulated 24 AWG wire, which may be a bit too thick for this purpose.

The pogo pins will, ideally, seat with the end of the body flush at the holder wall. Make it so:

Astable - NP-BX1 holder - pogo pin protrusion

Astable – NP-BX1 holder – pogo pin protrusion

Dress the wires neatly into their pocket:

Astable - NP-BX1 holder - pogo pin wiring

Astable – NP-BX1 holder – pogo pin wiring

Butter the bottom of the lid with epoxy, clamp in place, set it up for curing, then fill the recess:

Astable - NP-BX1 base - curing

Astable – NP-BX1 base – curing

While it’s curing, make a soldering fixture for the 14 AWG wires:

Astable - drilling strut soldering fixture

Astable – drilling strut soldering fixture

The holes are on 5 mm centers, in the expectation other battery holders will need different spacing.

Solder it up and stick the wires into the base:

Astable - NP-BX1 base - detail

Astable – NP-BX1 base – detail

Jam a battery in and It Just Works™:

Astable - NP-BX1 3.8V - 20ma-div - cap V

Astable – NP-BX1 3.8V – 20ma-div – cap V

The traces:

  • Green = supply current at 20 mA/div
  • Yellow = LED driver transistor base voltage
  • Purple = other transistor collector voltage
  • White = base – collector voltage = capacitor voltage

The measurement setup was a bit of a hairball:

Astable - NP-BX1 base - current probe

Astable – NP-BX1 base – current probe

For completeness, here’s the schematic-and-layout diagram behind the circuitry:

Astable - NP-BX1 base - schematic

Astable – NP-BX1 base – schematic

I love it when a plan comes together!

The OpenSCAD source code as a GitHub Gist:

Advertisements

, , ,

Leave a comment

Six Gallon Can Lid Adapter to Platform Bird Feeder

A House Finch suffering from Finch Eye Disease prompted me to sterilize our feeder, which meant providing a temporary feeder to keep the birds flying. Having an abundance of lids from six gallon plastic cans / buckets, this made sense:

Can Lid Feeder - installed

Can Lid Feeder – installed

Which required an adapter betwixt pole and lid:

Can Lid Feeder - assembled

Can Lid Feeder – assembled

Which requires a bit of solid modeling:

Can Lid Platform Feeder Mount - solid model - bottom

Can Lid Platform Feeder Mount – solid model – bottom

The lids have a central boss, presumably for stiffening, so the model includes a suitable recess:

Can Lid Platform Feeder Mount - solid model - support structure

Can Lid Platform Feeder Mount – solid model – support structure

As usual, automatically generated support fills the entire recess, so I designed a minimal support structure into the model and cracked it out with very little effort:

Can Lid Feeder - support structure

Can Lid Feeder – support structure

The tangle off to the right comes from a bridge layer with a hole in the middle, which never works well even with support:

Can Lid Platform Feeder Mount - Slic3r - bridge layer

Can Lid Platform Feeder Mount – Slic3r – bridge layer

Didn’t bother the birds in the least, though, so it’s all good.

I loves me my 3D printer …

The OpenSCAD source code as a GitHub Gist:

Leave a comment

Imagemagick 6 vs. PDF

Come to find out Xubuntu 18.04 ratcheted the ImageMagick security settings up to a dangerous chattering whine:

convert p???.jpg "Machining D-bit Drills.pdf"
convert-im6.q16: not authorized `Machining D-bit Drills.pdf' @ error/constitute.c/WriteImage/1037.

Fortunately, someone who understands this stuff encountered the problem before I did and posted a great description of the solution.

To forestall link rot, the process looks like:

cd /etc/ImageMagick-6/
sudo cp policy.xml policy.xml.base
sudo nano policy.xml
… change one line …
 policy domain="coder" rights="read|write" pattern="PDF"

It is completely unclear to me whether ImageMagick (as of ImageMagick 6.9.7-4 Q16 x86_64 20170114 ) requires or merely tolerates the vertical bar in place of commas, nor whether it’s in my best interest to replace "coder" with "*".

In any event, I can once again stuff bitmap images into PDF files.

2 Comments

Sony NP-BX1 Battery Holder: SMT Pogo Pin Contacts

The original camera battery test fixtures used contact pins conjured from hulking gold-plated connector pins and coil springs:

Canon NB-6L holder - contact pin detail

Canon NB-6L holder – contact pin detail

The Sony HDR-AS30V camera chewed up and spat out a handful of batteries, all tested in the NP-BX1 test fixture:

NP-BX1 Holder - show layout

NP-BX1 Holder – show layout

Nowadays, SMT pogo pins produce a much more compact holder, so I figured I could put all those batteries to good use:

NP-BX1 Holder - SMT pogo pins

NP-BX1 Holder – SMT pogo pins

That’s the long-suffering astable multivibrator, still soldered to its CR123A holder.

Obviously, the battery holder should grow ears to anchor the 14 AWG copper posts and would look better in black PETG:

NP-BX1 Battery Holder - 1.5mm pins - solid model

NP-BX1 Battery Holder – 1.5mm pins – solid model

The battery lead wires get soldered to the ends of the pogo pins and are recessed into the slot in the end of the fixture. I used clear epoxy to anchor everything in place.

Fits perfectly and works fine!

The OpenSCAD source code as a GitHub Gist:

,

1 Comment

Kindle Fire Picture Frame: Copying the Pictures

Being a bear of unbearable consistency, I save edited picture files with a description following the original camera-assigned sequence number:

IMG_20181108_190041 - Kindle Fire Picture Frame - Another Test Image.jpg

Yup, spaces and all.

Kindle Fire Picture Frame - Another Test Image

Kindle Fire Picture Frame – Another Test Image

I store my general-interest pix chronologically by year, in subdirectories for interesting categories, so copying all the edited (a.k.a. “interesting”) pictures to the Kindle Fire becomes a one-liner:

cd /mnt/bulkdata/Cameras
find 20?? -iname \*\ \*jpg -print0 | xargs -0 cp --parents -t /mnt/part/Pictures

The --parents parameter tells cp to recreate the directory structure holding the picture in the target directory, thereby keeping the pix neatly sorted in their places, rather than creating one heap o’ pictures.

Come to find out I’ve edited slightly over 7 k general-interest pictures in the eighteen years I’ve been using digital cameras, of maybe 27 k total pictures. Call it a 25% hit ratio; obviously I’m not nearly fussy enough.

Then there’s another 16 k project-related pictures, of which 10 k were edited into something useful. With an emphasis on utility, rather than aesthetics, a 60% hit ratio seems OK.

Which works out to half a dozen pictures a day, every day, for eighteen years. I loves me some good digital camera action!

Leave a comment

LinuxCNC 2.7 vs. Logitech Joggy Thing

The old Atom running LinuxCNC for the Sherline finally stopped booting, so I popped the Optiplex 760 off the stack and did a live-USB trial run. The latency / jitter worked out around 25 µs, slightly worse than before, but still Good Enough, and the StepConf utility coerced the motors into working OK.

What didn’t work was the old Eagle-to-HAL code defining the Logitch Gamepad as a Joggy Thing to allow smooth joystick jog control. Well, stuff changes over the course of eight years, but, in this case, the fix turned out to be a one-liner: the probe_parport module isn’t needed nowadays.

With that out of the way, it runs fine:

LinuxCNC - Sherline Mill - Logitech Gamepad

LinuxCNC – Sherline Mill – Logitech Gamepad

The INI and HAL files defining the Sherline configuration as a GitHub Gist:

, ,

1 Comment

Icecast and Ezstream Configuration

Plugging a 64 GB USB stick with directories full of MP3 / OGG files into an always-on Raspberry Pi running Pi-Hole, one can use Icecast to stream them for clients on the LAN, so as to avoid over-the-Intertubes streaming issues.

The only changes in the /etc/icecast2/icecast.xml file cover passwords, the number of source streams, and the hostname. It’s that simple, really.

Given a directory of files, generate a file-per-line playlist:

find /mnt/music/goodmusic/ -name \*mp3 | sort > /mnt/music/goodmusic/playlist.m3u

Then set up a corresponding Ezstream XML file, perhaps imaginatively named goodmusic.xml:

<ezstream>
    <url>http://localhost:8000/goodmusic</url>
    <sourcepassword>make-up-your-own</sourcepassword>
    <format>MP3</format>
    <filename>/mnt/music/goodmusic/playlist.m3u</filename>
    <shuffle>1</shuffle>
    <stream_once>0</stream_once>
    <svrinfoname>Good Music</svrinfoname>
    <svrinfourl>pihole.local</svrinfourl>
    <svrinfogenre>Good Music Streaming 24x7</svrinfogenre>
    <svrinfodescription>Techno Dub</svrinfodescription>
    <svrinfobitrate>128</svrinfobitrate>
    <svrinfochannels>2</svrinfochannels>
    <svrinfosamplerate>44100</svrinfosamplerate>
    <svrinfopublic>1</svrinfopublic>
</ezstream>

Fire off the source stream in /etc/rc.local:

ezstream -c /home/pi/Icecast/goodmusic.xml &

The ampersand tells Bash to fire-and-forget the process, so it runs all the time. One could, I suppose, put it in crontab to start after each boot or puzzle out the corresponding systemd incantation, but …

Add the station to your streaming media player:

         'KEY_KP5'   : ['Good Music',False,['mplayer','-playlist','http://192.168.1.2:8000/goodmusic.m3u']],

And then It Just Works™.

,

Leave a comment