-
1Drill holes in the plastic case and paint
Grab the plastic case, and mark the spots where to drill some holes as per the following diagram.
Then drill the three small holes for where the speaker will be, so the sound can come out. Next drill the bigger hole on top right to place the button. Check your button diameter to pick the proper drill size.
After drilling, the edges around the holes tend to have a bit of an edge, so just cut around holes with a box cutter to make it all flat.
You can leave your case transparent, or if you want to give it a paint job now is a good time. A primer paint for cars works well.
-
2Prepare and attach wires for speaker and button
Now let's prepare the speaker cables. They are really long and so they probably would be tricky to fit into the case. So shorten them by cutting and soldering them back together, and fitting a heat shrink wrap, as show in the picture.
Next, strip some extra jumper wires and attach and solder them to the button.
-
3Attach button, speaker and camera module to case cover
At this point all the components are ready to be attached to the case cover. First install the button.
Then the speaker: attach its wires, remove the adhesive band, and press it in place.
And then attach the camera module, which clicks nicely into the special case fittings.
-
4Prepare and solder audio out wire
Now for audio out, cut and strip another jumper wire (male so it connects with female wire on speaker), and pull it through the hole near the audio.
And then solder it to the audio out pin from the 3.5 millimeter audio jack.
See the following image of the back of the Pi with the red arrow to see the exact location of the pin.
-
5Connect all the wires and close the case
Now is the time to push the Raspberry Pi into the base of the case and connect up all the wires.
See the following diagram image of Raspberry Pi pin numbers. Connect speaker power to Pin #1. Speaker ground to #6. Button wires to pin #7 and #9.
And of course connect the white speaker wire to the wire we soldered to the back of the Pi.
Then close the case shut.
-
6Install a fresh OS on Raspberry Pi
For your Raspberry Pi 3 (or 3+), download and unzip Raspbian Stretch.
Apparently you should not install the latest Raspberry Pi OS because the audio player has an issue. I would hope that at some point it will be resolved.
Download and install the Raspberry Pi Imager.
Connect and format your microSD card. Then launch the Raspberry Pi Imager.
Pick a custom OS to install, and navigate to the Raspbian Stretch file you had downloaded and unzipped.
Select your microSD card, and click on "WRITE".
When it's finished, plug the microSD card into your Raspberry Pi.
Connect a monitor with the HDMI cable, and connect a USB mouse and keyboard. Then power up the Raspberry Pi.
-
7Configure Pi to connect to WiFi and get the camera to work properly
Once it's up and running, go though the initial dialogs and get connected to WiFi.
Then click on the Raspberry icon on the upper left, then "Preferences", then "Raspberry Pi Configuration".
Then click on "Interfaces". Enable camera. Click OK and accept to reboot.
To check the camera is working, open up a Console by clicking on the black console icon on the top left:
Type the following.
raspistill -o cam.jpg
Then open up File Manager by clicking on the yellow folder icon on the top left:
And double click on cam.jpg to check whether the image is correct.
-
8Configure and check the speaker
Right click on the Volume icon in the upper right corner and select "Analog".
Now left click on the same volume icon and set volume. I suggest setting it to about 80%.
Next, let's open up a console again, and run the following command:
speaker-test
You should hear white noise.
If you want to hear a proper sound, type the following command:
aplay /usr/share/sounds/alsa/Front_Center.wav
Now you should hear a human voice.
-
9Configure the microphone
Right click on the volume icon again, and then click on "USB Device Settings".
Then click on the "Sound card" drop down menu, and select "USB PnP sound device".
Click on "Select Controls...", and select both "Microphone" and "Auto Gain Control, then click on "Close".
Now set the microphone slider to about 80% as well and click ok. You might find the microphone is quite bad and creates quite a bit of white noise. You can always come back to this setting and reduce the slider, but then you will have a harder time to hear sounds from the doorbell.
At this point our raspberry pi is properly built and configured, so it's time to to take care of software.
-
10Download the Seajei SDK and run the Raspberry Pi sample
Open up the raspberry pi browser, and type seajei.com.
Scroll down a bit and click on "Free SDK".
In the next page scroll down a bit and click on "Download SDK". It will get downloaded to your Downloads folder.
Open up File Manager, and go to your Downloads folder.
Right click on the Seajei SDK zip file, then click on extract here. Then move the Seajei SDK folder to the desktop.
Next, open a Console, and navigate to the doorbell demo with the following command (adjust of you have a different SDK version):
cd Desktop/Seajei-3.1.8/SamplePrograms/RaspberryPi/Doorbell
Look at what's in README by typing:
cat README
Then as mentioned in there run the sudo apt update command, and copy paste the other sudo apt command and run it. You can run the whole thing in one line like so:
sudo apt update; sudo apt install libopus-dev libssl-dev portaudio19-dev
When that's all done, run the build script for your Pi 3, which is the following command:
./build_pi_3_4.sh
And then run the doorbell executable by typing:
./doorbell
Take note of the device ID, because you will need it to connect from the iOS app. In my case it's "vmy9dj".
This is a good time to check the pi button is working. Click a few times on it and check that you get the "Button triggered" message.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.