Arduino: laser, LED and fans control (on/off)

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Golitan11
 
Posts: 15
Joined: Fri Jun 19, 2015 12:55 am

Arduino: laser, LED and fans control (on/off)

Post by Golitan11 »

I am currently building a closed MDF box (controlled environement for 3D scanning) and I already have a 5mW green laser line generator powered by a 3V DC/500mA wall adapter. If I want to turn the laser on or off, I need to unplug the wall adapter from the wall socket. Now, I tought it would be better to just automate the process and control the laser state via the Arduino Uno. In other words, when I start a scan, the laser would turn on, and when the scan is finished, the laser would turn off.

Same applies to a LED. I wanted my 3D scanner to have 2 states: depth calculation state (laser only, no other source of light) and texture extraction state (no laser, one source of light from the camera). Each state will require a complete 360° rotation of the object being scanned and they will happen one after the other (back to back, depth calculation first and then texture extraction). In the texture extraction state, I would like to achieve the same control as the laser in the depth calculation state using the Arduino, but with a light instead.

Finally, the box being closed (partially?), I would need some airflow to keep the area as fresh as possible. I tought PC fans were a good area, and as always, I want to control them via the Arduino (not necessarily their speed, but at least their state, just like the light and the laser).

Here are my questions:

- What would I need to control these 3?
- What kind of light/LED would be the most suitable (it would be just to light the object for texture/colors extraction)?
- Are PC fans my best bet? Is it necessary knowing that an Arduino and a motor would be inside that sealed box running constantly?

P.S. I alreay have a Big Easy Driver from Sparkfun plugged into the Arduino running a geared stepper motor if that matters.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino: laser, LED and fans control (on/off)

Post by adafruit_support_bill »

ON/OFF control of DC devices is fairly straightforward. You can use a transistor like a PN2222 for loads up to 1A or so (heat-sink recommended). Or a power MOSFET for heavier-duty switching.

https://www.adafruit.com/products/756
https://www.adafruit.com/product/355

A fan might be a good idea if you are using a higher-power LED in a closed box for your texture extraction.
https://www.adafruit.com/products/518

User avatar
Golitan11
 
Posts: 15
Joined: Fri Jun 19, 2015 12:55 am

Re: Arduino: laser, LED and fans control (on/off)

Post by Golitan11 »

Do you have any documentation on how to hook up these to the Arduino? Also, power-wise, would they be (laser, LED and fans) powered directly from the Arduino or they all need individual power sources? I would like to have one switch to turn on or off the whole machine.

Sorry for my small lack of knowledge (I am a complete newbie), I am actually a programmer and not an electronic guy. It's just that my project has an electronic portion which was supposed to be done by someone else and now I'm a bit stuck in this. It's cool though.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino: laser, LED and fans control (on/off)

Post by adafruit_support_bill »

This guide shows how to use the PN2222. https://learn.adafruit.com/adafruit-ard ... ard-layout

For low power 5v devices (5v @< 500mA) you can take power from the 5v pin as shown. Otherwise, you will need a separate power supply.

To use a separate supply, connect the the ground to the Arduino ground and the high side of the load (red wire in the diagram) to the positive output of the power supply.

The power MOSFET does not need the base resistor used with the PN2222. You can drive it directly from an Arduino digital pin. This guide shows how to use them for driving LEDs: https://learn.adafruit.com/rgb-led-strips/usage

User avatar
Golitan11
 
Posts: 15
Joined: Fri Jun 19, 2015 12:55 am

Re: Arduino: laser, LED and fans control (on/off)

Post by Golitan11 »

Knowing that I would have the motor controller (which already takes most of the pins, see https://cdn.sparkfun.com/assets/learn_t ... pFixed.jpg), the laser, a LED, fans and maybe a load cell (in the future), is it all do-able using an Arduino Uno and a breadboard or I would need to upgrade to something bigger? How do I know this?

Also, how would I use the controller in conjunction with the breadboard?

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: Arduino: laser, LED and fans control (on/off)

Post by adafruit_support_bill »

Each of the on/off switching circuits would require 1 pin. A load cell would require an analog pin and possibly an instrumentation amp.

If you start running short of pins, you could upgrade to a Mega. Or you could use one of our motor shields which uses only 2 pins. These 2 pins can also be shared with other i2c devices.
https://www.adafruit.com/product/1438

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”