1 / 2
Automated 7 Segment mechanical counter — image 1
1 / 2

Automated 7 Segment mechanical counter

Order a print of this model

We calculate the final price from your selected file. You review and accept it before payment.

Saved on this device.

Automated 7 Segment mechanical counter with servo

Rating
0 / 5
Likes
25
Downloads
106
Makes
0
Views
1,604
Reviews
0

Updated at source:

Model information

Category
Other Ideas
License
Creative Commons — Attribution — Noncommercial — Share Alike

Components

Standard pieces

You will need to print the standard part of the 7 Segment Mechanical Counter.
You also can use tigh tolerences part from my previous remix.

Custom pieces

You need the backplate and the push action from this model. 
Tips: Print the push action on it's side with tupport to have smooth surfaces.

Servo

This model is optimized for a mg995 servo

Servo horn

I've used this horn for the servo.

Microcontroller

The code that follow is for an ESP32 but you are free to use what you want.

Code

I've based the servo control from this video.
 

First version, going through all the number

// Import ESP32Servo library, don't forget to install it. https://madhephaestus.github.io/ESP32Servo/annotated.html
#include <ESP32Servo.h>

// Initiate the variables Servo myServo; int count = 0; int wantedCount = 0;

// Setup servo and serial communication void setup() { myServo.attach(13); Serial.begin(115200); }

void loop() { nextDigit(); }

// Function making the servo go down, then go up void nextDigit() { myServo.write(100); delay(500); myServo.write(170); delay(500); }

Second version, select a specific number to go to

// Import ESP32Servo library, don't forget to install it. https://madhephaestus.github.io/ESP32Servo/annotated.html
#include <ESP32Servo.h>

// Initiate the variables Servo myServo; int count = 0; int wantedCount = 0;

// Setup servo and serial communication void setup() { myServo.attach(13); Serial.begin(115200); }

void loop() { // Read the integer value from serial input, make sure to input a number between 0 and 9 if (Serial.available() > 0) { wantedCount = Serial.parseInt(); }

// Move the servo until the count matches the wantedCount while (count != wantedCount) { // Trigger the servo nextDigit(); count++;

// Loop back to 0 when hiting 10
if (count == 10) {
  count = 0;
}
Serial.println("wanted: " + String(wantedCount));
Serial.println("current: " + String(count));

} }

// Function making the servo go down, then go up void nextDigit() { myServo.write(100); delay(500); myServo.write(170); delay(500); }

Tags