Skip to the content
4 layers20.3 × 85.1 mmStm32f091, the printed circuit board in 3D

battleship

Size
20.3 × 85.1 mm
Copper layers
4
Thickness
1.6 mm
Parts
46
Nets
78
Pads
236
Tracks, vias
1,190, 95
Pours
5
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
17 Oct 2024
Updated
2 Jan 2025

Overview

Stm32f091 is an open-source printed circuit board by Realvideogame, from the Realvideogame/STM32-Battleship repository on GitHub, published under the MIT licence. It is a 4-layer board of 20.3 × 85.1 mm with 46 parts on 78 nets, routed with 1,190 tracks and 95 vias.

It is built around the BAT60JFILM. Its parts include 14 capacitors, 11 resistors, 5 connectors, 3 switches and 2 ICs. It belongs with the STM32 boards of this library.

Main components

1

README

README.md

Battleship Game Implementation with STM32F091 Microcontrollers

This project was developed as part of ECE 36200 - Microcontroller Systems and Interfacing at Purdue University. The implementation includes elements of both hardware and software design, leveraging the STM32F091 microcontroller to recreate the classic game of Battleship.

Acknowledgments

  • Niraj Menon: Lab coordinator for ECE 36200, contributed to the LCD implementation code and designed the development board used in this project. Some functions relating to input are taken from labwork for ECE 36200 as well.

Overview

The game is implemented using two STM32F091 microcontrollers. Each player uses a TFT LCD to display game states. The game includes three distinct phases:

  1. Placement Phase: Players position their ships on a 9x9 grid. Ship rotation is implemented.
    • Ship sizes are 5,4,3,2,2.
    • Both players can place their ships at the same time.
    • This phase ends when both players have placed all ships.
  2. Gameplay Phase: Players take turns attacking the opponent's grid.
    • If attacking, the player sees their previous attacks. The other player sees their own grid, with enemy attacks overlaid.
    • Turn time is indicated by an RGB LED controlled through PWM:
      • The green LED decreases in brightness as time runs out.
      • When nearly out of time, the LED flashes red.
    • The game will end when a player's ships are all sunk. If the first player to go wins, the second player is allowed a redemption turn, which can result in a tie.
  3. Post-Game Phase: Displays game statistics for players to review.
    • Number of Turns
    • Player accuracy
    • Greatest Hit/Miss Streaks

Features

  • Keypad User Input:
    Players can use the keys on a 4x4 keypad to control their cursor, fire, or rotate ships during their turn.
  • TFT LCD Integration:
    Each player's grid is displayed on a dedicated LCD screen. Communication with the LCD is handled via SPI.
  • Interboard Communication:
    SPI is also used for communication between the two microcontrollers to synchronize game states.
  • Turn Timer with RGB LED:
    A visual timer implemented with PWM, dynamically indicating remaining time with color changes.

Hardware

  • Microcontroller: STM32F091RC
  • TFT LCD Screens: Used to display the game grids.
  • RGB LED: Provides real-time feedback for turn duration.
  • 4x4 Keypad: Allows for user input
  • Power Supply: Game be powered by a generic 5V wall plug.

How to Play

  1. Each player places their ships in any valid configuration.
  2. Take turns attacking the opponent's grid while managing your time with the RGB LED timer.
  3. At the end of the game, review the displayed statistics and see who won.

Future Plans

  • Finish PCB implementation so the project can exist as a standalone board.

Developed with a focus on embedded systems programming and hardware/software integration.

Parts

46
QtyValueFootprintReferences
8.1uFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC3, C4, C5, C6, C7, C8, C9, C11
41kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR2, R4, R5, R8
3SW_PushButton_Switch_SMD:SW_SPST_PTS645SW1, SW2, SW3
2100KResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR3, R10
212pFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC12, C13
220pFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC14, C15
222uFCapacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolderC1, C2
2BAT60JFILMDiode_SMD:D_SOD-323D1, D2
2Conn_01x30_Malelocal_models:HTSW-130-22-T-SJ1, J2
2Conn_02x03_Odd_EvenConnector_PinHeader_1.27mm:PinHeader_2x03_P1.27mm_VerticalJ4, J5
2LED_GreenLED_SMD:LED_0805_2012MetricLD2, LD4
2LED_RedLED_SMD:LED_0805_2012MetricLD1, LD6
12kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR7
132.768kHz(12.5pF)local_models:ECX-.327-CDX-1293X1
1390Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR11
13kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR6
15.1kResistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR1
1510Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolderR9
18MHz(20pF)Crystal:Crystal_SMD_3225-4Pin_3.2x2.5mmX2
1Conn_02x05_Odd_EvenConnector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ3
1Ferrite BeadInductor_SMD:L_0805_2012Metric_Pad1.15x1.40mm_HandSolderFB1
1LD1117S33TR_SOT223Package_TO_SOT_SMD:SOT-223-3_TabPin2U1
1LED_BlueLED_SMD:LED_0805_2012MetricLD3
1LED_YellowLED_SMD:LED_0805_2012MetricLD5
1STM32F091RCTxPackage_QFP:LQFP-64_10x10mm_P0.5mmU2

Similar boards

  • 2 layersNavigatorschema, the printed circuit board in 3D

    Navigatorschema

    maddevsio/mad-navigator

    Mad navigator is simple compass-like device shows direction to predefined geo point. This repository contains firmware source code and schematics for device.

    107 parts14
  • 6 layers29 × 33 mmMINIREX G4, the printed circuit board in 3D

    MINIREX G4

    mathieupommery/MINIREX_G473

    The following table demonstrates the estimated component costs based on Mouser volume pricing. The unit price of each component dynamically adapts to the total quantity required for the entire production batch (1, 100…

    109 parts10
  • 2 layers43.4 × 98 mmSolax Pylontech, the printed circuit board in 3D

    Solax Pylontech

    70p4z/tparse

    A minimalistic C library to parse text in microcontroller without memory allocation.

    51 parts6
  • 2 layers100 × 100 mmReflow, the printed circuit board in 3D

    Reflow

    windsorschmidt/reflow

    Hardware and firmware sources for a 2-channel reflow (toaster) oven controller. KiCad schematic & PCB.

    95 parts4MIT
  • 6 layers100 × 100 mmAi vision, the printed circuit board in 3D

    Ai vision

    embeddedci-com/pcb-trace-length-analyzer

    Two of them, and the difference between them is the point.

    370 parts3Apache-2.0
  • 4 layers100 × 67 mm2Phase SynchBuck, the printed circuit board in 3D

    2Phase SynchBuck

    Natchpai/LQRx-InterleavedBuck

    Digitally Controlled 2-phase Interleaved Buck Converter

    306 parts3CERN-OHL-S-2.0
  • 2 layers146.1 × 101.6 mmCc pcbRedo, the printed circuit board in 3D

    Cc pcbRedo

    lagunter145/CribCaptain

    96 parts2

Questions

How big is the Stm32f091 PCB?

It measures 20.3 × 85.1 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Stm32f091 use?

46 parts, built around the BAT60JFILM. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Stm32f091 KiCad files?

From the Realvideogame/STM32-Battleship repository on GitHub, at the commit this page was made from: the board is pcb/stm32f091-ref/stm32f091.kicad_pcb and its schematic pcb/battleship_pcb/battleship_pcb.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Stm32f091 design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).