PDA

View Full Version here: : USB motor/ servo driver + relay???


Merlin66
01-12-2011, 02:02 AM
Help needed guys.....
I want to control a shutter and an external lamp from the USB port.

The shaft on the shutter need to rotate 90 degrees (open to closed position) and the neon lamp takes 2A at 12V.
So, ideally - close the shutter, switch on the lamp, switch off the lamp, open the shutter....
I've looked at some PIC options (POLOLU Maestro, Microbee DC servo, and stepper version) but the need for the lamp switching seems to be a problem.
I'm no electronic wizard...only need a job done.
Can you help??

Poita
01-12-2011, 11:36 PM
The lamp switching shouldn't be a problem, just drive a big relay and switch the lamp with that. How fast does this all have to be and what on earth is it for?

Merlin66
02-12-2011, 12:54 AM
It's to remotely operate a neon reference lamp in a spectroscope.
Before and after each set of spectrum images we need to take a reference spectrum to allow correct calibration.
There's no real timing constraints, the lamp exposure would be of the order of 10 seconds.

joshhagger
02-12-2011, 10:55 AM
An arduino would probably do what you want, can be used via usb or ethernet & can control relays & stepper motors.

Little Bird Electronics (http://www.littlebirdelectronics.com.au) has the hardware & the Arduino (http://www.arduino.cc) site has the software, libraries & code ideas.

Regards,
Josh

alistairsam
02-12-2011, 01:11 PM
Have a look at the picaxe's as well.
I've seen a few similar completed projects and they're very easy to use.
programming code couldn't be simpler.

you can attach relays to a few of these boards. most picaxes support servos natively. http://www.microzed.com.au/index.php?main_page=index&cPath=14&zenid=m84vn4tnp5vbafm6d089isk8d1

http://www.picaxe.com/Circuit-Creator/General-Outputs/Relay/

http://www.picaxeforum.co.uk/forum.php

but when you say powered by usb does it have to be pc controlled or is the usb just a 5v source?

mswhin63
02-12-2011, 03:40 PM
I currently use PIC myself and programming is a lot easier than when i first started but I feel Arduino has provided a slight better range and solution than PIC. One is the development kit for PIC uses a special lead for connecting (3.5mm) to PC while Arduino uses regular USB connections. I am considering switching to Arduino.

Bassnut
02-12-2011, 06:51 PM
Thats a good point, USB controlled or powered is bit tricky.

Unless you want to go to the bother of building a pcb with a micro etc (lots of electronics but granted, save money) why not just buy a cheap small PLC ($150 or so) and everything is built in. Then a wind screen wiper motor or such with 2 limit switches at 0 and90deg and a bit of programing (done right on the PLC, no PC) and it's done. The lamp is simply switched by a built in PLC output relay. No soldering or electronics is required.

If USB control is required, there are many pre-built USB relay out - limit sw in interface modules available, but they require PC interface software/coding skills.

Merlin66
02-12-2011, 07:39 PM
Fred, et al,
The shutter is inside the spectroscope and probably only needs 50gm to rotate...
I bought the POLOLU Maestro USB servo driver and a small 12V RC model type servo - The Maestro package has a windows interface which allows me to control the rotation of the servo but there's no connections I can use to control a relay...it's been suggested I need to buy a "latching" 5V relay to control the lamp.
I'm no electronics wizard, but the cost and complexity just seems to rise..
I'm thinking of just buying the Microbee controller (servo and switching capable) but that another 30gbp!

Bassnut
02-12-2011, 07:52 PM
OK, think of this. Program the servo and mechanically align the mechanics to operate the shutter from 10deg to 100deg (90 deg). Fit a microswitch to the servo actuator, so its activated (pushed) at 0 deg. Connect the microswitch to the lamp. Programing the servo from 10 to 0 and back to 10 operates the lamp, and 10 to 100 deg operates the shutter. If you need the lamp to be on whilst the shutter is operated, then get a "latching" relay switched by the microswitch. 10-0-10 to turn it on, then after operating the shutter, 10-0-10 to turn it off again. This all might sound odd, but ive done this kind of thing on several projects and it works very well.

Merlin66
02-12-2011, 08:40 PM
Fred,
Great minds think alike, or was it something about fools....
Yes, I've just found a small microswitch in my junk box so I'll set it up with the servo....
I was thinking even of a small camplate on the shutter shaft to activate...

Bassnut
02-12-2011, 09:15 PM
Exactly.

Poita
03-12-2011, 08:19 AM
Or if the cam-plate is a hassle, use a magnet and a reed-switch, which will be a total cost of <$5 and reed switches can take quite a bit of current.