The Joker Box is made of three main components which are the Raspberry Pi, printer, and the casing around them. The case is there to protect the Pi and to make neat of the wires.
Area of Interest
Newark Collegiate Academy
My overall project is now nearly complete. For my second milestone, I hooked a Dad Joke API up to my LED button. Now when you press the button, the Raspberry Pi gets a command to run a shell script that’s connected to an application programming interface (API) used for fetching random “Dad Jokes” (https://icanhazdadjoke.com). Every time the button is pushed the Raspberry Pi prints the joke out on the monitor. See figure 2 for the results. My next step is connecting the printer so that jokes will print out of the printer instead of onto the screen. An API is a set of functions and procedures allowing the creation of applications that access the features or data of an operating system, application, or other service. Shell scripts are computer programs designed to be run by the Unix shell (a command-line interpreter), which in this case allows me to pull information from a given website. See figure 1 for how to do this. This took a while to accomplish simply because it requires large amounts of coding and a lot of downloads. This is a very important part of the Joker box because this is the main function and purpose for this project. I learned about some general coding things that I had to use in order to give the button the power to command the jokes like the shell scripts described. From this I learned that small typos such as miscapitalized letters or missing punctuation can make a really big impact on my code. I made many mistakes in this process while coding and creating files. Most of my mistakes were simply typos, but in coding every single character counts and has its own meaning so they still caused my code to fail.
from gpiozero import Button
from signal import pause
button – Button(26)
button.when_pressed = say_hello
button.when_released = say_goodbye
Figure 1: This section of code is for the button to actually function. After wiring the correct circuit the button had to be plugged into the raspberry Pi into a GPIO or General Purpose Input Output. As you can see the 26 in the picture it was plugged in GPIO 26.
Figure 4: Schematic of the LED button. This is the circuit that allows the LED in the button to light and send data to the Raspberry Pi.
curl -H “Accept: text/plain” https://icanhazdadjoke.com/
Figure 2: Code for the Dad Joke API. This is what allows the jokes to be called manually or by the button. To call them manually you have to run the program (./Dad-Jokes.sh) and it prints one joke but with the button you call the shell script I wrote (./button.py). Every time you push the button it prints out another button.
Figure 5: Just an Example of a joke. This is an example of manually calling the API.
My project is Joker Box that will print out a joke when a button on the box is pushed. For my first milestone, I have finally completed the setup for the Raspberry Pi that I will use for getting the jokes.
The Raspberry Pi is functionally a computer with its own memory and processing. The Raspberry Pi is now connected to the printer and will be able to print things from commands along with power to both the Pi and printer. The process in which I did this may seem difficult but for me it was just a lot of reading and writing. First I hooked the Pi up to a monitor, keyboard, mouse, and power. When it turned on initially the first thing done was the set up such as its new name and password. After the beginning set up I wrote all the code for the Pi that was needed (https://www.raspberrypi.org/help/noobs-setup/2/).
From this experience I have learned ways to communicate through the terminal interface on the actual Raspberry Pi itself. Terminal is basically an emulator system that allows me to run the Raspberry Pi as if it’s a computer by using command prompt. I never knew that a terminal was accessible from chromebook. I not only learned that, but I know how to use it somewhat now. It was a very long and complicated process that I made many mistakes on mostly typing. In terminal every character is specific to its meaning so one mishap or skipped word means big trouble. But it just taught me to check my work and do not try to rush through it. Something else that was really major in this milestone was the process of installing NOOBS. NOOBS aka New out of box software is a software that allows for the Raspberry Pi to be setup without a network. It is an operating system or the very basis of all computer interactions, and it basically allowed me to get my mini computer working so I could, from there, get it connected to the thermal printer. From here out I will be building the case and giving the printer power to test run it. This is an important part of the project because this is the use of the Raspberry Pi without this step this project wouldn’t be able to print or connect to the internet.
My project is a Phone charger that works for Android and IPhone by using two AA’s batteries, the MintyBoost (https://learn.adafruit.com/minty-boost/icharging). The circuit is soldered with multiple electrical components. Specifically, there are two inductors, a single capacitor, and many different resistor types. An inductor is a passive two-terminal electrical component that stores energy in a magnetic field when an electric current flows through it. A capacitor is a passive two-terminal electronic component that stores electrical energy in an electric field. A resistor is a device having a designed resistance to the passage of an electric current.
The batteries used does not have enough volts in order to charge a phone. The battery voltages are about 3V. So in order to get the 5V needed to charge a phone, there is a buck boost converter made with the electrical components.
The circuit diagram for the MintyBoost can be seen in figure 3. As you can see in figure 4, I first made a really big mistake. I soldered the charger adapter to the wrong side and when trying to unsoldered it I crushed it under the pressure of the pliers. I grabbed another MintyBoost kit to make and then it worked perfectly.
Overall I learned what inductors and capacitors are and how they can make a voltage increase together. I also learned how to solder metal together to make strong bonds between two things conclusively making a circuit and resistors; what they do and how they work.
My Starter Project is the MintyBoost, a portable charging device. When you plug in a device, it will charge it using two AA batteries!! I enjoyed this project because I learned about the different electrical components and their roles in this circuit including capacitors, inductors, and resistors. I also learned how to solder.