tiny85 self power-off

All finished up this evening, at long last. The wood is swamp kauri, always forget how nice a finish it takes.

I decided to have a go at etching a board rather than using perfboard and am super glad I did, what a neat little process. I'm delighted with the results for a first attempt. Unfortunately after all that discussion about the resistor being in the wrong place, I managed to take it from the right place on my breadboard then draw, and place it in the wrong place on the board =(. It does divide but I only lose .1v or so on the N channel gate by my math.

And a vid if anyone is interested.

Thanks again for the responses

nice, has a good character

I think it's wonderful. Well done.

Well we now need to see a video showing the actual operation ;).

Did you miss the YouTube link Larry? Or you mean under the hood. It's exactly what you'd expect there's not much to show, a servo for the lid and one for the arm. The head is stuck on the lid by a piece of tig wire holding it at the right angle hah

Yes, I didn’t see the link.

Very funny. + +

Going to make a few for Xmas presents this year.

Nice finish on the wood and box nice joints !


Will you copy the final sketch here and a final schematic ?

I would but, you'd find it funnier than the vid itself.

I'd rather you program it the way you would, then if I make a couple more for presents, I can use your sketch xD.
I would genuinely like to see how someone experienced would do it without libraries. I'm not super confident with timers and even if I was, strategically I don't know which bits would go in interrupt routines and the main loop.

Other than mine being a manual hack there are two reasons Id discourage it, one I discovered with these servos in particular I only need 2 pulses to make a servo track for and hold that position, for as long as it's powered up. So my for loops only iterate 3 times when max speed is allowable. And secondly my PWM wave form isn't strictly correct, the off time is fixed and not balanced with the on time for consistent period (i.e.. 20ms - on time). Both may cause other servos to fail or behave erratically. Lucky for me neither matter in this case.
These servos came out of a model helicopter, my guess is they have a "hold last position" function for if the RX fails.

I'll post the schematic when im at my computer later.

Normally when you succeed ‘or not’ you share your results plus or minus like others have shared with you in the previous 42 posts.

These forums are here to help others who come across this thread with the same questions.

Sure, if it can be constructive I suppose but heed above advice as it will likely not work for most I guess...

The sketch and board layout reflects the fixed N-channels gate resistor and is not how mine is but, in any case...
Enjoy, with a grain of salt!

Actually one constructive thing I could add, I lightened my switch by swapping out the spring for one with less stiffness. I opened a few pens and found one that compressed easier. Cut to approx length then stretched until slop in switch was taken up. The servo struggled with the factory switch, but much snappier performance after this. I also machined an extension for the toggle knob, for leverage initially but it was probably not necessary. It does add to the look.

My only other thought is the hit switch function requires the switch to toggle for the function to complete (doing so improved response time). If someone unknowingly put their coffee on the box and bumped the switch, the servo would likely burn out and the circuit would run until batteries were flat. I thought I could timeout that function but that would disappoint the tough users who want to wrestle with the switch. You would only save the servo (not the batt), as there would be no way to power off the LDO with the switch held open, the best you could do is relax the servo then sleep the uC, and it'd require manually cycling. So I left as is. I'm sure there's a clever way around it.

Box8Bit.ino (8.85 KB)

Nice job.

This will help others.

On the code, add a few more comments to help yourself remember 1 year from now ;).

Also, you might want to look into using State Machine coding in future sketches and how to create timers using the millis() function to remove all the delay() calls.

There are some examples of both in the tutorial forum on this web site.

Continue to have fun with this new hobby.

Did you cut the box joints with a router ?

The build quality and finish are very fine.
Also, I haven't made my own PCB for decades. Is that chemically etched ?

Haha good thought but I don't plan on using the sketch again if there ever was a 2.0.

I'll have a read up on state machine coding. I'm aware of utilising millis but i figured since there's nothing to do during delays, simple was better.

The box joints are done on a jig I made for my table saw. Another trick I was delighted to see work so well. Basically a 2 part sled, the front part you clamp your work to which has a pin the width of the saw kerf as a guide, which can slide between 'fingers' on the back piece (which is stuck in the table saw channels). You make the fingers by ripping a length of square stock the width of desired tenons, and cut it into 2xWidth lengths and stand every second one up.

I'll go fish it out if you want, a photo that might be easier hah.

6v - yes chemically etched, I had 30% hydrochloric acid lying around and bought a tiny bottle of hydrogen peroxide from a pharmacy in town for a few bucks. I'm looking for an excuse to try it again now haha.

The mask was printed on toner transfer paper and ironed onto the board. I exported the PCB layout into photoshop and manually added a bigger 'blob' to each device pad. The editing process per device in EagleCAD was arduous.

It would be nice to see the jig.

I use a router/table with a jig for making box joints but nothing over 3/8".


I like jigs (Edit: all tools :wink: ).

If you have not seen the tips in this thread (700+ posts), you might find some interesting ideas.

https://forum.arduino.cc/index.php?topic=445951.0

This one will do whatever size, if you can be bothered changing the fingers. It looks more complicated than it is but the back piece is just an open backed box with rails, holding a row of square stock alternating laying/standing. Some random size stock is cut at each side to hold them all firm. And the front bit just has a pin that matches the saw kerf. Finely tuned with an angle grinder and drill... So with the work clamped to the front, the saw can only cut an area that the pin can move between.

Pieces tap together tight with a mallet, right off the saw. Obviously only does square joints but it's great for knocking drawer carcasses together. If you were doing a lot you'd run a dado blade.

I too suffer from the tool and jig related sicknesses hah. Cool thread, thanks.

Thank you.

There are also many ideas on YouTube.


Hey, that’s the same table saw I have, great minds . . .

The bit is wrong here, should be 1/4" up spiral.
This jig is for 1/4" box joints, also have one for 3/8".
Use a 1/4" brass bar to set the bit distance from the fence and the bit height is set to 4/1000” proud the wood thickness.

Some 1/4" box joint boxes.

Yeah looks good, similar sort of principle. The relationship I've had with my router over the years is complex haha...

You'd like the last jig I built, being a wood worker. Not that it's anything to do with electronics but since we're way off track anyway...

It holds logs while you cut them into timber :grinning: Seriously it's a sickness...

The log stays stationary and the band saw moves, nice.

I’m in love :).


Big shop, big jigs :grinning: