Physics Gadget v3 Code
2025-06-22 20:19:23 -05:00
pcb Add PCB design files 2025-06-18 18:50:20 -05:00
.clangd Revert .clangd 2025-06-18 11:07:20 -05:00
.gitignore Start 2025-06-17 14:31:03 -05:00
DEMO_LANDING.md Add link to precompiled firmware in demo landing page 2025-06-22 20:19:23 -05:00
i2c.h Code that works 2025-06-18 11:05:42 -05:00
main.c Cleanup code a little bit 2025-06-18 18:53:51 -05:00
Makefile Start 2025-06-17 14:31:03 -05:00
README.md Update part information 2025-06-18 19:36:14 -05:00
simulation.h Add support for multiple balls 2025-06-18 14:28:24 -05:00
TODO.md Add markdown files 2025-06-18 18:57:42 -05:00
USI_TWI_Master.c Start 2025-06-17 14:31:03 -05:00
USI_TWI_Master.h Start 2025-06-17 14:31:03 -05:00

Physics Gadget (v3)

This is the 3rd hardware revision of my "physics gadget". This circuit uses an ATtinyX5 microcontroller to simulate objects bouncing around in a void, affected by the user shaking the devicee

Parts Required

  • The circuit board (the schematic, design, and gerber files are available if you want to order it)
  • 1x ATTinyX5 (ATTiny45 or 85 recommended, code will need to be adjusted to work on 25 and 45)
  • 1x GY-521
  • 1x Adafruit 1079 or compatible (same controller) 8x8 LED matrix
  • 1x 100nF decoupling capcitor for ATTiny
  • 4x 10-100k resistors for reset and button pull-ups and pull-downs
  • 1x some power source with leads you can solder to the PCB (I used a switched AA battery case)
  • A programmer for the ATTiny
  • The firmware

If you use the ATTiny85, you can use the precompiled firmware

Building the firmware

Dependencies

make avr-gcc avr-libc avrdude

To build the firmware, first set the variables to the correct values in the Makefile for your use case.

DEVICE = attiny85

PROGRAMMER = usbtiny

FUSES = -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m

CLOCK = 8000000

Make sure to set the correct values for your microcontroller, it's clockspeed, and fuses. The defaults are fine, but if you have a different programmer you'll need to specify that..

You can also modify the various pre-processor directives in main.c to change the behavior and sensitivity of the device.

Next, run

make flash

To compile the firmware and program it using the programmer attached to your computer.