Using a Linear Actuator With Arduino and Photoresistor

9,999

38

3

Introduction: Using a Linear Actuator With Arduino and Photoresistor

About: At Actuonix, we have been designing and manufacturing linear motion devices for over a decade. We pride ourselves on making the best affordable linear actuators and servos on the market.

In this Instructable, I'm going to show you how to control a linear actuator using arduino and a photoresistor. I'm using a 6V Actuonix micro linear actuator. Because the actuator is 6V, it's not necessary to provide power from an external source. The actuator can be driven directly off of the board making it an incredibly simple setup, even for an arduino rookie.

There are many potential applications for this from a simple automated chicken coop door, self-closing roof vents or windows, animatronic displays for Christmas or Halloween etc. You get the point.

Step 1: Materials Required

This is a fairly simple setup. Materials required are listed below:

  • Arduino Board - I'm using an Arduino Mego 2560 but most arduino boards should work
  • Photoresistor - Also called a light-sensing module. .
  • Micro Linear Actuator - In order to run it directly from the board, you need a 6V actuator.
  • Power Source - I've used a usb cable. Check the instructions for your board.

Step 2: Wiring

This wiring example will work with the code in the next step. If you change the code, you will need to adjust your wiring and vice-versa.

I've included a basic picture diagram to show how i have my board wired. The red wires on both the actuator and the photoresistor represent white wires. Wouldn't show properly on a white background.

Actuator

Red wire - 5V

Black wire - Ground

White wire - Pin 3

Photoresistor (The color of your wires may vary)

Red wire (Power Source) - 3.3V

Black wire (Ground) - Ground

White wire (Voltage Output) - A0

Step 3: Code

I am not a coder. This code is a slightly modified version of the "servo>knob example found under the file menu of the arduino software. Adjust as necessary for your application.

Upload the code to your arduino using the upload button the software.

That's it! You should now have a functioning photoresistor-controlled linear actuator for your next project!

Be the First to Share

    Recommendations

    • Make It Modular: Student Design Challenge

      Make It Modular: Student Design Challenge
    • Tinkercad to Fusion 360 Challenge

      Tinkercad to Fusion 360 Challenge
    • Build a Tool Contest

      Build a Tool Contest

    3 Comments

    0
    Peewee2620
    Peewee2620

    1 year ago on Step 1

    Hi! I’m New in this sort of Projects, But would very much like to build this. Gonna make a garage for my robot vacuum cleaner.
    Can you tell me What kind of resistor Is used? As far as i can se its a 10K.. But asking to be sure. I dont want to mess up because of this.
    Thanks for a Great guide and hope you will answer me :)

    - Mathias

    9C9E2684-EB5A-4868-AD82-2B1D6C512737.png
    0
    markhayward
    markhayward

    Question 1 year ago

    thanks for the great guide!
    I'm trying to make a similar set up but I'm a complete novice and would really appreciate a little guidance...looking for my system to extend when light sensor detects light and then remains extended (even if the light source then disapears), I would then need a simple pushbutton to operate the retraction.
    also would need to adjust the limit of the extension.
    Do you have any tips or suggestions etc?