Project showcase
Microscope Manager

Microscope Manager © GPL3+

Device that manages the USB camera microscope: Make easy focus with DVD stepper motor and light the object with different colors and intens.

  • 4,234 views
  • 1 comment
  • 11 respects

Components and supplies

About this project

I have purchased the microscope from AliExpress. It came with very simple and hard to handle stand that makes job hard to do. It was without go-through light for the object either.

So I have decided to make an electronized and automated device - stand for the microscope with functions "Focus" and "Change light" using Arduino Pro Mini, 3-color LED, stepper mechanism from old DVD, box from old DVD, 4 buttons to command functions and some mechanical DIY work.

After 1 week there is the result:

This is comand panel:

First 2 buttons used to "Focus" the microscope. They caused stepper DVD motor to step up or down. Button number 3 is used to change the color of the down light. Button 4 is used to change the brightness of the light.

Code

MicroscopeArduino
Two buttons comand "Focus" of the microscope. 1 button changes color and 1 changes brightness of the light for the object. Stepper motor driver is connected to pins 7 and 8; RGB LEDs connected to pins 11, 10, 9; LED comand buttons are connected to pins 2 and 3; and stepper motor comand buttons are connected to pins 4 and 5
#include <Stepper.h>

#define motorSteps 100     // change this depending on the number of steps
                           // per revolution of your motor
#define motorPin1 7
#define motorPin2 8

// define pins for RGB light and pins for buttons for control RGB and focus

int data[7][9] = {
  {255,255,160,190,190,80,90,90,34},
  {255,0,0,80,0,0,30,0,0},
  {0,255,0,0,100,0,0,50,0},
  {0,100,255,0,0,255,0,0,170},
  {255,153,0,160,100,0,100,70,0},
  {255,0,200,160,0,100,100,0,35},
  {0,0,0,0,0,0,0,0,0}
};
int redpin = 11; //select the pin for the red LED
int greenpin = 10; // select the pin for the green LED
int bluepin = 9;// select the pin for the blue LED
int i=0;
int j=0;
int col=2;// select the pin for change color
int brg=3;// select the pin for change brightness
int focpl=4;// select the pin for focus plus
int focmin=5;// select the pin for focus minus

// initialize of the Stepper library:
Stepper myStepper(motorSteps, motorPin1,motorPin2); 

void setup() {
  // set the motor speed at 10 RPMS:
  myStepper.setSpeed(10);

  pinMode(redpin, OUTPUT); pinMode(bluepin, OUTPUT); pinMode(greenpin, OUTPUT);
  pinMode(col, INPUT); pinMode(brg, INPUT);
  pinMode(focpl,INPUT); pinMode(focmin,INPUT);
}

void loop() {
  if (((digitalRead(col)) == 1) or ((digitalRead(brg)) == 1)){
led();}  // read buttons and if there is pressed - send to LED function
  if (((digitalRead(focpl)) == 1) or ((digitalRead(focmin)) == 1)){
focus();}  // read buttons and if there is pressed - send to stepper motor function
  }

// LED function
void led(){ 
 analogWrite(redpin, data[i][j]); analogWrite(greenpin, data[i][(j+1)]); analogWrite(bluepin, data[i][(j+2)]);
    delay (600);
  i=(i+digitalRead(col));
  j=(j+(3*digitalRead(brg)));
    delay (20);
     if(i>=7){i=0;}
     if(j>=9){j=0;}
 }

// Focus function
void focus(){
  // Step forward 1 step:
  if (digitalRead(focpl) == 1) {
  myStepper.step(1);}
  delay(100);

  // Step backward 1 step:
  if (digitalRead(focmin) == 1) {
  myStepper.step(-1);}
  delay(100);
}

Custom parts and enclosures

Power stabilizer
Microscope power supp sspnf6uqls
Inside the box
Microscope 03 scpjcmp1gr

Schematics

Breadboard scheme
Microscope  4sqckxswar

Comments

Similar projects you might like

Arduino - Motor PID Speed Control

Project tutorial by whitebank

  • 36,700 views
  • 18 comments
  • 16 respects

Focus Stacking Rail Made From a Microscope Focus Block

Project tutorial by Jennifer Deegan

  • 1,896 views
  • 0 comments
  • 8 respects

Punch Activated Arm Flamethrowers (Real Firebending)

Project showcase by Allen Pan

  • 134,872 views
  • 86 comments
  • 962 respects

Automatic Pet Watering System

Project showcase by SindreKragsrud

  • 15,269 views
  • 3 comments
  • 32 respects

Gesture-Controlled Car

Project showcase by ashish_8284

  • 3,560 views
  • 2 comments
  • 13 respects

3D Printed R2-D2 with an Arduino Core

Project showcase by Raul Antonio

  • 3,246 views
  • 1 comment
  • 4 respects
Add projectSign up / Login