Project showcase

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.

  • 3,608 views
  • 1 comment
  • 10 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

BBC Micro Online

Project in progress by 8bitkick

  • 3,572 views
  • 4 comments
  • 10 respects

Arduino MIDI Arpeggiator

Project tutorial by Dmitry

  • 4,928 views
  • 18 comments
  • 43 respects

::vtol:: Hot Ninja

by vtol

  • 7,729 views
  • 11 comments
  • 28 respects

Mobile IoT Weather Station with UV Index

Project showcase by Carlos Orts

  • 5,728 views
  • 11 comments
  • 24 respects

The Environment Cube! Know the Land Beneath You!

Project in progress by Dhairya Parikh

  • 2,924 views
  • 2 comments
  • 14 respects
Add projectSign up / Login