VB.NET Program to send Voltage signal in milliseconds

Posted on 2012-09-02
Last Modified: 2012-09-03
I am currently needing to write a VB.NET program that will do the following:
-- I need it to send a 4mA signal at 80 milliseconds
-- I need it to send a 20 mA signal at 180 milliseconds

I would like to do this in VB.NET as it is language I am most familiar with, which isn't saying a whole lot :).

I am thinking if it is possible to just send the different voltage amounts out the USB port, which has up to 500mA of power?

I hope that is enough information. I am just seeking the best way to do this, it doesn't have to be USB or a program, but just need a way to send those two signal voltages at that speed.

Thank you for you help and thoughts!!
Question by:sscottinandrews
    LVL 77

    Expert Comment

    by:David Johnson, CD, MVP
    what about multiples of 4 * 9 send out 24mA ?? (every 36 cycles) and for how long is this pulse?
    my thinking is that you need a simple circuit with current limiting resistors to limit the current.. USB doesn't have fluctuating current it just supplies a voltage with a MAXIMUM current of 500mA. So you need to have 2 ports that you can toggle on and off and then use an op-amp or transistor that once voltage is applied to its base will allow current to flow.

    Author Comment

    Sorry most of that makes sense; however, I wasn't quite clear. I have a device that has a position of top and of bottom. It is controlled by a laser. The laser in order to know where top is to send it a signal of 20mA within 180 ms, then position it at bottom and send it a 4mA signal at 80ms. So it is set device at top send signal, set device at bottom and send signal.

    So going out each port into a capacitor makes sense, just how? Or is what I just described still doable?

    Thank you!!!
    LVL 77

    Accepted Solution

    not a capacitor a capacitor will smooth the transition. it is like a miniature battery.. one uses a capacitor to block dc or to smooth ripple. depending upon whether or not it is in series or parallel. You need to study basic electronics and learn ohm's law..  programming a port to be on for 80ms or another port to be on for 180ms is pretty trivial and depending upon which port is ON your current limiting device will output the signal. The serial port is the easiest to program as you can use the DTR/DCE lines.  Anything more requires designing a device driver which is well beyond what can be taught here.

    Author Comment

    I actually believe the best approach to be Arduino board as I can program it to send the signals I need by tracking the state of the button. Thank you ve3ofa for your comments, and yes I didn't actually mean a capacitor earlier as it would certainly not do what I want. As for ohm's law, I am pretty sure I memorized that in Physics years ago in college, but I am pretty sure I can get away with not needing it for this project. Although it would make a lot easier.

    Again, I do appreciate the advice, I technically only wanted to know how t write the VB.NET code to do the sending of the signals, the "trivial part".

    Thanks again!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
    The viewer will learn how to back up with the free utility from runtime software, DriveImageXML using Windows 7. Download DriveImageXML from Open folder where it was saved: Start installation by double clicking the install scrip…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now