https://github.com/maxvfischer/DIY-ai-art Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} maxvfischer / DIY-ai-art * Notifications * Star 275 * Fork 6 How to build your own AI art installation from scratch 275 stars 6 forks Star Notifications * Code * Issues 1 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 2 branches 0 tags Code * Clone HTTPS GitHub CLI [https://github.com/m] Use Git or checkout with SVN using the web URL. [gh repo clone maxvfi] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @maxvfischer maxvfischer Update README.md ... 7c55656 Aug 18, 2021 Update README.md 7c55656 Git stats * 163 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time images Add example images in /images Dec 14, 2020 kiosk Remove my ML stuff Feb 16, 2021 tutorial_images Update main gif Mar 1, 2021 .gitignore Merge main Dec 14, 2020 README.md Update README.md Aug 18, 2021 __init__.py Add top level __init__ Nov 22, 2020 active_artwork.jpg Add test image active_artwork.jpg Dec 14, 2020 config.yaml Remove my ML stuff Feb 16, 2021 frame.png Change name of frame Dec 14, 2020 main.py Remove my ML stuff Feb 16, 2021 requirements.txt Update requirements.txt May 11, 2021 View code [ ] Table of content Prepare the computer (Nvidia Jetson Xavier NX Dev Kit) Install operating system Install base requirements Install Jetson GPIO Install xscreensaver (optional) Install Jetson stats (optional) Install art kiosk Add your generative code kiosk/ arteventhandler.py main.py Build the control box Hand-cut parts Cut wood biscuits holes Glue parts together Remove visible gaps Add hinges Add magnetic lock Milling edges Drill PIR sensor hole Cut cable slots Vent holes Spackling paste and sanding Painting Build the button box Assemble art installation Screen Button box Control box Electronic components Main power cable and junction box Samsung One Connect box Nvidia Jetson's power adapter Nvidia Jetson Connect cables Button PIR sensor Final AI art installation README.md main_gif This guide goes through all the steps to build your own AI art installation, using a button to change the AI artwork displayed on a screen. The main components used in this guide are: * Nvidia Jetson Xavier NX (GPU-accelerated single-board computer) * Screen with HDMI support * Button to change artwork * Passive infrared sensor to reduce risk of screen burn-in It includes how to set up the computer to run an art kiosk (with code), how to build and assemble the control box, how to integrate the button and PIR sensor etc. If you have any questions, feel free to contact me on LinkedIn: https://www.linkedin.com/in/max-fischer-92997281/ or contact final_gif_1 Table of content 1. Prepare the computer (Nvidia Jetson Xavier NX Dev Kit) 1. Install operating system 2. Install base requirements 3. Install Jetson GPIO 4. Install xscreensaver (optional) 5. Install Jetson stats (optional) 2. Install art kiosk 3. Add your generative code 1. kiosk/arteventhandler.py 2. main.py 4. Build the control box 1. Hand-cut parts 2. Cut wood biscuits holes 3. Glue parts together 4. Remove visible gaps 5. Add hinges 6. Add magnetic lock 7. Milling edges 8. Drill PIR sensor hole 9. Cut cable slots 10. Vent holes 11. Spackling paste and sanding 12. Painting 5. Build the button box 6. Assemble art installation 1. Screen 2. Button box 3. Control box 4. Electronic components 1. Main power cable and junction box 2. Samsung One Connect box 3. Nvidia Jetson's power adapter 4. Nvidia Jetson 5. Connect cables 6. Button 7. PIR sensor 7. Final AI art installation Prepare the computer (Nvidia Jetson Xavier NX Dev Kit) The Nvidia Jetson Xavier NX Development Kit (https://www.nvidia.com/ en-us/autonomous-machines/embedded-systems/jetson-xavier-nx/) is a single-board computer with an integrated Nvidia Jetson Xavier NX module (https://developer.nvidia.com/embedded/jetson-xavier-nx). It's developed by Nvidia for running computationally demanding tasks on edge. Similar to the Raspberry Pi, it has 40 GPIO pins that you can interact with. The development kit (version US/JP/TW) includes: * x1 Nvidia Jetson Xavier NX * x1 19.0V/2.37A power adapter * x2 Power cables: + Plug type I -> C5 + Plug type B -> C5 * Quick start / Support guide xavier_1 xavier_2 Install operating system As the Raspberry Pi, Jetson Xavier is using a micro-SD card as its hard drive. As far as I know, there's only one supported OS image (Ubuntu) provided by Nvidia. To install the OS, you'll need to use a second computer. Start of by downloading the OS image: https://developer.nvidia.com/ jetson-nx-developer-kit-sd-card-image. To be able to download it, you need to sign up for a NVIDIA Developer Program Membership. It's free and quite useful as you'll get access to the Nvidia Developer forum. After you've downloaded it, unzip it. To flash the OS image to the micro-SD card, start of by inserting the micro-SD card into the second computer and list the available disks. Find the disk name of the micro-SD card you just inserted. In my case, it's /dev/disk2: xavier_4 When you've found the name of the micro-SD card, unmount it. xavier_5 Now, change your current directory to where you downloaded and un-zipped the OS image. xavier_6 To flash the micro-SD card with the OS image, run the command below. Replace /dev/disk2 with the disk name of your micro-SD card and replace sd-blob.img with the name of the un-zipped image you downloaded. I've sped up the animation, flashing the card usually takes quite a long time (it took ~55 min @ ~4.6 MB/s for me). xavier_7 When you're done flashing the micro-SD card with the image, you're ready to boot up the Jetson! Remove the SD-card from the second computer and insert it into the Jetson computer. The SD-slot is found under the Xavier NX Module. xavier_8 There's no power button, it will boot when you plug in the power cable. After booting and filling in the initial system configuration, you should see the Ubuntu desktop. xavier_9 If you get stuck during boot-up with an output as below, try to reboot the machine. [ *** ] (1 of 2) A start job is running for End-user configuration after initial OEM installation... Full installation guide from Nvidia can be found here: https:// developer.nvidia.com/embedded/learn/ get-started-jetson-xavier-nx-devkit Install base requirements Update and upgrade apt-get sudo apt-get update sudo apt-get upgrade If asked to choose between gdm3 and lightdm, choose gdm3. Reboot before continuing: sudo reboot After reboot, install pip3: sudo apt install python3-pip Install virtual environment: sudo apt install -y python3-venv Create a virtual environment in the directory ~/venvs with the name artkiosk: python3 -m venv ~/venvs/artkiosk Activate the virtual environment: source ~/venvs/artkiosk/bin/activate Install python wheel: pip3 install wheel Install Jetson GPIO Jetson.GPIO is a Python package developed by Nvidia that works in the same way as RPi.GPIO, but for the Jetson family of computers. It enables the user to, through Python code, interact with the GPIO pinouts on the Jetson computer. First, install the Jetson.GPIO package into the virtual environment: pip3 install Jetson.GPIO Then, set up user permissions to be able to access the GPIOs. Create a new GPIO user group (replace your_user_name): sudo groupadd -f -r gpio sudo usermod -a -G gpio your_user_name Copy custom GPIO rules (replace pythonNN with your Python version): sudo cp venvs/artkiosk/lib/pythonNN/site-packages/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/ Full installation guide can be found here: https://github.com/NVIDIA/ jetson-gpio#installation Install xscreensaver (optional) To reduce the risk of burn-in when displaying static art on the screen, a PIR (passive infrared) sensor was integrated. When no movement has been registered around the art installation, a screen saver was triggered. The default screen saver on Ubuntu is gnome-screensaver. It's not a screen saver in the "traditional sense". Instead of showing moving images, it blanks the screen, basically shutting down the HDMI signals to the screen, enabling the screen to fall into low energy mode. The screen I used in this project was a Samsung The Frame 32" (2020). When the screen was set to HDMI (1/2) and no HDMI signal was provided, it showed a static image telling the user that no HDMI signal is found. This is an unwanted behaviour in this set up, as we either wants the screen to go blank, or show some kind of a moving image, to reduce the risk of burn-in. We do not want to see a new static screen telling us that no hdmi signal is found. To solve this problem, xscreensaver was installed instead. It's an alternative screen saver that support moving images. Also, it seems like xscreensaver's blank screen mode works differently than gnome-screensaver. When xscreensaver's blank screen is triggered, it doesn't seems to shut down the HDMI signal, but rather turn the screen black. This is the behaviour we want in this installation. If you're experiencing the same challenge as I did with the screen saver, follow these steps to uninstall gnome-screensaver and install xscreensaver: sudo apt-get remove gnome-screensaver sudo apt-get install xscreensaver xscreensaver-data-extra xscreensaver-gl-extra After uninstalling gnome-screensaver and installing xscreensaver, it was added to Startup Applications: screen_saver_installation_1 screen_saver_installation_2 Full installation guide: https://askubuntu.com/questions/292995/ configure-screensaver-in-ubuntu/293014#293014 Install Jetson stats (optional) Jetson stats is a really useful open-source package to monitor and control the Jetson. It enables you to track CPU/GPU/Memory usage, check temperatures, increase the swap memory etc. To install Jetson stats: sudo -H pip install -U jetson-stats Reboot your machine: sudo reboot Activate the virtual environment again after reboot: source ~/venvs/artkiosk/bin/activate To check CPU/GPU/Memory usage etc: jtop Full list of commands can be found here: https://github.com/rbonghi/ jetson_stats Install art kiosk We're now ready to install the art kiosk on the computer! Start by clone this repository: git clone https://github.com/maxvfischer/DIY-ai-art.git Change active directory and install the dependencies: cd DIY-ai-art pip3 install -r requirements.txt The art kiosk is started by executing: python3 -m main NOTE: The art kiosk will NOT work properly if you don't attach the button and the PIR sensor. Please continue to follow the instructions. The program running the art kiosk is written in Python and is running as 4 parallel processes, each implemented as its own class: Kiosk, ArtButton, PIRSensorScreensaver and GANEventHandler. The entry point is main.py and all the parameters used are defined in config.yaml (e.g. path to image directory, GPIO pinouts used etc). screen_saver_installation_1 Process/Class File Description The Kiosk process handles all the GUI: toggling () and ending Kiosk kiosk/kiosk.py () fullscreen, listens to change of the active artwork to be displayed etc. The ArtButton process listens to a GPIO pinout connected to a button. When the button is pushed and ArtButton kiosk/artbutton.py the GPIO is triggered, it replaces the active artwork file with a random image sampled from the image directory. The PIRSensorScreensaver process listens to a GPIO pinout connected to a PIR sensor. When no motion has kiosk/ triggered the PIR sensor PIRSensorScreensaver pirsensorscreensaver within a predefined threshold of seconds, the computer's screensaver is activated. When motion is detected, the screensaver is deactivated. The ArtEventHandler process is listening to deleted items in the image directory. When the button is clicked and an image is deleted (i.e. moved to replace the active artwork file, active_artwork.jpg), kiosk/ this process checks how ArtEventHandler art_event_handler.py many images that are left in the image directory. If the number of images falls are below a predefined threshold, a new process (function) is spawned, generating a new set of images. You need to update this class to generate the images. Add your generative code You need to add your own generative code (GAN-network or others), by updating two files: * kiosk/arteventhandler.py * main.py kiosk/arteventhandler.py The class ArtEventHandler found in the file kiosk/arteventhandler.py is an event handler that is triggered to generate new images to be saved in the image directory. When an image is deleted from the image directory (i.e. moved to replace the active artwork), ArtEventHandler's class function on_deleted is executed. It checks if the number of images found in the image directory is above or below a pre-defined threshold. If the number of images falls below the threshold, ArtEventHandler's class function generate_images is executed. It is in this function that you need to add your generative code that will add new images to the image directory. main.py If you have updated ArtEventHandler's constructor with new arguments, you need to update the initialization of ArtEventHandler in the function start_art_generator found in main.py. Build the control box To get a nice looking installation with as few visible cables as possible, a control box was built to encapsulate the Nvidia computer, power adapters, Samsung One Connect box etc. Hand-cut parts The control box was build using 12mm (0.472") MDF. A vertical panel saw was used to cut down the MDF into smaller pieces. A table saw was used to cut out the final pieces. raw_mdf vertical_panel_saw table_saw Piece Dimensions (width, height) Sketch Bottom base panel 320mm x 235mm table_saw Top lid panel 344mm x 259mm table_saw Left side panel 235mm x 57mm table_saw Right side panel 235mm x 57mm table_saw Top side panel 344mm x 57mm table_saw Bottom side panel 344mm x 57mm table_saw raw_pieces raw_pieces_with_lid Cut wood biscuits holes To make the control box robust, wood biscuits were used to glue the parts together. By using wood biscuits, no screws were needed, thus giving a nice finish without visible screw heads. It also helps to aligning the pieces when gluing. When using the wood biscuit cutter, it's important that the holes end up at the correct place at the aligning panels. One simple way of solving this is to align your panels and then draw a line on both panels at the center of where you want the biscuit to be. If you do this, the holes will end up at the right place. wood_biscuit_align wood_biscuit_machine_1 wood_biscuit_machine_2 wood_biscuit_all_pieces Before gluing the pieces together, check that the connecting holes are correctly aligning and that all wood biscuits fit nicely (they can somethings vary a bit in size). wood_biscuit_asseble Glue parts together When gluing the parts together, you'll need to be fairly quick and structured. Prepare by placing the aligning panels next to each other and have all the wood biscuits ready. gluing_1 gluing_2 Start of by adding the glue in the wood biscuit holes. gluing_3 Then, press down the wood biscuits into the holes and apply wood glue along all the connecting parts. gluing_4 Now, assemble all the connecting parts and apply force using clamps. You should see glue seeping out between the panels. gluing_5 Use an engineer's square to check each corner. gluing_6 Finally, remove all the visible redundant glue with a wet paper tissue. gluing_7 gluing_8 Remove visible gaps After removing the clamps, there were some visible gaps and cracks that needed to be filled. spackling_1 spackling_2 spackling_3 I used plastic padding (a two component plastic spackling paste) to cover up the gaps and cracks. Be careful with how much hardener you add, as it will dry very quickly if adding too much. spackling_4 spackling_5 spackling_6 spackling_7 When everything had dried, an electric sander was used to remove redundant plastic padding. The inside of the box was smoothed by manual sanding. As a rule of thumb, if you can feel an edge or a crack, it will be visible when painted. spackling_8 spackling_9 Add hinges The hinges were first added to the lid. It made it easier to align the lid on top of the box later on. The hinge mortises were measured and outlined. An electric multicutter tool was then used to cut out a grid with the same depth as the hinges. The material was then removed using a chisel and a hammer. The mortises were then smoothed by manual sanding. hinge_1 hinge_2 hinge_3 hinge_4 hinge_5 hinge_6 The hinges were aligned and a bradawl was used to mark the centers of the holes. MDF is a very dense material, therefore it's important to pre-drill before screwing the hinges in place. If you don't do this, there's a high risk that the material will crack. hinge_7 hinge_8 The depth of the screws were measured and adhesive tape was used to mark the depth on the drill head. hinge_9 hinge_10 hinge_11 Before aligning the hinges on the box, make sure to add some support under the lid, it should be able to rest at the same level as the control box. Double-coated adhesive tape was then attached to each hinge and the lid was aligned on top of the box. When the lid was correctly aligned, pressure was applied to make the adhesive tape stick. hinge_12 hinge_13 hinge_14 The hinge holes and the mortises were drilled and cut out in the same way as on the lid. hinge_15 hinge_16 hinge_17 hinge_18 hinge_19 hinge_20 hinge_21 hinge_22 hinge_23 hinge_24 Add magnetic lock A magnetic lock was used to keep the lid in place. magnetic_lock_1 magnetic_lock_2 magnetic_lock_3 magnetic_lock_4 magnetic_lock_5 magnetic_lock_6 magnetic_lock_7 magnetic_lock_8 magnetic_lock_9 Milling edges All the edges were rounded using a handheld milling machine. milling_1 milling_2 milling_3 Drill PIR sensor hole To integrate the PIR sensor, the control box was disassembled. A hole was then measured, aligned and drilled all the way through the lid to enable the PIR reflector to stick out. A larger drill with the same diameter as the sensor chip was then used to carefully extend the slot from the inside of the lid. The extended hole was not drilled all the way through, approximately 2 mm was left for the sensor chip to rest on. Finally, a sand paper was used to manually sand the edges for a perfect fit. pir_sensor_1 pir_sensor_2 pir_sensor_3 pir_sensor_4 pir_sensor_5 pir_sensor_6 Cut cable slots To enable the cables to go in and out of the box, two cable slots were cut out: 1. One cable slot in the top side panel for the One Connect cable and button cables. 2. One cable slot in the bottom side panel for the electrical cable. Initially, the cable slots were only cut half way through the top and bottom panels. But I then realized (after I had assembled and painted everything -\(tsu)/-), that it will look much better if I cut the cable slots all the way through and then glue a piece of MDF into the hole to cover up the redundant space. That's why the control box is painted in the images below. A caliper was used to measure the diameter of the cables. An extra ~1mm was then added to the slots for the cables to fit nicely. But in hindsight I would've extended the slot 2-3 mm more. caliper The slots were then outlined at the center of the top and bottom panels. The outlines were also extended approximately 15 mm into the back panel. A Japanese hand saw/Dozuki saw was used to cut out the slots. A small chisel and a hammer was used to remove the cut out pieces. cable_slot_4 cable_slot_5 cable_slot_7 cable_slot_6 A hole saw was used to extract a larger hole in the top of the back panel, connected to the top panel's cable slot. It enabled the One Connect Cable to be inserted. cable_slot_8 Pieces of MDF with the same width and height as the cable slots were cut out. Sand paper was used to do small adjustments. The cables were then inserted into the slots and the MDF pieces were aligned and cut to give just enought space for the cables to fit. cable_slot_11 cable_slot_9 cable_slot_10 Wood glue were applied and smeared out on the connecting parts. The MDF pieces were then squeezed into the slots. cable_slot_11 cable_slot_12 cable_slot_13 Vent holes Vent holes were drilled in the bottom and the top panel to enable heat to flow out of the control box. vent_holes_1 vent_holes_2 Spackling paste and sanding Plastic padding were used cover the cracks between the cables slots and the glued MDF pieces. The control box was then manually sanded to remove the redundant plastic padding and round the edges around the vent holes etc. spackling_11 spackling_12 spackling_13 spackling_10 Painting The control box was painted in the same color as the wall it was attached to. A tip is to buy a color sample can instead of a full can. You will not need a full can, and the sample cans are usually cheaper per litre. A paint roller was used on the flat areas and a small brush was used to paint the smaller details. painting_1 painting_2 painting_3 painting_4 painting_5 After the paint had dried, everything was reassembled. painting_6 Build the button box A modified black plastic enclosure box was used as a button box. To integrate the button, the vertical and horizontal center was first measured and pre-drilled. Then, a hole with the diameter of the button was drilled. button_box_1 button_box_2 button_box_3 button_box_4 button_box_5 As the button box will be located between the control box and the screen, the two button cables and the One Connect cable (bringing electricity and HDMI to the screen) will enter the button box at the bottom. The One Connect cable will also exit the button box at the top (continuing to the TV). Two cable slots were therefore extracted at the top and the bottom, using a Japanese hand saw/Dozuki saw. The slots were then smoothed by manual sanding. button_box_6 button_box_7 button_box_8 The screws keeping the enclosure box together were colored black using an aerosol varnish paint. A tip when painting screws is to stick them into a piece of styrofoam. button_box_9 button_box_10 Assemble art installation The art installation was now ready to be assembled and attached to the wall. A cross line laser was used to vertically align the screen, button box and control box. Screen The screen (Samsung The Frame 32" 2020) was wall-mounted following the instructions included when buying the screen. assembly_1 Button box Two screw holes were drilled in the bottom plate of the button box. Double-coated adhesive tape was also attached to the back side of the bottom plate for further support. The button box was then aligned using the laser and attached to the wall using two wall plugs, the two screws and the double-coated adhesive tape. assembly_3 assembly_6 assembly_4 assembly_5 assembly_7 assembly_8 assembly_9 Control box The control box was attached to the wall using wall plug and two screws. To be able to outline the screw holes, all the electronics were temporarily placed in the control box and two screw holes were outlined and drilled. The HDMI/One Connect cable were then inserted into the cable slot and the control box was attached to the wall. assembly_10 assembly_11 assembly_12 assembly_13 Electronic components NOTE: THIS PART INCLUDES WIRING OF HIGH VOLTAGE ELECTRICITY THAT CAN BE LETHAL IF NOT DONE PROPERLY. THE COLORS OF THE CABLES CAN VARY DEPENDING ON REGION/COUNTRY. BEFORE YOU CONNECT THE POWER CORD TO THE POWER OUTLET, CONSULT WITH A LICENSED ELECTRICIAN TO MAKE SURE THAT EVERYTHING IS PROPERLY WIRED AND THAT IT IS IN LINE WITH YOUR LOCAL LEGISLATIONS. Main power cable and junction box The female side of the main power cord was removed and the cable was inserted into the control box. A junction box was then attach in the bottom right corner using velcro tape. Before the velcro tape was attached, the backside of the junction box was cleaned with denatured alcohol. Three holes were created in the side of the junction box to enable three cables to enter. assembly_14 assembly_15 assembly_16 assembly_17 assembly_18 assembly_19 A wire stripper was used to strip the jacket/insulation of the power cord, as well as the wires inside. A splicing connector (Wago 221, 3-conductor) was then attached to each wire, enabling electricity from a single power outlet to be split to the One Connect Box and to the Nvidia Jetson Xavier NX, without using a power strip. assembly_54 assembly_20 assembly_21 assembly_22 Samsung One Connect box The Samsung One Connect box was then attached in the left bottom corner using velcro tape. Some margin was left below and to the left of the One Connect box for the power cord and for the PIR sensor cables. Also, the backside of the One Connect Box was cleaned using denatured alcohol before attaching the velcro tape. assembly_23 assembly_24 The screen's power cord (IEC C7 coupler) was inserted into the One Connect Box. It was then aligned, measured and cut at an appropriate length to reach inside the junction box. The wire stripper was used to remove the jacket/insulation of the power cord, as well as the wires inside. The C7 cable was then inserted into the junction box and connected to the splicing connectors. The ground was left out as the C7 coupler is ungrounded. assembly_26 assembly_25 assembly_27 Nvidia Jetson's power adapter The power adapter to the Nvidia Jetson Xavier NX was attached in the top left corner using velcro tape. The power cord (IEC C5 coupler) was inserted into the power adapter. It was then aligned, measured and cut at an appropriate length to reach inside the junction box. The wire stripper was used to remove the jacket/insulation of the power cord, as well as the wires inside. The C5 cable was then inserted into the junction box and connected to the splicing connectors. assembly_28 assembly_29 assembly_30 assembly_31 Before closing the junction box, cable ties were tightened around each cable going into the junction box as strain reliefs. assembly_32 assembly_55 Nvidia Jetson To attach the Nvidia Jetson, two pieces of galvanised band was cut out and wrapped in insulating tape. The computer was then attached in the top right corner using 4 small screws and washers. assembly_56 assembly_57 assembly_58 assembly_33 assembly_34 Connect cables The HDMI, the One Connect Cable and the Xavier NX power cable were connected. Cable ties were used to structure the cables. assembly_35 assembly_36 Button The button changing the artwork was implemented as a pull-up resistor. When the button is "off" (i.e. not pushed), a small current will flow from the positive 3.3v, through the resistor and into the GPIO pin, leading to the GPIO pin being HIGH (1). On the other hand, when the button is pushed, the current will flow from the positive 3.3v, through the resistor, via the button and into ground (GND). This will lead to the GPIO pin being LOW (0). This shift in HIGH/LOW on the GPIO pin is registered in the code and is used to change the artwork on the screen. The schema for the pull-up resistor can be found below. pull_up_resistor Two cables were measured and soldered to the button. The cables were then inserted into the control box via the same cable slot as the One Connect cable. Make sure that you have enough cable to reach to the Nvidia Jetson computer. assembly_37 The end of a female jumping wire were then soldered to the end of the cable connecting to the ground (for being able to unplug the cable easily). Before soldering the two cables together, one of the cables were passed through a shrinking tube. After the cables were soldered together, a blow torch was used to shrink the tube around the soldering. assembly_38 A 1kO resistor and a female jumping wire were soldered to the other button cable. Finally, another female jumping cable were soldered to the other side of the resistor. assembly_39 assembly_40 assembly_41 assembly_42 The jumping wires were then connected to the following Nvidia Jetson GPIOs: * Blue: Ground (pin 14) * Red: 3.3v (pin 17) * Green: GPIO (pin 15) button_pinout assembly_43 The Samsung One Connect cable were finally inserted through the button box and the button box's top plate was attached. assembly_44 assembly_45 A cable channel was attached to the wall between the button box and the control box using double-coated adhesive tape, fitting the button cables and the One Connect cable. Before it was painted, the cable channel was manually sanded to make a better grip for the color. A primer was then added, followed by two layers of wall paint. assembly_60 assembly_61 assembly_62 assembly_63 assembly_64 assembly_65 PIR sensor Three cables of equal length were measured and cut out (I would've preferred to have three different colors, but I only had black and red cable). assembly_46 Three female/female jumping wires were then cut in the middle and soldered to the three cables, one set of jumping wires for each cable. To compensate for the bad coloring of the main cables, three different colors were chosen for the jumping wires. Multiple larger shrinking tubes were used to keep the three cables together. assembly_47 assembly_48 The PIR sensor I used was a SR602. It has three pinouts that were connected to the Nvidia Jetson: * - to GND (pin 6) * + to 3.3v (pin 1) * out to a GPIO (pin 7) pir_pinout When the PIR sensor register a person walking by, out will be HIGH. When there's no detection, out will be LOW. The PIR sensor were then inserted into its slot in the control box lid. assembly_59 assembly_49 assembly_50 assembly_51 assembly_52 assembly_53 Final AI art installation final_gif_1 final_1 final_2 final_3 final_4 final_5 final_6 final_7 final_8 About How to build your own AI art installation from scratch Topics pir-sensor nvidia-jetson jetson-xavier xavier-nx art-kiosk Resources Readme Releases No releases published Packages 0 No packages published Languages * Python 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.