3D Printed Cases For TinyTX and Tiny328

With TinyTX3 and single 3V battery
3D printed case ith TinyTX3 and Tadiran 3.6V AA battery.

Another post I’ve been meaning to write for a long time. I finally got my Rigidbot 3D printer in August 2014 some 9 months later than the estimate but I was one of the lucky ones, many had to wait a lot longer and some have even had to pay extra for delivery, having already paid it once as the company completely ran out of funds. I am very happy with the printer though, I’ve printed all kinds of things since I’ve had it and it has produced some great results.

One of the main things I had in mind for it was printing customised enclosures for my electronics projects. I’ve used a variety of off the shelf cases for my indoor TinyTX and Tiny328 sensors, my favourite being the Evatron EN30W sensor case but I really wanted to design something of my own.

Case being printed
Case being printed

After a few aborted attempts using other 3D CAD packages I discovered the joys of OpenSCAD an open source 3D CAD package that allows you to write code to construct the 3D model instead of the more traditional graphical model. When I had first seen this tool I thought it seemed wrong, to approach what I saw as a graphical problem in a programmatic way but in retrospect it makes total sense as we are dealing with precise numbers here and being able to code parts in modules allows you to easily turn various parts of the design on and off easily and scale the whole design just by changing a few defines as well as easily reuse modules in other designs. Once you get in to the right mindset it really is good.

tinytx_case_openscad
OpenSCAD showing the code window on the left and a render of the two parts of the case on the right.

At the top of the code window you can see there are some defines to select whether it should render just the top or bottom of the case or the full thing, whether there should be vents in the top and how long they should be, if a square or round cut out is required for a cable or sensor to stick out of and if mounting holes are required in the back half of the case.

The next section sets the width and length of the PCB section and the battery holder section so I can set which board I am using and whether it is a single or double battery holder.  Then it goes on to configure how long the vents on the top should be and the dimensions and positions of the cut outs if required.

Once happy with that it’s just a case of exporting it as an STL file which I then process with Slic3r and send onto Octoprint running on a Raspberry Pi connected to the printer ready to be printed.

This prints really well on my printer, there are no clips to hold it together as such, the extended pieces in the corners are just made to a tight enough tolerance that they grip the top of the case as it is pushed on. I’ll probably tweak this a bit more over time but it does the job as it stands, the dimensions can be adjusted but as noted in the code comments there are some issues with the PCB supports not scaling properly once the PCB length gets over 46mm.

I’ve put the code on my Github here if anyone fancies giving it a try.

Finished case closed
Finished case closed
With TinyTX3 and single 3V Tadiran battery
With TinyTX3 and single 3.6V Tadiran battery
For 2 x AA batteries
For 2 x AA batteries
Tiny328 version
Tiny328 version

Stevenson Screen

After 12 months exposed to the weather
After 12 months exposed to the weather.

One of the early prints I did was this Stevenson screen which is an enclosure for outdoor sensors, the principle is to shield the sensors from direct heat radiation from outside sources while still allowing air to circulate freely. I used the STL files from Thingiverse here, if I recall correctly it took over 20 hours to print all the parts (over several days). It consists of four identical middle sections (more or less if you want it bigger or smaller), a top section and the base section. It’s a well designed object, each piece clips together very well and I was lucky enough to have a piece of plastic pipe that it fitted to perfectly (thanks to the random fly tipper that threw it over my back fence!).

I printed it using PLA which being biodegradable isn’t ideal but it was all I had. I wasn’t sure how well it would stand up to the weather but after 12 months it doesn’t look any different than it did when I first put it out there. I did think of treating it with something to protect it but decided to leave it as an experiment to see how it fares over time.

Inside the box mounted below it is one of my Tiny328 boards and four AA batteries connected to the regulated input, this is connected to a DHT22 temperature and humidity sensor which is suspended from the top of the stevenson screen so that it is positioned roughly in the middle.

Below are some pictures of it coming together and there is also a timelapse video here of one of the sections being printed.

One middle section being printed
One middle section being printed
Three middle sections clipped together
Three middle sections clipped together
The finished object September 2014
The finished stevenson screen, September 2014

 

PIR housing

PIR Housing
PIR Housing

One other related item that I’ve printed is this nice compact housing for the cheap BIS0001 based PIR motion sensors. I got this one from Thingiverse here and there are two versions available, one with square edges and one more rounded, I’ve used the rounded one.

6 thoughts on “3D Printed Cases For TinyTX and Tiny328

  1. Having enjoyed your blog for almost two years I noted you had fallen silent since early spring and then you mark your “come back” with a handful of interesting posts. Nice!

    By the way, have you noticed any reduction in TX effect with the antenna inside the case?

  2. @oguime It’s a good idea but not something I have looked at yet as I have other solutions that satisfy my needs for the moment. (Home Easy RF light switches and Flic Bluetooth buttons).

    @gadjet0 Yep, seems like a fairly steep learning curve to start with but it’s more of a paradigm shift and there is definitely an “aha!” moment once you get it!

  3. Hi Nathan, got your case printed the other day. It looks pretty good, you can see my result in the imgur link here: http://imgur.com/n8L1Non
    There is just around 2 mm of slip for the PCB to have a tight fit in the casing, is there a reason for this? Anyway, good job, definitely gonna print some more of these!

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.