Greg's Builds
Published

Mechanical Coin Display

An interactive wall display that illuminates and rotates two coins.

IntermediateShowcase (no instructions)47
Mechanical Coin Display

Things used in this project

Hardware components

Log Offcut (Cookie)
×1
Coins
×2
Lego Technic Gears / Axels
×1
Arduino Nano R3
Arduino Nano R3
×1
Rotary Encoder
×1
MOSFET N-Channel
×1
SparkFun Solder-able Breadboard - Mini
SparkFun Solder-able Breadboard - Mini
×1
Battery Holder, AA x 2
Battery Holder, AA x 2
×1
3V LED strips white
×1
Small Screws / Washers
×1
Epoxy
×1
Metallic Epoxy Pigment
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
3D Printer (generic)
3D Printer (generic)
Router + flush cut bit
Drill Press
Hole Saw or Forstner Bit
Sandpaper

Story

Read more

Custom parts and enclosures

Coin Holder

This may need to be modified after printing using a heat gun and pliers to fit the coin properly.

Sketchfab still processing.

Gear Holder

Sketchfab still processing.

Lego Axel Spacer

Sketchfab still processing.

Lego Axel Encoder Coupler

Print this diagonally

Sketchfab still processing.

Secondary Gear Holder

Sketchfab still processing.

Schematics

Schematic

Code

Arduino Code

Arduino
Requires lowpower and Sodaq_pcint libraries
#include <Sodaq_PcInt.h>
#include <LowPower.h>

//Pin numbers
#define ENCODER_INPUT 8
#define LED_OUT 5

#define SLEEP_TIMEOUT 500

#define LED_INCREMENT 3

volatile int count;
int led_val = 0;

void setup() {

  pinMode(ENCODER_INPUT, INPUT_PULLUP);
  PcInt::attachInterrupt(ENCODER_INPUT, interrupt);
  count = 0;

}

void loop() {

  //Fade in LED and hold it on until timeout occurs
  while(count <= SLEEP_TIMEOUT)
  {
    led_val = led_val + LED_INCREMENT;
    if(led_val > 255) led_val = 255;

    analogWrite(LED_OUT, led_val);
     
    count = count + 1;
    delay(30);

  }

  //Timeout has occured, fade out LED
  for(; led_val > 0; led_val-= LED_INCREMENT)
  {
    if(led_val < 0) led_val = 0;
    analogWrite(LED_OUT, led_val);
    delay(30);
  }
  count = 0;

  //Powerdown until interrupt
  LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);

}

//MCU is woken up by the interrupt and main loop resumes.
//This ISR resets the count for the timeout in the main loop.
void interrupt()
{

  count = 0;
}

Credits

Greg's Builds
8 projects • 12 followers
Why bother buying things when you can spend an exorbitant amount of time and money crafting them yourself?
Contact

Comments

Please log in or sign up to comment.