USB/Optocoupler controlling a solenoid

Discussion in 'The Projects Forum' started by rafaelluizmesquita, Aug 8, 2013.

  1. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    Hey guys,

    I am a physicist, not micro electronics experience whatsoever, and my adviser said that I should put together a circuit that could make a solenoid (24V) open with a USB 5V signal. This solenoid will serve as a shutter for a laser we are using to calibrate an instrument we have.

    After a few hours on the computer I found that the Optocoupler 4N25 would be the way to go. Actually I thought it would be straight forward, and went ahead and bought the thing.

    I got it three days ago, and after almost 24 hours of restless work, I still haven't make the circuit to work.

    I have a breadboard, a couple of multimeters, a computer and a dc regulated power supply. It would be no problem at all for me to shut down a USB port and turn it on again to send the signal.

    here is the datasheet: http://www.vishay.com/docs/83725/4n25.pdf

    What should I do? I am trying to organize like this image attached... Am I doing something wrong?

    Can someone show me how to do it... I am really desperate!...
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,558
    2,377
    Last edited: Aug 8, 2013
  3. wayneh

    Expert

    Sep 9, 2010
    12,149
    3,058
    I don't see an image. I think your approach should work fine but it's hard to tell what went wrong without a diagram or photo. Note Max's question about the solenoid 24V supply. You said you have a DC power supply. Can we assume that the solenoid functions with 24VDC?
     
  4. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,771
    971
    Also...how much current does the solenoid require
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,558
    2,377
    The image I see is of a 4n25 opto, extra components would include a resistor for the emitter calculated at 10ma 5v =500ohm. and an output load resistor and either power fet or bi-polar transistor drive for the solenoid if DC, dependent on the solenoid current.
    Max.
     
  6. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    The thing is that I am trying to make as cheep as I can MaxHeadRoom... He said that the whole thing could not exceed 10 $. Since we are making a whole bunch of those.

    I thought in use some relays but they can be expensive compared with the optocoupler that is .3$...
     
  7. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    I am so sorry wayneh... I forgot to attach the image... here we go...
     
  8. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    I don't have a solenoid quite yet... I am first testing everything with multimeters... So I can buy the solenoid with whenever result comes out of this circuit...
     
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,558
    2,377
    You can base it on the suggested schematic on the App sheet, just that the output will be at 24vdc.
    24vdc solenoids can usually run up to around 2amps, so you really need to zero in on the solenoid you need for the application, even if you don't have it in hand, at least you will know the load current to aim for and even simulate it with the testing.
    What are the problems you are facing getting it to work so far?
    Sounds like a high end project with a budget of $10.00 ;)
    Max.
     
  10. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    My problem... well... I have two problems... the first and biggest is that, besides my love for electronics, I am stupid as a peace of wood when the topic is electronics...

    the second problem is this 10$ budget... There's some products out there that can do the whole thing with 200$... I would prefer to just buy the 200$ motor controlled with a USB port. But 200$ is a lot when you multiply that x10.

    And I guess my professor wants me to learn how to do it... So he challenged me. The thing is that he does not know how to do it too... I would love to see or talk to someone that already resolved that...
     
  11. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,558
    2,377
    Did you reproduce the sample circuit? if so you will need a extra drive transistor, I can post the whole thing if you want?
    But as I say, some depends on what the current of your solenoid is going to be?
    Max.
     
    rafaelluizmesquita likes this.
  12. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,015
    1,531
  13. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    why a USB port?
     
  14. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    - Did you reproduce the sample circuit?

    No I don't think so...

    - if so you will need a extra drive transistor, I can post the whole thing if you want?

    That would be great Max!

    I'll email the guy will purchase the solenoid and see what he says.

    Thank you Max
     
  15. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    We will operate remotely. So it needs to be all computer controlled. I am still being unsuccessful.
     
  16. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,558
    2,377
    Try this.
    Max.
     
    rafaelluizmesquita likes this.
  17. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    I'm sorry Max, but could explain what each of those things are and does? I do understand the physics involved but I have a hard time understanding how it really works...
     
  18. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,558
    2,377
    I could just label them if that would help?
    The 4n25 OPTO recieves the signal and isolates it from the 24v device, a darlington transistor which then turns on and energizes the solenoid coil.
    The 1n4007 is a rectifier to suppress any back EMF at turn off of the solenoid.
    Max.
     
    Last edited: Aug 9, 2013
  19. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    Looks like I am gonna have to buy some more components, which is gonna take a couple of days!... Well... I will try to put everything together and will come back with some feedback in a few days... Thanks again for your help!
     
  20. rafaelluizmesquita

    Thread Starter Member

    Aug 8, 2013
    38
    0
    By the way.... is there anything in special that I should worry when I purchase those items?
     
Loading...