serhiykobyakov / Shutter-using-old-CDROM

Arduino sketch for CDROM linear actuator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automation of a CDROM linear actuator using Arduino

Alt Text

What is it

I needed some mecnanical laser beam interrupter (optical shutter) and decided to make it myself using garbage. Yes, I like the idea of zero waste way of doing business. Yes, it's damn time consuming way of doing things but let's put all the discussion aside and let me just show you the coding part of the project here.

Here I have only the software without all the other stuff - the circuitry and the case.

The software has been tested for errors, stability and speed.

How It Works

I have an old CDROM which has working linear actuator. It's not very fast for optical shutter but it's cheap. So I need some low power stepper motor driver, an Arduino board to control it and a case to hold it all together. The stepper motor is the Easy Driver - you can see the red board in the bottom left corner of the image. Any Arduino board is siutable for this task (not shown in the image).

In this particular case I needed just two extreme positions of the linear actuator corresponding to the optical shutter states "open" and "close".

The device finds the start position using endstop at the initialization. To open the optical shutter one have to send "o" to serial port, to close it - send "c". Arduino sends back zero ("0") to PC when the process is finished (it si useful to know when the shutter is fully closed or open).

Install

Arduino

  1. Make directory "ShutterCD" in the sketchbook directory on your PC (it is "Arduino" by default, check the preferences in Arduino IDE).
  2. Put the ShutterCD.ino into "ShutterCD" directory.
  3. Open Arduino IDE and set your Arduino board.
  4. Compile the sketch and upload it to the board.

Free Pascal

  1. Download ShutterCD.pas and ShutterCD.ini
  2. Get ArduinoDevice.pas from my Arduino device repository
  3. Put in your directory jedi.inc, synafpc.pas, synaser.pas, synautil.pas from Synapse repository
  4. Use repository info and and see the comments in files to get it work

How To Setup The Device

When you have the device assembled - you need to check for two things:

  1. What is the positive direction of motion - it must be the one when the carriage moves away from the endstop.
  2. How many steps is the travel range of your linear actuator - at the maximum it must stop at the end of the range in order to not hit the wall (maybe the good idea is to put another endstop there). Check for the number and then correct the sketch accordingly.

Contact

For reporting bugs, suggestions, patches

License

The project is licensed under the MIT license

About

Arduino sketch for CDROM linear actuator

License:MIT License


Languages

Language:Python 40.5%Language:Pascal 31.9%Language:C++ 27.6%