Central Command Hub V.2
Welcome.
Today we will be using an old toolbox to make an upgraded version of the Central Command Hub (C.C.H).
If you have haven't checked it out already the Original C.C.H can be found here. If you've already built the original C.C.H, then you should have most of the parts needed for this version.
In this upgrade, we will be upgrading the box and adding a Raspberry pi for more A.I power and overall functionality. This version will be very versatile as you can not only use this to house your A.I system, but you can also use it as a computer, a retro pi, a music/video player, etc. Basically it can do whatever you program it to do, and it is compact and easily portable.
Supplies
(x1) Big Box ( I used an old metal tool box. The dimensions of my box are 33cm (long), 21cm (wide), 25cm (tall). I recommended you find a box this size because the STL's I made are tailored to these dimensions).
(x1) Arduino Uno or Mega (I recommend using a Mega because it has more I/O pins)
(x1) Movi Shield
(x1) Raspberry Pi 4
(x1) 7" monitor for Raspberry Pi (You can also get the monitor from AliExpress or get a 7" touch screen)
(x1) 16x8 LCD Screen
(x1) Big Breadboard
(x1) 10 Pack of Level Shifters
(x1) Small Power Bar (4 will work but you will need to add a cubic extension outlet because the transformers for the power supply cases block the outlets next to them).
(x1) 9v (2A or greater) Power Supply
(x1) 5v USB Wall Charger with 2 or more ports.
(x1) USB Switch
(x1) USB and AUX Panel
(x1) Port Plug (This is to deliver power to your power bar since the power bar will be inside the box)
(x1) 5 Gang Rocker Switch Panel
(x2) Small Speakers (50x50cm or smaller) (One speaker will be for the Movi and the other will be for the Raspberry Pi)
(x1) Audio Splitter Y-cable (Reference Image)
(x1) External Mic for Movi Shield (A head set microphone will work)
(Some) Jumper Wires
(Optional) Micro SD card (For Raspberry Pi or Old Tablet)
(Optional) Old Touch Screen Tablet
3D Printed Parts
You will need to print my STL files for the interior, which can be found on my Thingiverse page. The Main Parts that you will need to print are:
- Main Cover (Main Cover A and Main Cover B if the Main Cover part doesn't fit on your printer)
- Base 1A and Base 1B (Different Mods are available. If you are adding a Breadboard, I recommend printing Base 1A (Mod-BBM). BBM stands for Breadboard Mount).
- Pi Screen Case
- Main Drawer Cover
Base 2A and 2B (along with all the base mods except for the BBM mod) are for a second tier. You can print these if you do not plan on adding the tablet. If you add the tablet you may not have enough room/clearance to have a second tier.
All these parts can be printed without support.
The Exterior
First, find a box that is 33cm (long), 21cm (wide), 25cm (tall)
Refer to the images above
Keep in mind that the STL's I made are tailored to these dimensions. You could get away with a bigger box but you would have to either modify the Main Cover part or add a piece to it, to fill in any gaps you may have (the Main Cover dimensions are 32x20cm and it is 0.5cm thick). If your box happens to be bigger that 33x21cm then you will have to modify the Main Cover because you will have a bigger gap. (I also recommended leaving 1cm clearance).
Once you have your box, make a hole at the side of the box so you can add the port plug.
Then drill a small hole (the size of an audio jack) to any side of the box. This hole will be for the female end of the audio splitter so we can plug in an exterior speaker to our Raspberry Pi.. The external jack will allow us to bypass the cheap internal mini speaker and connect it to a much better speaker, or sound system. If you plan to use the USB and AUX panel then all you will have to do is drill the hole bigger to fit the panel, and just plug the aux panels cord into the splitter. (Refer to step 6)
The Main Cover
3D print all the main parts (Main Cover, Base 1 A and B). Once everything is printed, assemble Base 1A to Base 1B and assemble the Main Cover. You may weld or glue them together.
Then, add you LCD screen to it's slot and make sure the Main Cover sits flush up against the Base. If not, you may have to trim a bit off Base 1A so it can sit flush. The reason why this may happen is because the LCD's circuit board pushes the cover forward a couple millimeters, so we must compensate for that.
Once that is done, weld/glue the Main Cover to the Base. Make sure the sides are as flush as possible.
Pi Case
Place the Pi screen into the case and add a stopper to the end so the screen doesn't slide out. (I made a tiny hole and put a paperclip through it. I then bent the paperclip to prevent it from falling out and now my screen cannot slide out of the 3D printed case).
Then, secure the screen's driver board to the 3D printed case.
Now, add Velcro to the MainCover and to the pi case. Attach the pi case to the MainCover using the Velcro. MAke sure the top of the pi case is level with the top rectangle gap (This way, if you choose to use the tablet and slide it out (like a drawer) it won't hit the top of the pi case).
(Refer to the images above)
The Interior
Add your Arduino, Raspberry Pi, Speakers and other electronics to the Main Cover and the Base.
Then, add the power bar to the back of the box, making sure it's high enough that the Base and it's attached components have clearance.
LCD Wiring:
GND
5V
Pin 6
Pin 12
GND
Pin 9
Nothing
Nothing
Nothing
Nothing
Pin 5
Pin 4
Pin 3
Pin 7
5V
GND
(Refer to image above).
The Interior - Level Shifters
To have the Arduino trigger the Raspberry Pi we must use level shifters so we don't fry anything. The level shifter allows the 5V coming from the Arduino to be stepped down to 3.3V for the RPi (Raspberry Pi). The level shifter that I have works both ways (it can step down the 5v to 3.3v and step up the 3.3v to 5v if needed), and is 4 channel. I used 3 Level shifters (resulting in 12 inputs).
Connect:
Arduino 5V to HV
Arduino GND to GND (of level shifter)
Arduino Pin 24 to HV2
GND (of level shifter) to RPi GND
LV to RPi 3.3V
LV2 to GPIO 4
I have included a screenshot from my code. This should help you wire everything.
For example: Button1=24 means that the Arduino Mega's Pin 24 will be my first button and we will connect Pin 24 to the Level Shifter (in this case it will be HV2) and then we will take GPIO pin 4 from our Raspberry Pi and connect it to the Level Shifter (in this case it will be LV2).
The Interior - Switch Panel Wiring
On my 5 Gang Rocker Switch panel I have 2 switches controlling 2 of my speakers and 1 switch that controls a USB switch (This is so I can plug in a USB cord into the side of my box (The other end will be connected to my Arduino Mega which controls the Movi Shield), connect it to my computer, and upload my Arduino code to the Arduino inside the C.C.H. The USB switch will prevent any unauthorized code uploading because you will have to flip a switch in order to upload new/upgraded code).
In the images above you should see a picture of a usb and aux panel with a usb cord and an aux cord coming out of it (it's the picture with the white background). This is where we will connect our male to male usb cord, so we can upload code from our computer to our Arduino.
If you haven't noticed already, the USB-Aux port has a male end and so does our USB switch. To connect them together you can either use a female to female usb coupler (I recommend using the coupler), or cut both males usb ends off and connect their wires together. The aux cord coming from the usb panel will simply connect to the audio splitter. This way we can connect an external speaker to our Raspberry pi.
Rewire the speaker's switch so it's bypassed. Then connect your two leads to the panel (or route the power lead of the speaker through to the panel switch).
On the panel you will have to cut some of the wires. If you refer to the image above the green markings show where to cut the wires. You do not need the +red coming in because that is to power the switch LED's which require 12. The speakers I used only require 5v.
To power the 5V USB Port and the 12V cigarette lighter (which can be used for a 12v power supply) take a 12 power supply, plug it into your power bar, then take the positive and negative leads and connect it to the positive and negative of the USB port (since that is daisy chained to the cigarette lighter and the voltage display they should all power up).
Make the Second Tier
3D print (x2) 2040_180mm extrusion (or 2020_180mm extrusion) and bolt it to both inside, sides of the tool box. Make sure that the extrusion is level and centered when you secure it.
Now print the Main Drawer Cover and the Sliders (I printed Slider (0-7) This works with with both 2040 and 2020 extrusions). Once I had those parts printed, I slid the sliders into the extrusion and added the Main Cover. Then, I secured the Main Cover to the Sliders using some small 6-32 wood screws.
On the knob part of the Main Cover I screwed threaded a bolt into it (I achieved this by heating up the plastic and screwing the bolt into the soft/molten plastic and letting it cool so it could take the shape of the bolt's threads). Now I can unscrew the bolt a couple of turns and get more leverage when pulling out the drawer.
The Slider (Aligner) (circled in blue in the images above) is used on the 2040 extrusion to keep the tablet straight and prevent it from tilting when you pack up the tool box and carry it.
(Refer to the images above)
The Lid
To make the lid look nice and serve as some extra storage space, print some mini drawers and Velcro them to the lid.
I printed Lid CoverA and B along with (x4) Hinges. I put 2 hinges into the Lid Cover hinge slots and I attached the other 2 hinges to my mini drawers and to the Lid Cover. This way I can fold the Lid Cover all the way up.
Printing the Lid Base is optional (I took mine out because I needed to fit the extension cord and some other things) but if you want to add it:
Print the Lid Base and place it on the lid (In the picture above I used Lid Base (Mod-1) But you can use the original Lid Base). Then print Lid CoverA and B and (x2) Hinges (If you don't want to have your Lid Cover fold then you can print Lid CoverA and B (O-1)).
Once the Lid Cover is printed you can place it on top of Lid Base. (The circular groove in Lid Base is meant for magnets so you can have the Lid Cover held in place using the power of magnetism (Although, you would need to add a thin metal strip to the Lid Cover in order for it to work) .
The Code
Go to my Thingiverse page and download the C.C.H (V.2) Zip folder, as it contains all the codes, wav files, and STLs.
Download the Arduino code and upload it to your Arduino Mega.
Although the Arduino code is long and will most likely get longer as I upgrade it, there's no need to fear. The Arduino code is pretty well commented, so it should be fairly easy to under stand (of course if you have any questions don't hesitate to ask). Also, an explanation of how the commands and responses work can be found in step 4 of my C.C.H (V.1) Tutorial.
Copy the RPI code and paste it into Python and run it. You must run it every time you turn on the Raspberry Pi . (I have scowered the internet in search of a way to have the code autorun on startup and I have not yet found one that works for me. If you somehow manage to do it, please let me know).
Take the BAXTER-SoundFX folder and paste it into your Raspberry pi under the home directory: Home/Pi (This should be with the Downloads folder, Documents, folder, etc...).
Side Note: If you want to add more wav files to the SoundFX folder you can go to YouTube, copy your video's URL and paste it into a YouTube to MP3 converter. Then, take that MP3 file, import it into Audacity, highlight all the sound waves, go under Effects, and click amplify. This will amplify the sound that way you can hear it on the speaker coming from Raspberry pi (the volume drops quite a bit when using a speaker on the RPi, which is why we have to amplify the audio). Then export the audio as a wav file and add it to the SoundFX folder.
Enjoy & Stay Tuned
Enjoy your new A.I system that can do whatever you program it to do.
And don't forget to stay tuned for more updates, as the next update will be making the A.I (Movi shield) remotely control things using RC modules to do things such as turning things on/off, and in the future I hope to give the A.I system vison capabilities using OpenCV.
Hmm...these updates sound like they might require more room, which means either a bigger box or modular box attachments that we can add onto our existing box/our current C.C.H housing.
So be sure to stay tuned.
The updates will be posted here, so anything after this step will be an update.
UPDATE 05/14/21:
I acquired a bigger box.
C.C.H V.3 coming soon!