C.C.H (V.3)
So I acquired another old tool box and it's much bigger that my last one. That means it's time to upgrade my C.C.H so I can have more room and add new features.
This upgrade uses all of the parts from the V.2 version, plus some new ones.
____________________________________________________________________________
The C.C.H (Central Command Hub) is an Arduino powered A.I system that can do a variety of things. Basically anything you program it to do.
In this upgrade, the Arduino has teamed up with a Raspberry Pi which gives it a lot more freedom to do a lot more things. I've also added an android tablet so the C.C.H can act as an entertainment system, or your own personal DJ.
____________________________________________________________________________
To start, you will need to download the STL files from my Thingiverse page.
The code and other necessary files can be downloaded from the Thingverse page as well.
Supplies
(x1) Big Tool Box (I used an old Sears MasterCraft tool box)
(x1) Long Power Bar (6 Ports should work but you may need a cubic extension outlet (from the dollar store) if your power supplies block the outlets next to them).
(x1) RPi 7" Monitor or 7" Touch Screen
(x1) 9V (2A or greater) Power Supply (You may need to get a splitter as well so you can power both Arduino Mega's. I ended up using a 9V 5A power supply)
(x1) RPI Camera
(x1) Longer Cable (For RPI Cam)
(x1 pack) Breadboard
(Lots of) Breadboard Wires
(x1) Arduino Nano
(x1) Arduino Sound Sensor
(x2) Arduino Mega
(x1) Movi Shield
(x1) External Microphone for Movi Shield (Headset Microphone will work)
(x1) Raspberry Pi 4
(x1) Level Shifters
(x1) Micro SD Card for RPI (The bigger the storage size the better. That way you don't have to worry about running out of room)
(x3) OLED Display
(x1) 16x2 LCD Display
(x2) Mini Speakers (One set for RPI the other for the Movi Shield. They can be any speakers you want to use as long as they plug in using an AUX cord and are externally powered, via USB or power supply).
(x1) Arduino 4x4 Matrix Keypad
(x1) USB Switch
(x1) USB-Aux Port
(x1) Port Plug
(x1) 5 Gang Rocker Switch Panel
(x1) 12V (5A or greater) Power Supply
(x1) Audio Splitter Y-Cable (Reference Image)
(x1) Old Android Tablet
(x1) RGB LED (Common Cathode - )
(Optional) Mini Bluetooth Speaker (So you can give commands over your phone. I found a small BT speaker at the dollar store)
Cut the Box
First, you must have all the parts 3D printed, this way you will know where to cut.
Place the Front Speaker part on the box (As shown in the image above) and make an outline so you know where to cut, and make sure to drill a hole for the RGB led.
(I used a plasma cutter to cut everything, but you can use an oscillating tool, or whatever other tool you have available).
Also, be sure to cut out a slot for the 7" Raspberry Pi screen. If you refer to Step 3 of the C.C.H V.2 Tutorial, you can see that the screen's drive is connected to the 3D printed Pi Case. This is why we need to make the slot. The slot allows the driver board to fit inside the box, and let's the RPi screen sit flush against the Pi Case Brace part.
And if you haven't already, you may want to drill two holes for the Keypad wires, so they can go into the box.
Once you have made all your cuts, add duct tapes on the edges to keep the wires and your hands safe from cuts.
Then, you can bolt the Front Speaker, Keypad parts on. (I screwed in the Front Speaker part with some short 8-32 wood screws, and I used 3M Mounting Squares to secure the Keypad part in place. I didn't screw the Keypad part o because the screw hit the top shelf and prevented the box from fully closing).
The Keypad parts fit flush against the top and the side of the box. If you need help spacing them, add the Pi Case Brace part to them. The Pi Case Brace snaps onto the Keypad part (refer to step 3 for more info).
Interior Shelves
Print Int Main Cover A and B (or print the Whole version if you can fit it on your printer) and join them together.
Place Int Main Cover on the lid of the third tier shelf. Mark the squares so you know where to cut.
Cut the three rectangles out in the metal and then bolt Int Main Cover down.
Now, bolt the 5 gang rocker switch to the right-side, the small rectangle is to run wires through (such as the Pi Cam's ribbon cable), and the last rectangle is for a 7" touchscreen if you want to add a second Raspberry Pi to the box.
If you don't plan on adding a second Raspberry Pi, then you don't have to cut out the left-side rectangle. If you already cut it out, or you decided that you might want to add a 7" screen in the future, you can print Int Main Cover A - Cover (Blank-Original) and push fit it onto the left-side rectangle (the A-side/Main Cover A rectangle).
The Base
First, make sure you have the Base part printed.
Place and assemble the two halves of the Base part in the box (If you printed the entire Base in one shot, then just place it in the box, since there's no need to assemble the two halves).
Then, take two 120mm, 12V, light up cooling fans and center them on the L&R side of the box. I used a Knock Out Punch to make the two holes for the fans (Refer to the images above). Now insert the fans into the box, center them with the hole you made, and screw the 120mm Fan Cover part onto the outside of the L&R side of the box to the fans.
Since we're making holes, you should drill out holes for the USB-AUX port (The purchased one), and two more holes for the 3D printed USB-AUX Socket and Wire Feed Slot Socket (Refer to the images above. And refer to Step 6 to see what exactly the 3D printed USB-AUX and Wire Feeder Sockets are).
Now, clean all the metal shavings out of the inside of the box, and begin sticking your Breadboards to the Base. I purchased a 3pck of Breadboards and I placed two Breadboards on front L&R side, and one Breadboard in the back right corner ( directly below the power bar).
The reason why there are no Breadboards in the back left corner is because that is where the 9V and 12V power supplies will go (And yes if you look at one of the images above, you'll spot a Breadboard in the back left corner, but that has been removed so I could fit the 9V and 12V power supplies).
The Base Part 2: Power Supplies
I added my power bar at the right top corner of the box, and secured it with three 3M Mounting Squares (from the dollar store) to the Base part.
The power bar plugs into the port plug which is located in that giant hole that's on the Base part (refer to the images above).
To help with the power placement, I have included a quick layout of where the power bar, 10 port USB charger, port plug, 9V power supply, and 12V power supply should go (Refer to the image above).
The blue rectangle is the 9V power supply.
The yellow rectangle is the 12V power supply.
The purple circle is the port plug.
The orange rectangle is the power bar.
The green rectangle is the 10 port USB charger.
Also in case you're wondering, those holes on the Base part are meant for zip ties so you can feed the zip tie through those holes and around your power cord to keep everything nice and neat.
I just though of this now, but you can those holes a peg board. But you would have to design your own pegs to go into those holes (The holes are 6mm in diameter/3mm radius, and are evenly spaced out 23mm across and 7mm down).
Pi Case Brace
Once you have the Keypad parts attached and the Pi screen inserted in the 3D printed Pi Screen Case, you can take the Pi Screen Case and secure it (flush) to the Pi Case Brace by either welding the plastic together, or by gluing it.
Then, snap the Pi Case Brace onto the Keypads. If you snapped it on properly, it should hold without falling off and not to mention it's a surprisingly strong connection. The good thing about having it snap on/off is that it allows you to remove the Pi screen if needed (Mainly if you want to open your box, you will need to remove the Pi Case Brace because it will prevent the box from opening all the way).
Now you have a beautiful Pi display at the front of your box.
USB-Aux Socket
The USB port on this USB-Aux port will be used as a programming port so we can easily reprogram the A.I system if we have to.
The Aux port on the USB-Aux port will allows us to connect an external speaker to the Android tablet so we can get louder and crisper sound.
If you refer to Step 3 you should already have the 1/2" hole punched/drilled out so we can insert the USB-Aux Socket.
USB-Aux Socket Part 2
Connect the Arduino cables to a USB Hub this way when you want to program them you just plug one cable from your computer to the programming port and you can select which Arduino you want to program.
Then take the male USB end of the USB Hub and plug it into the female end of the USB switch. This will allow us to add a safety so you, or someone else doesn't accidently reprogram the box when they're not supposed to. The two yellow wires coming from the USB switch will be connected to a switch on the 5 gang rocker switch. This way you will have to physically open the box and flip the switch in order to program/reprogram the Arduinos/A.I system (You can refer to Step 6 of the C.C.H V.2 tutorial for a bit of extra info regarding the wiring of the two yellow wires for the USB switch).
If you haven't noticed already, the USB-Aux port has a male end and so does our USB switch. In order to connect these two together you must use a female-female USB coupler (or you could cut them and join each individual wire together, but I highly recommend the female-female USB coupler).
The Aux cord of the USB-Aux port will connect to our Tablet.
Refer to the images above.
Extra Aux-USB Sockets and Wire Feeder Socket
Print Socket End Clamp - Slide On (I used O-2, and you will need to print two of these), Wire Feed Slot Socket, Wire Feed Slot Socket Cover, and USB-AUX Socket (V.2).
Once you have all those parts printed, you can begin assembling them
(Refer to the images above).
The Wire Feed Slot Socket slides into the 1/2" hole we made at the top of our box. Then, use Krazy Glue to secure it onto the box. Now, open the box and slide the Socket End Clamp onto the Wire Feed Slot Socket to clamp the socket in place and prevent it from being pulled out. Before, sliding the Socket End Clamp onto the socket, I recommend adding some Krazy glue on the inside/inner circle of the Socket End Clamp so it is secured to the socket.
The USB-AUX Socket slides into the 1/2" hole we made at the side of our box, next to our fan cover. But before we mount it to the box, we must first add the Aux cable and the USB port. I used an old USB port I had lying around and I wired the Positive and Negative sides to a Male USB cable (This way I can plug it into the 10 port charger and have the female US port act as a charger). Once you have the USB wired up, slide it into its slot on the USB-AUX Socket and glue it in place.
For the AUX cable, I used my Aux Splitter since this will be a port to connect an external speaker to the Raspberry Pi so we can hear it better. Take a female end of the Aux splitter and push it into its slot on the USB-AUX Socket part (You may have to heat up the plastic a bit in order to get the female Aux port/cable through). Once you have done that, you can secure the USB-AUX Socket to the box, doing the same thing you did with the Wire Feed Slot Socket.
RC Antenna
Drill two 8mm (5/16) holes, 2cm from the edge of the top back part of the box, on bot sides (make sure to center them).
Then, print two of the Antenna Hole Socket (located in the Add-Ons folder) parts at 100% infill and place them in the two holes you made.
Take the RC Antenna module and push it through the hole so the threaded part sticks out. Then screw the antenna rod onto it.
The RC module should now be sandwiched, and shouldn't move/be loose. If it is loose, add a dab of hot glue to keep it in place.
Refer to the images above.
Pi Cam
Under the Add-Ons folder, print Front Base Mount (O-2), Pi Cam Mount Base, Pi Cam Mount Cover, and Pi Cam Mount.
Once you have all those parts printed, you can begin assembling everything.
First, place Front Base Mount (O-2) to the box, making sure it's centered, and figure out where you are going to drill your hole so the ribbon cable of the Pi Cam can be fed into the box. (Make sure the hole gets covered by the Front Base Mount Part).
Once you have drilled the hole, you can bolt Front Base Mount to the box.
Now, take Pi Cam Mount and bolt it to Pi Cam Mount Base by using two small screws (I used extra servo screws from my SG90 servos). You should be able to manually move Pi Cam Mount up and down like an adjustable webcam.
Before you place your Pi Cam into the Pi Cam Mount, you must replace the current ribbon cable with a longer one (I used a 100cm long ribbon cable from amazon).
Place the Pi Cam into Pi Cam Mount and secure it in place by snapping on Pi Cam Mount Cover
(If it doesn't snap on nicely and you find it falling off, you can either screw it in, add a few dabs of glue too keep it place, or do what I did and tac-weld/gently melt the corners of Pi Cam Mount and Pi Cam Mount Cover together).
Refer to the images above.
Once you're ready you can plug the Pi Cam's ribbon cable into the Raspberry Pi (I recommended plugging it in when your box is fully completed)
Now you can use the Pi cam as a security camera, a computer vision system, or a regular camera to take pictures or video. (In the future, I plan on using the Pi Cam with OpenCV to have the A.I system identify objects or people).
Wiring - General Info/Overview
The LCD, RGB, and 5 Gang Rocker Switch wiring is pretty much the same as the V2 version of the C.C.H (so refer to Steps 4-6 of the (V.2) tutorial and/or Step 12 of this tutorial), expect this time you have more room for upgrades.
The upgrades that we will be adding are three OLED screens, the two Keypads (future update), RC Modules (future update), and Wifi and/or Bluetooth module (future update).
The wiring is also well commented in the Arduino code, so you can also refer to that.
The wiring for the two Arduino Megas are pretty straight forward (just refer to the images above). The code for the two Arduinos to interact will come in a later update.
12V Fan Wiring & Rocker Switch Panel
The wiring for this should be pretty straight forward.
First, take the 12v (5A or higher) power supply and mount it to the box (refer to Step 4).
Then, take the positive and negative leads from the 12V power supply and connect them to the positive and negative bus of a breadboard. This will be your 12V breadboard.
Now, wire the negative leads of the cooling fans to the negative bus of the breadboard. Take the the two positive leads from the two fans and wire them to two separate rocker switches. Or you can wire them to a single rocker switch if you want (this way they both turn on and off at the same time). It's up to you.
Once you have that wired up, take the positive and negative leads from the dual USB charger and wire it to the positive and negative bus of the breadboard. You should now have power to the dual USB charger.
Please refer to the images above for a better understanding.
Keep in mind that I quickly drew the schematic on on Tinkercad and they did not have fans or a dual USB charger so I improvised.
Also, I have included a schematic of the 5 Gang Rocker Switch Panel from the website and modified it to show my version. The two images above are labeled as the Original Version and My Version.
Refer to My Version for the wiring.
Wiring - Middle OLED
We will be focusing on the middle OLED screen first.
This OLED will be our Audio Analyzer so when the A.I talks we get a cool audio spectrum display.
To start, you will need an Arduino Nano, the OLED screen, and a Sound Sensor.
Place the Arduino Nano on your Breadboard and wire the OLED screen to it.
Here are the connections from the OLED to the Nano:
GND - GND
VCC - 5V
SCL - A5
SDA - A4
Once you have that wired up, take the sound sensor and place it next to the speaker coming from the MOVI Shield. Then wire the Sound Sensor to the Arduino Nano.
Here are the connections from the Sound Sensor to the Nano:
VCC - 5V
GND - GND
OUT - A0
Upload the Audio_Analyzer_Code.ino (Located in the Arduino Codes folder) to the Arduino Nano and you should see the audio spectrum pop up on the OLED screen. Now Adjust the sensitivity of the sound sensor by rotating it's onboard potentiometer until you are satisfied with the results.
I haven't quite figured out what I'm going to use the other 2 OLED screens for but I'm sure I'll think of something (It will most likely be used to display what command its running or something like that. So stay tuned for updates).
The Code
The Arduino & Raspberry Pi Code on my Thingiverse page.
Download the latest Arduino code and upload it to your Arduino Mega (Please follow the Movi Shield instructions before use).
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 next to 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.
Any new updates will be posted here, so anything after this step will be an update.
Update 06/07/21:
Upgraded A.I code.
What's New:
- Changed LCD message displays to OLED displays because it looks nicer and you can do a lot more with it.
- Updated Systems Check Subroutine so it now displays a scan completion percentage.
- Added an OLED Splash Screen display subroutine to let you know that the A.I is online.
V.6 code can be downloaded off my Thingiverse Page (The entire code in one file (all tabs in one file) can be downloaded off Thingiverse, but I uploaded all the code's tabs here. You will have to download each one and place them into the same folder called Baxter_A.I_Code_V6_Works in order to get the full code).
How to wire OLED:
OLED to Movi Shield (Yes, wire it to the Movi Shield, not the Arduino Mega. Refer to the image above.)
//GND to GND
//VCC to 5V
//SCL to SCL
//SDA to SDA
Side Note 06/08/21: If you want to have the last/third OLED screen active you can hook it up to the second Arduino Mega. Given that the two Arduino Mega's are connected together (Refer to Step 11) the last/third OLED screen should display the same thing as the first OLED screen (They will be synced together). In a future update the last/third OLED screen will be independent and display it's own thing, but for now you have this option.
Update 06/10/21:
Random Update.
What's New:
- The A.I can now tell jokes (It randomly picks a joke from it's list and says it)
- The A.I can pick your lotto numbers (It can randomly pick numbers between 0-50)
- The A.I can roll a dice (It randomly picks a number between 1-6)
- The A.I can play Rock, Paper, Scissors with you (It randomly chooses Rock, Paper, or Scissors)
V.6.4 code can be downloaded off my Thingiverse Page (The entire code in one file (all tabs in one file) can be downloaded off Thingiverse, but I uploaded all the code's tabs here. You will have to download each one and place them into the same folder called Baxter_A.I_Code_V6.4_Works in order to get the full code).