12V Solenoid + Visual Basic

Discussion in 'The Projects Forum' started by chillxdd, Feb 18, 2014.

  1. chillxdd

    Thread Starter New Member

    Feb 13, 2014
    6
    0
    Hello, I am new here, and I am also new with electronics. I have a project where I am required to use VB to control a DIY door lock using a solenoid. Problem is I have no idea where to start wiring, though I already have the solenoid (12V). I think I have to use a relay but I'm not entirely sure. Any help will be much appreciated.
     
    Last edited: Feb 18, 2014
  2. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,036
    What sort of device will be running Visual Basic, a computer? You need an output of some kind - do you have any plan for which port you would like to use?

    There are lots of data acquisition devices such as LabJack or DATAQ that would make this chore very easy via the USB port.
     
  3. chillxdd

    Thread Starter New Member

    Feb 13, 2014
    6
    0
    We are required to use only the parallel port of a desktop pc, sadly. :(
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,524
    2,369
    If you control one of the outputs, you can interface straight to a 5v gate level FET rated for the required current level of the solenoid.
    Max.
     
  5. chillxdd

    Thread Starter New Member

    Feb 13, 2014
    6
    0
    Sorry to sound so stupid but I actually cannot understand at all, I'm a total newbie with this.

    I found a diagram but I do not understand it, if someone can please explain it to me or make it easier to understand, then I would really appreciate it. I'm sorry for the trouble. I attached it.

    Out of the two, which is better to use? The 2nd one was a "safer" circuit compared to the first.
     
    Last edited: Feb 19, 2014
  6. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
  7. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,524
    2,369
    Instead of a bipolar transistor I have used the 2N7000 for lighter loads and the IRL530 Mosfets for anything larger.
    This allows connecting direct to the PP without loading it.
    Max.
     
Loading...