A little help needed for the upkeep on the Mad Scientist Hut site.

A little help needed for the upkeep on the Mad Scientist Hut site.

Since most people use ad blockers:

I hope the information contained in the blog has been or is helpful to many people.  As I approach retirement I will not be able to fund the web server fees soon. Since I will be retiring soon I plan on starting to work on the blog section once again with many exciting projects, I have been absent on the blog since the corporation I currently work for owns everything you do including in your off time, they consider my home time work as their intellectual property….. If you could help with any donation amount (even as small 1$)  this will help keep the site up and running. See link below:


A Simple 24V Li-Ion Battery Low Voltage Disconnect W/ Hysteresis Using Six Parts

A Simple 24V Li-Ion Battery Low Voltage Disconnect W/ Hysteresis Using Six Parts

I was at Lowes the other day and I saw their new 24V Kobalt tools. With a great surprise they sell a low capacity 24V Li-ion 1.5A/Hr battery for $10.00.

Wow! I was hooked I bought a the starter set with the drill and 1/4 inch impact driver with charger and a battery for $119.00 and 3 of the 1.5A/hr batteries.

I am excited about having these low cost Kobalt 24V Li-ion batteries since they will be more useful as power sources for other projects. I quickly designed an adapter on the laser cutter out of acrylic that I could plug into the battery.


Kobalt 24V Battery clip design
Kobalt 24V Battery clip designed in Inkscape

First project to use the battery pack on: A dual USB power outlet and an 800 lumen LED light

I installed a DC-DC boost board to produce the 28V needed for the series LED string and a DC-DC buck to produce the 5V needed for the USB ports.

Great it works, lets test it.

Wow runs for about 3.5 hours with the LEDs running.

Doh it runs the batteries below their critical cutoff point of 15V. Yikes this will destroy the batteries in no time.  (apparently these batteries do not have a low voltage cutoff built into them)

Hmm time for a low voltage cutoff circuit. So here is the simplistic circuit that I came up with: It cuts the battery off at ~18.2V and then with a little hysteresis it will turn back on again at 19.8V I figured this was a good trade off. This is simulated, I am ordering the parts to see how the circuit will perform. I plan on using a TLV431 since it will use less current to function and the PMOS will also be a different part. Edit: I just looked at the datasheet for the TLV431 and it is a low voltage part so a nogo there.

Circuit description:

TLV431 2.5V reference

R1 and R2 form a divider for 2.5V (the switching point of the TL431)

R3 Bias for TL431 and PMOS Gate

R5 creates the hysteresis ( this is so that we do not oscillate when switching the battery off )

R4 is just a simulation load ( this is where your battery powered circuit will be )

M1 is a P-CH MOS FET sized accordingly for the load. ( I like a low rdson value and at least 2x the voltage for the rating so 48V or greater PMOS)

V1 is a simulation voltage source that is programmed to run from 24V @0.0S to 18V@0.5S then back to 24V@1.0S

Red Trace is simulation load current, Green trace is simulation Battery Voltage

We Just Preordered a Glowforge Laser Cutter for $1995.00, 50% of the List Price

We Just Preordered a Glowforge Laser Cutter for $1995.00, 50% of the List Price

We just purchased a Glowforge laser cutter for 50% off of the list price as part of a preorder discount that will run for 30 days from Sept 24th


Use this link for another $100.00 off of your order, we also get $100.00 off if you buy one using this link!

We have been in the market for a decent laser cutter for some time now. The low cost option was to get something from China for about 1K with software that leaves so much to be desired  and hardware that is very questionable or you could spend 10K or more  on a US made laser cutter with some descent software and hardware.

See this great video: https://www.youtube.com/watch?v=0R3mMUsHFvU

Well here is what sold me on the Glowforge laser cutter:

  • US made laser cutter
  • Pre-order price is 50% off
  • The laser uses two cameras for alignment of the material, it takes a picture of the material on the laser bed, then lets you move the design on the material by just dragging it on the screen.
  • Any software updates are free forever
  • Cuts: wood, fabric, leather, acrylic, chocolate, delrin, rubber, etc…
  • Can cut from both sides using second high magnification camera to align the back die of the cut, which means you may be able to cut 1/2inch plywood.
  • You can draw on the material and it will trace your drawing using the laser (this was a major selling feature for me)
  • The laser automatically focuses up to 0.5 inches over the surface of the material as it is cutting ( also a major selling feature for me)
  • The work area is 12″x20″, this is a very usable size for me.
  • 40Watt zero mode (high quality, small spot size) CO2 Laser
  • sealed optics (no cleaning of optics)
  • no external cooling system
  • no external compressor required


AS5040 on Beaglebone Black, using Python: preliminary

AS5040 on Beaglebone Black, using Python: preliminary

After waaaaaaay too long, I finally got around to porting the Arduino AS5040 code to python. This is very preliminary, but it does work.

As self-hosted versions of wordpress appear to do a lousy job of formatting, and python is formatting-specific, I’ll put the code on github where I can guarantee that it looks the way it should: https://github.com/smellsofbikes/AS5040_python_beaglebone



import Adafruit_BBIO.GPIO as GPIO
import time

def read_raw_val(data, chip_select, clock):
GPIO.setup(data, GPIO.IN)
GPIO.setup(chip_select, GPIO.OUT)
GPIO.setup(clock, GPIO.OUT)

a = 0
output = 0
readbit = 0
GPIO.output(chip_select, GPIO.HIGH)
GPIO.output(clock, GPIO.HIGH)
GPIO.output(chip_select, GPIO.LOW)
GPIO.output(clock, GPIO.LOW)
while a < 16:
GPIO.output(clock, GPIO.HIGH)
readbit = GPIO.input(data)
output = ((output << 1) + readbit)
GPIO.output(clock, GPIO.LOW)
a += 1
return output

while 1:
rawval = read_raw_val(“P9_15”, “P9_11”, “P9_12”)
print “read: ” + str(rawval)
print “raw rotation: ” + str(rawval >> 6)


I still need to strip and decode errors, extend it another two bits for the AS5045, and make the whole thing into an importable library.


Note that on the Beaglebone, the Adafruit GPIO library doesn’t yet fully support setting pull-up or pull-down resistors on pins.  As such, you may have trouble with some pins not working.  I know these three pins work, because I’ve tested them.  The code should work for Raspberry Pi without any problem, and at some point I’ll port this to Bonescript, where I do have control over setting the internal pull-up and pull-down resistors, so any set of I/O pins can be used.