Refrigerator Magnet Clock

55K458117


Intro: Refrigerator Magnet Clock

I've always been fascinated by unusual clocks. This is one of my latest creations that uses refrigerator alphabet numbers to display the time.

The numbers are placed on a piece of thin white Plexiglas that has thin sheet metal laminated to the back. There are small magnets in each of the numbers that cause the number to cling to the sheet metal when they are not being moved.

The numbers are moved using CoreXY mechanism that moves a carriage behind a number, it then engages two magnets which attract the magnets on the number and allows the number to follow the carriage movement. Once at it's destination the carriage magnets are disengaged and the number will stay in place because of the thin sheet metal backing the Plexiglas.

STEP 1: Build the Frame

The frame consists of 3/4" plywood with 1/16" white acrylic mounted into a opening in the plywood.

The opening is 16"x20" with a 17"x21"x1/16" rabbet around the edge so the acrylic sheet fits flush with the surface of the plywood. I used a gel super glue to attach the acrylic to the plywood.

I used a CNC router to cut the plywood, but it could be done with a jigsaw and a router. Because the CNC router leaves rounded corners (1/8" in my case), I used a Laser Engraver to cut the acrylic to match.

STEP 2: 3D Print the Parts

I designed and 3D printed all of the parts needed to hold the motors and gears for the CoreXY mechanism. I use PETG material but PLA should work fine.

There are 11 parts total, 9 unique. The files can be found on Thingiverse.

  • Stepper motor mount x 2
  • Corner bracket x 2
  • Upper Carriage
  • Lower Carriage
  • Magnet Carriage
  • Magnet Holder
  • Screw
  • Gear
  • Microswitch Bracket

I 3D printed all of the numbers used in the clock. There are are 10 digits for the minutes and hours (0-9), 6 digits (0-5) for the tens of minutes, and 1 digit (1) for the tens of hours. These were printing using various PLA colors to add variety.

STEP 3: Assemble the CoreXY Mechanism

Details about how a CoreXY design works can be found at CoreXY.com

Building the magnet carrier
The magnet carrier is what is on the backside of the clock, it is positioned behind a given number and the magnets on the carrier are lowered to make a magnetic connection between the carrier and the number. The number can then be moved to a new position and the magnets on the carrier are raised to disengage and leave the number at it's new position.

Sidenote: I had originally planned to use electromagnets to engage and disengage with the number. For some reason I abandoned that idea early in the design process. I can't remember why. I plan to test electromagnets and may end up replacing this carriage in the future.

The magnets are raised and lowered using a screw and a servo. The screw has a very coarse thread so that a half turn of the screw will raise the magnets approximately 4mm which is enough to disengage the connection to the numbers.

Assembling the CoreXY components

  1. The first step is to attach the Beta stepper motor bracket (the bottom motor). I placed it so that the edge of the bracket was flush with the edge of the plywood.
  2. Add the idler gears to the lower and upper carriages and the corner brackets.
  3. Slide the lower carriage onto the guide rod and then attach the corner bracket.
  4. I 3D printed an alignment tool to make sure the lower guide rod was parallel to the edge of the plywood. I used it to determine where to screw the down the corner bracket.
  5. Add the vertical guide rods, the magnet carrier, and then repeat the above steps for the upper carriage and Alpha motor.
  6. To align the upper guide rods I took a piece of plywood and put a screw in one end. I then adjusted the screw so that it just touched the rod at the motor end. I then slide it to the other end and screwed in corner guide.
  7. Mount the stepper motors and drive gears
  8. Thread the timing belt and attach to the magnet carrier

STEP 4: Add the Home Switches

The CoreXY needs to calibrate itself after every power cycle to know where the coordinates 0,0 are located. It does this by moving towards the upper left (0,0) until it triggers two micro-switches that indicate the home position. The position where these switches is not critical, they just need to be placed close to the corner so that both the upper carriage and the magnetic carriage depress the switch during the homing cycle.

STEP 5: Electronics

The schematic shows the necessary connections between the M0-mini, the RTC, and the CNC Shield. The stepper motors plug into the CNC shield.

The CNC shield power that goes to the stepper motors comes from a 12v, 10A power supply. This 12V is also feed through a LM7805 voltage regulator that can be used to supply power to the M0-mini and RTC.

The X and Y Zero microswitches are wired directly to the M0-mini board.

STEP 6: Add Sheet Metal

I had difficulty sourcing a large sheet of 36 gauge steel so I used 10"x4" sheets that were available from multiple sources. To attach them to the acrylic I used 3M Polyester Double Sided Film Tape, 1/2" wide placed along seams. This resulted in a smooth steel surface.

STEP 7: Software

The software consists of multiple modules

  • RTC interface
  • Motor acceleration/deceleration done using timers and interrupts
  • CoreXY functionality used to move to a given set of coordinates
  • The Clock - this determined how to move the numbers from their home position to the clock position and back.

All source code can be found on Github

https://github.com/moose408/Refrigerator_Magnet_Clock

STEP 8: Preparing the Numbers

Each number has two 6x2mm magnets glued to the back. These were attached using gel super glue.
It is important that all of the magnets face in the same direction. I made sure the magnets had the north pole facing up. It doesn't matter which pole faces up it just has to be the opposite of the magnets on the CoreXY carrier so the numbers are attracted to the carrier.

STEP 9: Initializing the Clock

The initial placement of the numbers is done the first time the clock is run. The CoreXY carriage moves to an empty position near the middle of the face and engages it's magnets.

The user places a number opposite the carrier and tells the software what number and whether it is a minute, tens of minutes, hour, or tens of hour number. The software will then store the number in it's home position. This is repeated until all 27 numbers have been placed.

At that point the clock can be started and the software will move the appropriate numbers to display the time.

Note: this initialization has to be done one-time only. Once the numbers are in the position the software knows where they are even if there is a power cycle.

102 Comments

Aloha Again. I’m back working on my copy of your Refrigerator Magnetic Clock. I can get it to run for a bit, but to get it to run reliably, I need to tune the code on things like the servo angle, and stepper timing. As of now I’m only able to get it running as well as it does, is with your compiled sketch.

When I run your uncompiled sketch, Its missing bits of code and behaves erratically. With my poor coding ability, Ive been trying to patch the sketch with limited success.
(Thank you for your detailed comments in the code)

As an example, I’ve tried adding the “Set Time” menu and code. It’s missing from the uncompiled version. I’ve learn a lot about RTC’s. And can get simple sketch’s to work, but crash your sketch when I try folding it in.

Is there any chance you can upload a more complete revision of your sketch closer to the compiled one?

This would help greatly.
(missing “case ’t’” menu item in uncompiled sketch)

//========================================

// l o o p

//========================================

void loop() {

char chMenuSelection;

bool bEnable;


//This will display the menu and wait for user input

//then based upon the input will do the correct command


chMenuSelection = ShowMenu();

switch(chMenuSelection)

{

case 'i' :

StoreDigits();

break;

case 's' :

StartClock();

break;

case 'z' :

ZeroXandY();

break;

default :

SerialUSB.print("selected unknown\n");

break;

}


}

//=======================================

// R u n C l o c k



Thank you.
Here is a link to 2 versions of the code. I'm not entirely sure which one was the compiled version I previously sent you, hence the two versions.

Let me know if that helps.
Hello, nice project ! But I can't see the jumper's positions under the drivers for micro stepping, can you help me ? Thank you !
All 3 jumpers should be installed for 16th micro-steps.
Ok thanks for the reply
Hi I am having problem compiling this sketch. The avdweb_SAMDtimer site says "Attention: The new libraries Adafruit_ASFcore and Adafruit_ZeroTimer don't work anymore with the avdweb_SAMDtimer library. Therefore, install the older libraries, see the zip files."
Could you let me know what version ASFcore and ZeroTimer libraries you have your code working on?

I am getting the following error "ISR.cpp:556:1: error: expected '}' at end of input"
Others have had similar issues. There are no versions shown under the Arduino IDE. I don't know why.

They way others addressed it was to download the libraries I used. Here is a link to download.
https://www.dropbox.com/sh/djjzijhbkx040t0/AABl4a5...
(there are zip file and the unzipped libraries, either should work).

The avdweb_SAMDtimer library I used is included in the github distribution. It may also help address the issue.
avdweb_SAMDtimer.cpp
avdweb_SAMDtimer.h

Library management is one of the things I hate about the Arduino IDE.

Let me know how it works.
Hi thanks for the reply.
I have installed all the libraries from your links.
I am getting a similar fail but now against avdweb_SAMDtimer.cpp
"avdweb_SAMDtimer.cpp:85:1: error: expected '}' at end of input
}
^
exit status 1
expected '}' at end of input"

I have Arduino SAMD 32bit Arm Cortex 0+ Boards / Arduino M0 selected under boards.
Is this the correct board or do I need to instal a new boards?

What version of Arduino IDE are you using?

I notice the external libraries RTClib.h, Wire.h. These libraries should say the version number.
Can you let me know the version you are using?

Thanks again for your help.
RTCLib verion 1.4.1
Wire doesn't show up in my Library Manager
Arduino IDE 1.8.12

I have Arduino M0 selected under boards. Not "Arduino SAMD 32bit Arm Cortex 0+ Boards / Arduino M0"

Thanks for that. I will try those settings and let you know how I get on.
Have tried all settings and changed RTCLIB to 1.4.1 and tried it on Arduino IDE 1.8.12 and 1.6.13 still same errors.
I have downloaded your Adafruit libraries Zero and ASFCore as well.
Just can't seem to get it to run. :(

"ISR.cpp:555:1: error: expected '}' at end of input
}
^
avdweb_SAMDtimer.cpp:85:1: error: expected '}' at end of input
}
^
exit status 1
expected '}' at end of input"
The GitHub does contain a binary you could download to the Arduino to at least get it working while trying to figure things out.

note: the serial out expects VT100 terminal emulation, I use the PuTTY app.
Thanks for that. I am just waiting for my Arduino's to arrive from China then I will give it a go.
I Made it...Just cant seem to get to work with the program and geometry.



First geometry, should the clock home to the upper right conner when viewed from the front? with the Beta motor lower right and the Alpha upper right when viewed from the front.

This is the way I have it setup as best I can tell from your instructions.


Secondly software, My Ardurino experience is limited to 3D printers. After following your comments I finally got the sketch to load. But I'm getting strange behavior from the program.

When I bring up the serial monitor and the initial menu I get is some what garbled.




When I try “i” , jump straight to “Digit to place” if I type a digit, jumps back to “Select one:”

When I try ’t” “Set Time” It seem to only pick up a few of the number and drops others. I tried different formats

12:34, 12 34, 1234,

Trying “s” “Start Clock” Ive tried different formats but it tends to drop the first digit or ignore most. But it does run, starting at what ever the RTC has in it.


I was thinking it was something to do with how I set up the Libraries or something lost in compiling. So I uploaded your Hex file. But Its still acting the same.


I just don’t know enough about programming to to figure out. I do see what appears to be a huge amount of debug routines placed around the program. I just can’t seem to get a handle on your code. Any help would be appreciated.



Note: Testing the 3D printed numbers on Refrigerator.
Looking at your photo you have the home switches mounted incorrectly. It might work but you are losing some space along the x-axis edge.

The carrier should be rotated 90* and the switches flipped over. I’ll try to take a closeup photo of mine when I get home.

and just a clarification on my previous comment. You should never press enter, most input is designed to be a single key press. So that is probably why it is skipping the select one:
I know the limit switches look a bit "wonky". I have a box of the off the self 3 wire limit switches I use in 3D printers. Unfortunately they cant be flipped over to change their orientation like a bare microswitch.

So the Y axis home directly on the magnetic carriage. The X axis homes when the side carrier slides pass it just as it hit the corner. It will home reliability in the corner.

Just to be sure I have everything correct, and we are on the same page. I've set up X as left to right and Y up and down.

When I get home I'll fire up putty and try it out again, Can't wait!
Thank you for all you help
Aaron
Orientation is correct, when viewed from the front, home and alpha are in the upper right , beta is in the lower right.

The grabled characters are because the menu is setup to use VT100 terminal commands to clear the screen/etc. I use PuTTY as my terminal program and set it to VT100 emulation. If you are using the Arduino IDE terminal you will see garbled characters but it should not affect opperation.

The time format is four digits and it will automatically place the colon for you. So typing 1234 without pressing the enter key should work and it will display as 12:34

For initialization is should ask for Select one: 1) Tens of Hours, 2) Hours....etc
Type a single digit 0-4 and do not press enter. It should then display "Digit to place:", again type a single digit without pressing enter.

Sounds like you are close. Give it another try with the instructions above.

-- Craig
I cant see the word bearing anywhere in the article. I assume there are linear bearings somewhere. Is there any detail about them?
The linear bearings are 3D printed and integrated into the carriages.

I originally had actual linear bearings but had tolerance issues so I just designed my own 3D printed ones and they worked great. I then realized I didn't have to have the bearings as separate components and just merged them in the carriage designs.
interesting - so it just slides on those plastic grooves in the carriage which obviosly works well enough. Well done
More Comments