Finalizing the Prototype Packaging
For those who have been following along, in my March 2nd post I was playing around with case options for my 7 inch touchscreen device. I was going through the build vs buy decision process and was leaning towards buying something off the shelf. I had an old Smarti Pi case that looked nice but it wasn’t large enough to hold my Raspberry Pi and all the potential sensors I might have. Fortunately for me the Smarti Pi folks have been busy and had several other options to choose including the Smarti Pi Pro which looks to fit the jobs quite nicely. They have several options including a large and a small rear case so I ordered one of each to see which one would be best for my project. These arrived on Friday and over the weekend I started to review them both.
Old vs New
I am not going to review each individual component in the new enclosure kits as you can find that information on the Smarti Pi web site. Other than the camera placement, the front of the screen and base look pretty much the same as my original enclosure….
(the camera area is now located on the bottom area of the display)
Looking at the back we can see some significant changes in the way the Raspberry Pi is installed and some of the other hardware mounting options. The Smarti Pi Pro design has more cutout options for power and has standoffs for both a Pi and a Pi Hat.
Also there are two welcome additions to the enclosure kits, first there is metal insert for the bottom of the base to give the unit added weight. While not strictly necessary for my needs it might come in handy if there are lot of other devices added inside the enclosure. Second, they include a power Y-adapter for both the Pi3 and Pi4. For those who don’t know, the primary power connector on the Pi3 is a micro-USB while the Pi4 uses a USC-C. Since I don’t know if you will ultimately be using a Pi3 or a Pi4 this inclusion is very helpful.
With the screen installed we can see from the back we have a lot of space to work with:
Note the standoffs with brass inserts, that’s a nice touch. Also notice that there are four standoffs on one half of the back for the Raspberry Pi and then yet another four standoffs on the other half for a Pi Hat.
Powering the screen
In a previous post I mentioned there are several ways to power Raspberry Pi when it is connected to this type of touchscreen device. As a reminder, here is a closeup of the back of the touchscreen with its controller installed.
There are a total of five connectors on the controller, two are USB, two are ribbon and the fifth is a 2.5mm pin header. For power we only need to concern ourselves with the USB ports and the pin header. The controller gets its power from the micro-USB port and then can deliver power to the Pi via the USB-B port or the pin header but not both at the same time. Another option is to not power the Pi from the controller but rather use a Y-splitter cable from the wall adapter and power the touchscreen and the Pi separately via their micro-USB ports. This latter option is what I see most people doing and I suspect that is because the power requirements have increased in later Pi designs, it is also what I plan on doing.
Small vs Large
From what I can see the only major difference between the two enclosure kits is the size of the rear enclosure. While both have the same length and width, the larger enclosure has about twice the depth as the smaller enclosure.
Some quick toying around and I find that the smaller case can hold a Raspberry Pi with a Pi Hat stilling next to it while the larger case can hold a Raspberry Pi with a Hat on top and two more Hats stacked next to it. For my needs the smaller case will do just fine.
Installing the Pi on the back of the main enclosure gives me this:
and I can see I have about half of the back real estate leftover for my sensors. This is about 3 x 3inches (75 x 75mm) square which should be enough space for three or four sensors plus a little room for wiring etc.
How Many Sensors
Currently I have been using three sensors with the IAQ project, the SCD-40, the SGP-30 and the PMSA003I which I have talked about earlier. While these may not be the final set of devices I use they are good enough for my prototyping. I will need a way to attach these devices to the inside of the enclosure so that they are not bouncing around and so that they each get good airflow. Digging around my lab I find that I have some old blank PCBs that should be big enough to hold all my sensors and then be attached to the standoffs on the back of the case.
Trying a few layouts I discover one that I like…
….and drill a few holes.
(I also added some plastic film to cover the PCB tinned holes. When I attach the sensors to the PCB I don’t want to short out any of the traces on the back of the sensors, the film {actually tape} prevents that.)
Putting everything together with some screws and wires I get a nice looking little package.
Lastly, I install it in the enclosure…
…Look’n good and not bad for a few hours of work.
Closing things up:
(there is a cover for the side opening but I left that out as I may need those ports for testing)
Crap, it doesn’t work
Normally I do not enclose everything right away just in case something doesn’t work, however this time I was so happy with how things looked I did not follow my own rules. Of course Fate was paying attention and when I powered up my enclosure things did not work. Fortunately the author of the IAQ software provides a substantial amount of logging and I was able to discern that none of the sensors were found. Sounds like a wiring issue and a quick removal of the back of the case reveals that indeed this is the problem. The connector from the sensors to the Raspberry Pi was installed incorrectly. If you look closely at my previous image showing everything installed in the back you can actually see the connector is moved over to the left by exactly one pin. Doh! Moving the connector to the correct position fixes the problem and all is well.
Now I really need to get to software architecture documentation….