Rock tumbler with timer

Rock tumbler with timer

Description

Rock Tumbler With Timer ==================== I Was Thinking Of Printing Jt3D'S [Affordable Rock Tumbler](Https://Www.Thingiverse.Com/Thing:935252) But Wanted A Little More Control So I Decided To Build One Based On An Arduino. The Main Thing Is The Stepper Motor And Using It'S Rpm And Steps/Revolution To Get An Approximation For How Long It Will Run. ### Assembly You Should Be Able To Put It Together By Just Looking At The Pictures. One Thing I Decided To Do Is Put Bearings In The Right Side Wheels And Let Them Move Freely. The Drive Side Is Fixed And The Bearings Sit In The Frame. There'S A Replacement Stl Included For The Right Side Of The Frame If You Decide To Go That Way. ### Barrel Insert The Insert For The Barrel Is 153Mm Wide. I Bought Some Anti-Slip Mat That I Hot Glued To The Inside And Then Just Put Some Glue On The Edges And Forced It In. I Use A Bunch Of Nails And Rivets As My Polishing Media. ### Arduino Wiring ![Arduino Wiring](Https://Cdn.Thingiverse.Com/Renders/83/Bf/9B/02/73/4185F56F9Eb760Da0830Ea2Dc86D6D8C_Preview_Featured.Jpg) I Used An Arduino Uno And A Perma-Proto Board To Mount The Electronics On. My Power Adapter Is 9V 2A So There'S A Voltage Regulator Between The Power Cord And Motor To Get It Down To 4.83V. I Couldn'T Find The Correct Representations For The Components So You'Ll Have To Check Each Part For How To Connect Them. Code --------------------- ```C #Include <Button.H> #Include <Stepper.H> #Include <U8Glib.H> Const Int Potpin = A0; Button Startbutton(3); Const Int Steps = 200; Const Int Rpm = 80; Stepper Stepper(Steps, 4, 5, 6, 7); U8Glib_Ssd1306_64X48 Oled(U8G_I2C_Opt_None); Enum Status { Stopped, Started}; Status Tumblerstatus; Long Stepsleft; Void Setup() { Stepper.Setspeed(Rpm); Startbutton.Begin(); Tumblerstatus = Stopped; Stepsleft = 0; } Void Loop() { Oled.Firstpage(); If (Tumblerstatus == Stopped) { Do { Drawstartpage(); } While (Oled.Nextpage()); } If (Startbutton.Released() || (Tumblerstatus == Started && Stepsleft > 0)) { If (Tumblerstatus == Stopped) { Stepsleft = Gettotalsteps(); } If (Stepsleft > 0 && Tumblerstatus == Started) { // Just Move A Quarter To Not Block Listening For Button Presses Int Stepdistance = Steps / 4; Stepper.Step(Stepdistance); Stepsleft = Stepsleft - Stepdistance; } Tumblerstatus = Started; } // Stop If Start Button Is Pressed Again If (Startbutton.Released() && Tumblerstatus == Started) { Stop(); } } Void Stop() { Stepsleft = 0; Tumblerstatus = Stopped; } // Convert To Total Steps For The Hours Set Unsigned Long Gettotalsteps() { Unsigned Long Potvalue = Gethourstorun(); Unsigned Long Stepstorun = Potvalue * 60 * Steps * Rpm; Return Stepstorun; } Long Gethourstorun() { Unsigned Long Potvalue = Analogread(Potpin); Unsigned Long Value = Map(Potvalue, 0, 1023, 1, 24); Return Value; } Void Drawstartpage() { Oled.Setfont(U8G_Font_04B_03); Drawline("Rock Tumbler", 8); Drawline("V1.0", 16); Oled.Setfont(U8G_Font_Helvb08); Drawline("Run For", 28); Char Time[5]; Sprintf(Time, "%Dh", Gethourstorun()); Oled.Setfont(U8G_Font_Helvb12); Drawline(Time, 44); } Void Drawline(Char Text[], Int Line) { Int X = (Oled.Getwidth() - Oled.Getstrwidth(Text)) / 2; Oled.Drawstr(X, Line, Text); } ``` Hardware --------------------- I'Ve Put What I Used In Parenthesis - Arduino + Wires (Arduino Uno Rev. 3) - 64X48 Oled (Oled Shield For Wemos D1 Mini) - Stepper Motor Driver (Adafruit Tb6612) - Perma-Proto Board (Adafruit Perma-Proto Half-Sized, 82Mm X 55Mm) - Voltage Regulator (Luxorparts, 4.5-28 V To 0.8-20 V. Based On Mp1584) - Power Adapter (9V, 2A) - Button - Potentiometer - Power Switch - 8Mm Threaded Rods - 8Mm Nuts, Lock Nuts, Lock Washers - Bearings, 22Mm X 7Mm M8 - O-Rings For The Wheels Video --------------------- Https://Youtu.Be/Vnp2_Rvvvxg

Statistics

Likes

83

Downloads

0