├── LICENCE.md ├── README.md ├── STL ├── Astro_Pi3_Enclosure_3D_PRINT_SECTION_2 V2.STL ├── Astro_Pi3_Enclosure_3D_PRINT_SECTION_3 V2.STL ├── Astro_Pi_Enclosure_3D_PRINT_SECTION_1 V1.STL ├── Astro_Pi_Enclosure_3D_PRINT_SECTION_2 V1.STL ├── Astro_Pi_Enclosure_3D_PRINT_SECTION_3 V1.STL ├── Astro_Pi_Enclosure_3D_PRINT_SECTION_4 V1.STL └── Astro_Pi_Enclosure_3D_PRINT_SECTION_4_PILOT V2.STL ├── cover.png ├── dtb ├── astropi-keys.dtbo └── astropi-keys.dts ├── hardware.yml ├── images ├── apem.jpg ├── apem_wiring.jpg ├── buttons1.png ├── buttons2.png ├── buttons3.png ├── buttons4.png ├── buttons_GPIO.png ├── epoxy_adhesive.png ├── fit_check.png ├── fittings.png ├── flight_unit_wiring.jpg ├── header.png ├── install_camera.png ├── install_fit_check.png ├── install_pi1.png ├── install_pi2.png ├── install_pi3.png ├── install_sense1.png ├── install_sense2.png ├── install_sense3.png ├── jumper_wiring.png ├── pi3_wifi.jpg ├── raw_print_base.png ├── raw_print_heatsink.png ├── raw_print_lid.png ├── raw_print_middle.png ├── ribbon1.png ├── ribbon2.png ├── scaff_base.png ├── scaff_heatsink.png ├── scaff_lid1.png ├── scaff_lid2.png ├── scaff_lid3.png ├── scaff_lid4.png ├── scaff_middle.png └── track_point_cap.png ├── learn.md ├── meta.yml ├── overview.md ├── software.yml ├── test_code └── pygame_test.py ├── worksheet.md └── worksheet2.md /LICENCE.md: -------------------------------------------------------------------------------- 1 | # Licence 2 | 3 | Unless otherwise specified, everything in this repository is covered by the following licence: 4 | 5 | [![Creative Commons License](http://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/) 6 | 7 | ***3D Printed Astro Pi Flight Case*** by the [Raspberry Pi Foundation](http://www.raspberrypi.org) is licenced under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). 8 | 9 | Based on a work at https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 3D printed Astro Pi flight case 2 | 3 | ![](cover.png) 4 | 5 | The Astro Pi flight case is one of the most desirable cases in the history of the Raspberry Pi. With this resource you will learn how to 3D print your own case and install the Astro Pi hardware inside it. You'll then have your very own Astro Pi flight unit, identical in almost every way to the ones on the International Space Station right now. 6 | 7 | If you're participating in an Astro Pi competition, this is a great way to prototype and efficiently test your code in the same way as it would be used by the crew of the ISS. 8 | 9 | ## Worksheet 10 | 11 | - [Worksheet](worksheet.md) 12 | - [Worksheet 2](worksheet2.md) 13 | 14 | ## Licence 15 | 16 | Unless otherwise specified, everything in this repository is covered by the following licence: 17 | 18 | [![Creative Commons License](http://i.creativecommons.org/l/by-sa/4.0/88x31.png)](http://creativecommons.org/licenses/by-sa/4.0/) 19 | 20 | ***3D Printed Astro Pi Flight Case*** by the [Raspberry Pi Foundation](http://www.raspberrypi.org) is licenced under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/). 21 | 22 | Based on a work at https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /STL/Astro_Pi3_Enclosure_3D_PRINT_SECTION_2 V2.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi3_Enclosure_3D_PRINT_SECTION_2 V2.STL -------------------------------------------------------------------------------- /STL/Astro_Pi3_Enclosure_3D_PRINT_SECTION_3 V2.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi3_Enclosure_3D_PRINT_SECTION_3 V2.STL -------------------------------------------------------------------------------- /STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_1 V1.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_1 V1.STL -------------------------------------------------------------------------------- /STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_2 V1.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_2 V1.STL -------------------------------------------------------------------------------- /STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_3 V1.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_3 V1.STL -------------------------------------------------------------------------------- /STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_4 V1.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_4 V1.STL -------------------------------------------------------------------------------- /STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_4_PILOT V2.STL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_4_PILOT V2.STL -------------------------------------------------------------------------------- /cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/cover.png -------------------------------------------------------------------------------- /dtb/astropi-keys.dtbo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/dtb/astropi-keys.dtbo -------------------------------------------------------------------------------- /dtb/astropi-keys.dts: -------------------------------------------------------------------------------- 1 | /dts-v1/; 2 | /plugin/; 3 | / { 4 | compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709"; 5 | 6 | fragment@0 { 7 | target-path = "/soc"; 8 | __overlay__ { 9 | keypad: keypad { 10 | compatible = "gpio-keys"; 11 | #address-cells = <1>; 12 | #size-cells = <0>; 13 | pinctrl-names = "default"; 14 | pinctrl-0 = <&astropi_pins>; 15 | 16 | button@13 { 17 | label = "AstroPi BTN0"; 18 | linux,code = <32>; 19 | gpios = <&gpio 13 1>; 20 | }; 21 | button@16 { 22 | label = "AstroPi BTN1"; 23 | linux,code = <30>; 24 | gpios = <&gpio 16 1>; 25 | }; 26 | button@19 { 27 | label = "AstroPi BTN2"; 28 | linux,code = <19>; 29 | gpios = <&gpio 19 1>; 30 | }; 31 | button@20 { 32 | label = "AstroPi BTN3"; 33 | linux,code = <38>; 34 | gpios = <&gpio 20 1>; 35 | }; 36 | button@21 { 37 | label = "AstroPi BTN4"; 38 | linux,code = <48>; 39 | gpios = <&gpio 21 1>; 40 | }; 41 | button@26 { 42 | label = "AstroPi BTN5"; 43 | linux,code = <22>; 44 | gpios = <&gpio 26 1>; 45 | }; 46 | }; 47 | }; 48 | }; 49 | 50 | fragment@1 { 51 | target = <&gpio>; 52 | __overlay__ { 53 | astropi_pins: astropi_pins { 54 | brcm,pins = <13 16 19 20 21 26>; 55 | brcm,function = <0>; // in 56 | brcm,pull = <2>; // up 57 | }; 58 | }; 59 | }; 60 | }; 61 | -------------------------------------------------------------------------------- /hardware.yml: -------------------------------------------------------------------------------- 1 | - name: Raspberry Pi camera module 2 | img: camera 3 | - name: NoIR camera module (alternative) 4 | img: camera-noir 5 | - name: Sense HAT 6 | img: sense-hat 7 | -------------------------------------------------------------------------------- /images/apem.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/apem.jpg -------------------------------------------------------------------------------- /images/apem_wiring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/apem_wiring.jpg -------------------------------------------------------------------------------- /images/buttons1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/buttons1.png -------------------------------------------------------------------------------- /images/buttons2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/buttons2.png -------------------------------------------------------------------------------- /images/buttons3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/buttons3.png -------------------------------------------------------------------------------- /images/buttons4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/buttons4.png -------------------------------------------------------------------------------- /images/buttons_GPIO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/buttons_GPIO.png -------------------------------------------------------------------------------- /images/epoxy_adhesive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/epoxy_adhesive.png -------------------------------------------------------------------------------- /images/fit_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/fit_check.png -------------------------------------------------------------------------------- /images/fittings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/fittings.png -------------------------------------------------------------------------------- /images/flight_unit_wiring.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/flight_unit_wiring.jpg -------------------------------------------------------------------------------- /images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/header.png -------------------------------------------------------------------------------- /images/install_camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_camera.png -------------------------------------------------------------------------------- /images/install_fit_check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_fit_check.png -------------------------------------------------------------------------------- /images/install_pi1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_pi1.png -------------------------------------------------------------------------------- /images/install_pi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_pi2.png -------------------------------------------------------------------------------- /images/install_pi3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_pi3.png -------------------------------------------------------------------------------- /images/install_sense1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_sense1.png -------------------------------------------------------------------------------- /images/install_sense2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_sense2.png -------------------------------------------------------------------------------- /images/install_sense3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/install_sense3.png -------------------------------------------------------------------------------- /images/jumper_wiring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/jumper_wiring.png -------------------------------------------------------------------------------- /images/pi3_wifi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/pi3_wifi.jpg -------------------------------------------------------------------------------- /images/raw_print_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/raw_print_base.png -------------------------------------------------------------------------------- /images/raw_print_heatsink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/raw_print_heatsink.png -------------------------------------------------------------------------------- /images/raw_print_lid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/raw_print_lid.png -------------------------------------------------------------------------------- /images/raw_print_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/raw_print_middle.png -------------------------------------------------------------------------------- /images/ribbon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/ribbon1.png -------------------------------------------------------------------------------- /images/ribbon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/ribbon2.png -------------------------------------------------------------------------------- /images/scaff_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_base.png -------------------------------------------------------------------------------- /images/scaff_heatsink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_heatsink.png -------------------------------------------------------------------------------- /images/scaff_lid1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_lid1.png -------------------------------------------------------------------------------- /images/scaff_lid2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_lid2.png -------------------------------------------------------------------------------- /images/scaff_lid3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_lid3.png -------------------------------------------------------------------------------- /images/scaff_lid4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_lid4.png -------------------------------------------------------------------------------- /images/scaff_middle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/scaff_middle.png -------------------------------------------------------------------------------- /images/track_point_cap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raspberrypilearning/3d-printed-astro-pi-flight-case/4afc68613078fbd1a52a10bbaeb15130f1b9e92f/images/track_point_cap.png -------------------------------------------------------------------------------- /learn.md: -------------------------------------------------------------------------------- 1 | By following this resource you will learn: 2 | 3 | - How to 3D print the Astro Pi flight case 4 | - How to correctly install the Astro Pi hardware inside it 5 | - What fixtures and fittings you need to accomplish this 6 | 7 | This resource covers elements from the following strands of the [Raspberry Pi Digital Making Curriculum](https://www.raspberrypi.org/curriculum/): 8 | 9 | - [Combine inputs and/or outputs to create projects or solve a problem](https://www.raspberrypi.org/curriculum/physical-computing/builder) 10 | - [Use manufacturing techniques and tools to create a completed product](https://www.raspberrypi.org/curriculum/manufacture/developer) 11 | -------------------------------------------------------------------------------- /meta.yml: -------------------------------------------------------------------------------- 1 | title: 3D Printed Astro Pi Flight Case 2 | category: make 3 | -------------------------------------------------------------------------------- /overview.md: -------------------------------------------------------------------------------- 1 | The Astro Pi flight case is one of the most desirable cases in the history of the Raspberry Pi. With this resource you will learn how to 3D print your own case and install the Astro Pi hardware inside it. You'll then have your very own Astro Pi flight unit, identical in almost every way to the ones on the International Space Station right now. 2 | 3 | If you're participating in an Astro Pi competition, this is a great way to prototype and efficiently test your code in the same way as it would be used by the crew of the ISS. 4 | -------------------------------------------------------------------------------- /software.yml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test_code/pygame_test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | from sense_hat import SenseHat 3 | import os 4 | import time 5 | import pygame # See http://www.pygame.org/docs 6 | from pygame.locals import * 7 | 8 | 9 | print("Press Escape to quit") 10 | time.sleep(1) 11 | 12 | pygame.init() 13 | pygame.display.set_mode((640, 480)) 14 | 15 | sense = SenseHat() 16 | sense.clear() # Blank the LED matrix 17 | sense.set_rotation(270) # Flight orientation 18 | 19 | # 0, 0 = Top left 20 | # 7, 7 = Bottom right 21 | UP_PIXELS = [[3, 0], [4, 0]] 22 | DOWN_PIXELS = [[3, 7], [4, 7]] 23 | LEFT_PIXELS = [[0, 3], [0, 4]] 24 | RIGHT_PIXELS = [[7, 3], [7, 4]] 25 | CENTRE_PIXELS = [[3, 3], [4, 3], [3, 4], [4, 4]] 26 | 27 | 28 | def set_pixels(pixels, col): 29 | for p in pixels: 30 | sense.set_pixel(p[0], p[1], col[0], col[1], col[2]) 31 | 32 | 33 | # Joystick is turned 90 degrees clockwise for flight orientation 34 | def handle_event(event, colour): 35 | if event.key == pygame.K_DOWN: 36 | set_pixels(LEFT_PIXELS, colour) 37 | elif event.key == pygame.K_UP: 38 | set_pixels(RIGHT_PIXELS, colour) 39 | elif event.key == pygame.K_LEFT: 40 | set_pixels(UP_PIXELS, colour) 41 | elif event.key == pygame.K_RIGHT: 42 | set_pixels(DOWN_PIXELS, colour) 43 | elif event.key == pygame.K_RETURN: 44 | set_pixels(CENTRE_PIXELS, colour) 45 | elif event.key == pygame.K_u: 46 | sense.show_letter("u", colour) 47 | elif event.key == pygame.K_d: 48 | sense.show_letter("d", colour) 49 | elif event.key == pygame.K_l: 50 | sense.show_letter("l", colour) 51 | elif event.key == pygame.K_r: 52 | sense.show_letter("r", colour) 53 | elif event.key == pygame.K_a: 54 | sense.show_letter("a", colour) 55 | elif event.key == pygame.K_b: 56 | sense.show_letter("b", colour) 57 | 58 | 59 | running = True 60 | 61 | BLACK = [0, 0, 0] 62 | WHITE = [255, 255, 255] 63 | 64 | while running: 65 | for event in pygame.event.get(): 66 | if event.type == pygame.QUIT: 67 | running = False 68 | if event.type == KEYDOWN: 69 | if event.key == K_ESCAPE: 70 | running = False 71 | handle_event(event, WHITE) 72 | if event.type == KEYUP: 73 | handle_event(event, BLACK) 74 | -------------------------------------------------------------------------------- /worksheet.md: -------------------------------------------------------------------------------- 1 | # 3D printed Astro Pi flight case 2 | 3 | ![](images/header.png) 4 | 5 | The Astro Pi flight case is one of the most desirable cases in the history of the Raspberry Pi. With this resource you will learn how to 3D print your own case and install the Astro Pi hardware inside it. You'll then have your very own Astro Pi flight unit, identical in almost every way to the ones on the International Space Station right now. 6 | 7 | If you're participating in an Astro Pi competition, this is a great way to prototype and efficiently test your code in the same way as it would be used by the crew of the ISS. 8 | 9 | ## Checklist 10 | 11 | ![](images/fittings.png) 12 | 13 | If you're planning to build a full Astro Pi flight unit, check that you have all the parts required before you start: 14 | 15 | Part|Quantity|Info|Purpose 16 | ---|---|---|--- 17 | Raspberry Pi|1|B+, 2B or 3B|Main computer 18 | Camera module|1|Normal or Pi NoIR|Main camera 19 | Sense HAT|1| |Main sensors 20 | 2x20 pin PCB header (GPIO connector)|1|15 mm long pins, 2.54 mm pitch spacing|Goes onto the GPIO pins to hold the Sense HAT at the correct height 21 | M2 cross head screw|4|4 mm|Fixes camera module into base 22 | M2.5 male-to-female stand off|4|11 mm|Holds the Sense HAT at the correct height † 23 | M2.5 male-to-female stand off|4|8 mm|Holds the Sense HAT at the correct height † 24 | M2.5 nut or washer|4|1.6 mm depth|Holds the Sense HAT at the correct height † 25 | M2.5 cross head screw|4|6 mm|Fixes the top of the Sense HAT to the stand offs below 26 | M4 bolt|4|30 mm|Used in the corner bolt enclosures to hold the case together 27 | M4 hex nut|4| |Used in the corner bolt enclosures to hold the case together 28 | Tactile push buttons|6| |Function buttons 29 | Jumper wire|7+|Any type|To cut up for push button wiring 30 | Laptop trackpoint cap|1|Flight units use Lenovo part 73P2698|Goes on the Sense HAT joystick 31 | 32 | † = You could achieve this height in other ways if you wish, for example with 20.6 mm stand offs. Perhaps you could even 3D print your own! 33 | 34 | ![](images/apem.jpg) 35 | 36 | If you want to buy the exact buttons used in the Astro Pi flight unit, the details are below. At about £9 each they're expensive, because they're designed to survive an enormous number of clicks before wearing out - necessary for a 7-year space mission. So you might want to consider looking for a cheaper one elsewhere. 37 | 38 | - Manufacturer: APEM 39 | - Manufacturer Part No: 104350003 40 | 41 | You're also going to need the following tools: 42 | 43 | - Small cross head screwdriver 44 | - Small pair of pliers 45 | - Craft knife or scalpel 46 | - Sand paper 47 | - Kapton tape (or similar) 48 | - Wire strippers 49 | - Soldering iron 50 | - Solder 51 | - Epoxy adhesive 52 | - Glue gun 53 | - Hot melt adhesive for glue gun 54 | - Drill and drill bits (if not using the APEM buttons) 55 | 56 | ## Get access to a 3D printer 57 | 58 | First and foremost, you'll need access to a 3D printer to do this. Many schools now have their own, but if your school doesn't then you may be able to find one at your local [hackspace](http://www.hackspace.org.uk/wiki/Main_Page). You can also find local 3D printing services through the [3D Hubs](https://www.3dhubs.com/) website. 59 | 60 | ## Get the 3D files 61 | 62 | The 3D files are in [STL](https://en.wikipedia.org/wiki/STL_%28file_format%29) format, which is widely used in 3D printing all over the world. The software for your 3D printer will have no problem loading them. Import using metric millimetres (mm) and no scale adjustments will be required. 63 | 64 | - [Part 1](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_1%20V1.STL) (heat sink) 65 | - Part 2 (base) for Pi models [B+ and 2B](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_2%20V1.STL) or [3B](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi3_Enclosure_3D_PRINT_SECTION_2%20V2.STL) 66 | - Part 3 (middle) for Pi models [B+ and 2B](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_3%20V1.STL) or [3B](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi3_Enclosure_3D_PRINT_SECTION_3%20V2.STL) 67 | - Part 4 (lid) with [10 mm holes](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_4%20V1.STL) for the APEM buttons or [3 mm pilot holes](https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/STL/Astro_Pi_Enclosure_3D_PRINT_SECTION_4_PILOT%20V2.STL) for drilling to fit any button size. 68 | 69 | The 3D files don't exactly match those used to make the aluminium flight cases on the Space Station. They have been modified to make them compatible with 3D printers, so that most people who attempt this will achieve success without difficulty. 70 | 71 | Most notably, the case has been sliced into four parts. This has been done to minimise the amount of rafting and scaffolding that needs to be printed along with the model, and also reduces the time you spend cleaning up the final prints. 72 | 73 | ## Safety first 74 | 75 | **It is important that you observe the correct safety procedures specified in the safety data sheet for your specific 3D printer.** 76 | 77 | Potential hazards include: 78 | 79 | - Hot surfaces and thermoplastics (print head block and lamp) 80 | - Ultraviolet radiation (lamp) 81 | - High voltage (lamp connector, electric outlet) 82 | - Moving parts (printing assembly) 83 | 84 | ## Print each part 85 | 86 | The 3D printer we used for the blue parts shown below was an [Up Plus 2](https://www.3dhubs.com/3d-printers/up-plus-2), called the Afinia H480 in the US, using ABS filament. Because there are so many different types of 3D printer, we cannot possibly provide instructions for them all, so we can only provide rough guidance here and you'll need to figure out the rest on your own. 87 | 88 | Here are some top tips though: 89 | 90 | - Spend some time making sure your printer is properly calibrated and tested 91 | - [PLA](https://en.wikipedia.org/wiki/Polylactic_acid) is more reliable and nicer to print with than [ABS](https://en.wikipedia.org/wiki/Acrylonitrile_butadiene_styrene) 92 | - A [Zebra](http://www.printinz.com/zebra-plates/) or [Buildtak](http://www.buildtak.eu/) plate provides a great surface to print on without any extra adhesive being required 93 | - If your printer has a Z probe sensor, this will help compensate for the bed not being perfectly level; ensure it's working correctly if you have one 94 | 95 | To get a nice finish we recommend you print on a high detail setting; this is usually a number specified in [microns](https://en.wikipedia.org/wiki/Micrometre) in the 3D printer software. The lower this number is, the more precise the model will be. Please also be aware that precise prints take longer and, for these models, each piece can take up to **four** hours to complete. Make sure you have enough filament. 96 | 97 | The STL files should have the models like this by default, but please make sure you print in the orientations shown below in order to minimise scaffolding and rafting. 98 | 99 | ### Heat sink 100 | 101 | ![](images/raw_print_heatsink.png) 102 | 103 | ### Base 104 | 105 | ![](images/raw_print_base.png) 106 | 107 | ### Middle 108 | 109 | ![](images/raw_print_middle.png) 110 | 111 | ### Lid 112 | 113 | ![](images/raw_print_lid.png) 114 | 115 | ## Remove the scaffolding 116 | 117 | In order to keep the model structurally sound while printing, your 3D printer will create what's called scaffolding and rafting to prevent the hot thermoplastics from bending or sagging. Leave the print to cool right down to room temperature before you touch it. 118 | 119 | ### Heat sink 120 | 121 | You should be able to remove the scaffolding on the heat sink using just your hands; this part may bend slightly, so don't be too rough while doing this. 122 | 123 | ![](images/scaff_heatsink.png) 124 | 125 | You may choose to not print this part because it's not essential to the rest of the case, and because it's made of plastic it *will not* work as a heat sink. We've included it anyway so that you can achieve the iconic look and feel of the Astro Pi flight case. 126 | 127 | ### Base 128 | 129 | The base scaffolding should come away easily as with the heat sink, but you'll also need to remove some material that was used to support the corner bolt enclosures and around the aperture for the micro SD card. A small pair of pliers is ideal for this. 130 | 131 | ![](images/scaff_base.png) 132 | 133 | ### Middle 134 | 135 | Again, the scaffolding should come away easily and there will be some material around the corner bolt enclosures that you'll need to remove. 136 | 137 | ![](images/scaff_middle.png) 138 | 139 | ### Lid 140 | 141 | The bottom layer of scaffolding on the lid should also come away easily. 142 | 143 | ![](images/scaff_lid1.png) 144 | 145 | However, there are a few sunken holes on the underside that must also be cleared of material. These are present to prevent the lid from striking the Raspberry Pi hardware when installed into the case. You'll need a scalpel or craft knife to dig into it. 146 | 147 | ![](images/scaff_lid2.png) 148 | 149 | Once you've managed to lift some of it, use a pair of small pliers to remove the rest of the material. The areas marked with a red star below need the same treatment. 150 | 151 | ![](images/scaff_lid3.png) 152 | 153 | When you're done it should look like this: 154 | 155 | ![](images/scaff_lid4.png) 156 | 157 | ## Do a fit check 158 | 159 | Before proceeding, put all the pieces together to check that they fit correctly. The lipped edge between the base and middle pieces is of most concern to you here. The heat sink and lid just need to line up. 160 | 161 | ![](images/fit_check.png) 162 | 163 | Don't worry about any imperfections or residue from the scaffolding at this stage; you can tidy this up later with sandpaper. 164 | 165 | ## Epoxy adhesive 166 | 167 | Use some high-performance epoxy adhesive to glue the heat sink to the base, and then the lid to the middle. You may wish to leave this step until after you've installed the hardware in the base. It may help mitigate any alignment issues later on. 168 | 169 | ![](images/epoxy_adhesive.png) 170 | 171 | ## Continue to install the hardware 172 | 173 | - [Worksheet 2](worksheet2.md) 174 | -------------------------------------------------------------------------------- /worksheet2.md: -------------------------------------------------------------------------------- 1 | # 3D printed Astro Pi flight case 2 | 3 | - [Back to Worksheet 1](worksheet.md) 4 | 5 | When you're happy with the 3D printed parts you can proceed with installing the hardware. 6 | 7 | ## Fold the camera ribbon 8 | 9 | Getting the camera into the case can be a little tricky but here is how we did it for the flight units. Firstly, disconnect the ribbon cable from the camera; the two tabs lift up on either side to release the cable in the same way as they do on the Raspberry Pi itself. Then fold the ribbon similar to how it's shown below. These folds allow the camera cable to come up the side of the Raspberry Pi with enough flex to insert into the CSI camera port (see further down). 10 | 11 | ![](images/ribbon1.png) 12 | 13 | You don't need to get this perfect for it to work, but try to get it as close as possible. The kapton tape is also optional; any kind of tape will work fine if you want to prevent the ribbon from unfurling. 14 | 15 | ![](images/ribbon2.png) 16 | 17 | ## Install the camera 18 | 19 | Reconnect the `Cam` end of the ribbon cable to the camera module. Make sure that the tin connectors are facing the front and the blue tab is on the back. 20 | 21 | Before proceeding, line up the camera module with the support pillar pilot holes and have a look through the aperture in the base to check the alignment of the lens. The lens block of the camera module is actually glued in position at the factory, and therefore its alignment can vary slightly from camera to camera. If you find you've got an alignment issue, you should be able to manipulate the lens block between finger and thumb before you install it into the case permanently. 22 | 23 | When you're happy, the camera module should be installed into the case as shown below. With light finger pressure, the M2 cross head screws will cut their own thread in the support pillar pilot holes. After just a few turns you'll probably need a small screwdriver to continue. 24 | 25 | ![](images/install_camera.png) 26 | 27 | Stop turning as soon as the head of the screw touches the camera module; if you tighten the screw too much it can cause the support pillar to split horizontally along the grain of the print. Furthermore, try to avoid removing and re-threading the screws as this will cut a brand new thread and, if done repeatedly, will erode the inside of the support pillar so that the screws will not hold. 28 | 29 | ## Install the Raspberry Pi 30 | 31 | Firstly, ensure there's no residual scaffolding material around the SD card slot or LED holes that might prevent the Raspberry Pi from lining up with the mounting pillars. Once you're happy, line up the Raspberry Pi and do a fit check. Verify that it doesn't touch the camera module below it. Don't insert the camera ribbon cable just yet, as this will make the next job awkward. 32 | 33 | ![](images/install_pi1.png) 34 | 35 | Next take the M2.5 - 11 mm stand offs; with some light finger pressure they will cut their own thread in the support pillar pilot holes. After a few turns you'll need to use a small pair of pliers to continue turning them. It's possible to get these to go in at a slight angle, which can lead to alignment issues with the Sense HAT later on, so do your best to make sure these go into the support pillars as straight as possible. Be careful while you do this and, again, stop turning as soon as the stand off touches the Raspberry Pi to avoid spliting the pillars horizontally along the grain of the print. 36 | 37 | ![](images/install_pi2.png) 38 | 39 | Now you can insert the camera ribbon cable into the CSI port of the Raspberry Pi. Try to make sure the tin connectors are all level to ensure a good connection. 40 | 41 | ![](images/install_pi3.png) 42 | 43 | ## Install the Sense HAT 44 | 45 | This is where we're going to deviate from what's inside the Astro Pi flight unit. The flight units have another circuit board in between the Raspberry Pi and Sense HAT which holds a real-time clock, oscillator crystal, and backup battery. This RTC board also has some pins that the six push buttons connect to. Unfortunately, this is not available to the public. 46 | 47 | Our goal was to keep the 3D printed flight case as *faithful* to the original as possible, so the decision was taken to *not* alter it to accommodate the absence of this board. It may be possible for us to release the Gerber files for it in the future so that people can make their own. 48 | 49 | So we're going to use a hex nut or washer of the same depth as the RTC board to compensate for its absence. The RTC board is 1.6 mm thick, so we need a nut or washer of the same thickness. There are many ways you could achieve this, for example with two washers of 0.8 mm thickness. Perhaps you could 3D print one. 50 | 51 | Take an 8 mm M2.5 stand off and put the hex nut or washer onto its thread before screwing it into the hole of the 11 mm stand off, as shown below. Do the same for the remaining three stand offs. 52 | 53 | ![](images/install_sense1.png) 54 | 55 | WARNING|  56 | ---|--- 57 | ![](images/pi3_wifi.jpg)|Attention Pi 3 users. Using a **metal** stand off next to the wireless antenna will degrade its performance and range. The advice is to either omit this stand off from your build or use a nylon stand off and nylon screw instead. 58 | 59 | Remove the GPIO connector that comes with the Sense HAT; wiggle it from side to side and it will come off without too much force. The Sense HAT can then be inserted onto the GPIO connector with the *long* pins (see checklist above). Note that these pins should not protrude through the top of the Sense HAT. If they do, then the height is not correct. 60 | 61 | ![](images/install_sense2.png) 62 | 63 | Finally, use the M2.5 cross head screws to secure the Sense HAT to the stand offs below. 64 | 65 | ![](images/install_sense3.png) 66 | 67 | ## Install the push buttons 68 | 69 | If you are using the lid with the pilot holes then you'll need to check the datasheet of your chosen button type to find the *threaded bushing diameter*. Once you know this you can select a drill bit with this diameter, plus 1 mm for clearance, and proceed to drill all six holes. We recommend using a vice or G clamp to hold the lid in place while you drill. You can then install the buttons as per their requirements. 70 | 71 | The guidance below assumes you're using the APEM buttons that we used in the flight unit. These have a thread which goes through the lid from below, along with a friction washer to stop it rotating, a nut to adjust the thread depth (red star below), and then a collar to secure the button from the top. The red line below indicates where the lid should be. 72 | 73 | ![](images/buttons1.png) 74 | 75 | Insert the thread along with the nut and friction washer from the underside of the lid, and then adjust the nut to the approximate position shown below. This will minimise the thread showing on top. 76 | 77 | ![](images/buttons2.png) 78 | 79 | Place the collar over the threading and tighten securely. If too much thread is showing, adjust the nut on the underside again. 80 | 81 | ![](images/buttons3.png) 82 | 83 | When you're done, it should look like this. Do the same for the remaining buttons. 84 | 85 | ![](images/buttons4.png) 86 | 87 | ## Wire up the buttons 88 | 89 | Without the RTC board in the middle, you won't have a convenient way to wire the buttons to the GPIO pins of the Raspberry Pi. Because there are so many ways this can be solved, you should decide how you will do this yourself. 90 | 91 | ![](images/jumper_wiring.png) 92 | 93 | To match the flight unit, you should wire the buttons to the last eight GPIO pins at the bottom of the header. **These pins don't need to be connected to the Sense HAT, so it's fine if you want to cut or bend them on the 2x20 pin PCB header (GPIO connector) as part of your solution.** You can also chop off the last 4 rows of the PCB header and put the jumper cables directly onto the Raspberry Pi pins (as shown above). Turn the rough edge to where the red star is, and this will leave the good edge for the jumper wires to fit against. 94 | 95 | ![](images/buttons_GPIO.png) 96 | 97 | Note the orientation of the pin diagram is with the Ethernet and USB ports facing downwards, and the row of pins on the right-hand side of the Pi. They need to be wired in a **pull up** configuration in order to match the flight unit. Fortunately, the Raspberry Pi has all that circuitry built-in, so you can get away with just using a single wire between the button and GPIO pin. 98 | 99 | There is also a Device Tree overlay that causes these buttons to type `u`, `d`, `l`, `r`, `a` and `b` when you press them. This allows you to easily write code that uses button and joystick events at the same time. 100 | 101 | Here are the GPIO pin assignments: 102 | 103 | - Top quad 104 | - UP: GPIO 26, pin 37 105 | - DOWN: GPIO 13, pin 33 106 | - LEFT: GPIO 20, pin 38 107 | - RIGHT: GPIO 19, pin 35 108 | - Bottom pair 109 | - A (left): GPIO 16, pin 36 110 | - B (right): GPIO: 21, pin 40 111 | 112 | The APEM buttons have three poles numbered 1 to 3 (note that pole 3 is in the middle): 113 | 114 | ![](images/apem_wiring.jpg) 115 | 116 | 1. GPIO pin 117 | 1. Do not connect 118 | 1. GND 119 | 120 | We recommend that you strip back some jumper wire and solder directly onto the button contacts; however, you could also use crimped wire terminals that friction fit onto the contacts (we felt these were not reliable enough for flight). 121 | 122 | The picture below is of one of the flight units that went into space. On the right, you can see the base of the RTC board with the connector pins for the buttons. If you look at the button contacts on the left, you'll see we used only one black ground wire that went from button to button - it's fine to do this. 123 | 124 | ![](images/flight_unit_wiring.jpg) 125 | 126 | ## Test the buttons 127 | 128 | Once you have all the buttons wired up, start up your Astro Pi with a monitor, keyboard and mouse connected. We need to download some files and change a few configuration settings. Firstly, download the Device Tree overlay that maps the push buttons to the corresponding keyboard keys. Open a terminal and enter these commands: 129 | 130 | ```bash 131 | cd /boot/overlays 132 | sudo wget https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/dtb/astropi-keys.dtbo --no-check-certificate 133 | ls 134 | ``` 135 | 136 | Check that the file `astropi-keys.dtbo` is now showing in the list of files. 137 | 138 | Next, we need to configure `config.txt` to load this overlay: 139 | 140 | ```bash 141 | sudo nano /boot/config.txt 142 | ``` 143 | 144 | Go to the bottom of the file and enter the line below: 145 | 146 | ```bash 147 | dtoverlay=astropi-keys 148 | ``` 149 | 150 | Press `Ctrl - O` then `Enter` to save, followed by `Ctrl - X` to quit. 151 | 152 | Now reboot the Astro Pi. 153 | 154 | ```bash 155 | sudo reboot 156 | ``` 157 | 158 | Now let's download and run a Python test program to check everything is working. The test code uses [Pygame](http://pygame.org/wiki/tutorials), so please do this on the Astro Pi's own screen and not via remote access. Open a terminal and enter these commands: 159 | 160 | ```bash 161 | cd ~ 162 | wget https://github.com/raspberrypilearning/3d-printed-astro-pi-flight-case/raw/master/test_code/pygame_test.py --no-check-certificate 163 | chmod +x pygame_test.py 164 | ./pygame_test.py 165 | ``` 166 | 167 | Waggle the joystick and press all the push buttons. If everything is working, the joystick should give a direction indication and the buttons will show the corresponding letter on the LED matrix. Press `Escape` to exit. 168 | 169 | ## Assemble the case 170 | 171 | Once you're happy that the internals of the case are complete, you can proceed to the final assembly stage. If you haven't done so already, now is the time to use the epoxy adhesive to join the heat sink to the base and the lid to the middle. 172 | 173 | When joining the lid to the middle, you have an opportunity to locate the lid so as to mitigate any alignment issues with the LED matrix and joystick that may have occurred from the stand offs not being quite straight. After the case is assembled, insert an M4 bolt into each corner bolt enclosure and tighten up the hex nuts on the other side. 174 | 175 | ![](images/install_fit_check.png) 176 | 177 | Your Astro Pi is almost complete; the last thing to do is install the joystick hat. The flight units use a track point cap from a Lenovo ThinkPad laptop (part no 73P2698). There are plenty of cheaper alternatives available online that will work just as well. 178 | 179 | To mount the track point cap onto the Sense HAT joystick, you should chop up an empty ink tube from a BIC biro - yes, this is what's used in the Space Station unit. Cut off a short length of the tube and, with some gentle force, the tube will fit over the stump of the joystick. It will also pop off again if too much force is used, which protects the cheap joystick component inside. 180 | 181 | Fill the cavity on the base of the track point cap with some hot melt adhesive from a glue gun, and then insert the BIC tube into the soft adhesive. Allow this to cool, and then your joystick is ready for use. 182 | 183 | ![](images/track_point_cap.png) 184 | 185 | ## What next? 186 | 187 | We've deliberately not shown a really polished gorgeous case, because we're hoping you'll go the extra mile and blow our socks off. Please show us your cases by tweeting pictures of them to `@astro_pi` and `@raspberry_pi`! 188 | 189 | Here are some further ideas: 190 | 191 | - Use metallic grey spray paint 192 | - Use sandpaper to create the matt finish that the bead-blasted aluminium flight cases have 193 | - Engrave decals into the case 194 | - Use different colours of filament for each part 195 | 196 | The STL files are released under the Creative Commons attribution [licence](http://creativecommons.org/licenses/by-sa/4.0/) so you are welcome to modify them. Please note that GitHub has a great [STL viewer](https://github.com/blog/1465-stl-file-viewing) and also has a [3D file diff](https://github.com/blog/1633-3d-file-diffs), which could be useful for tracking your changes. 197 | 198 | But by far the greatest benefit of owning an Astro Pi flight unit is the ability to prototype and test code that could be run on the International Space Station. Head over to the [Astro Pi website](https://astro-pi.org/) now to get involved! 199 | --------------------------------------------------------------------------------