Creating a HID USB device

Discussion in 'Microcontrollers and Programming' started by Blacksun, Mar 18, 2017.

  1. Blacksun

    Blacksun

    Joined:
    Mar 18, 2017
    Messages:
    2
    Likes Received:
    0
    Hi,

    I had a few questions about usb devices.

    I am kind of new to the world of electronics, and built this small conception:


    I did this by writing a small arduino program that sends the distance between the ultrasonic sensor and my hand, to my pc by using serial.write. And I wrote a small program in c# that listens to my com port. volume of the pc is set to the distance in centimeters.

    The ultrasonic sensor outputs a pulse, the duration of the pulse is the is the time that the sound took to travel to my hand and back to the sensor

    So, as a challenge/project I want to make this without an arduino. just a microcontroller and my ultrasonic sensor. At this moment I have a program at my pc which sets the volume, but is it possible to let an usb device do this? without having to develop/install additional drivers? So just a plug&play situation.

    and how to make a microcontroller communicate with a pc via usb?

    Thanks!
     
    Blacksun, Mar 18, 2017
    #1
    1. Advertisements

  2. Blacksun

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    Joined:
    Jan 21, 2010
    Messages:
    23,161
    Likes Received:
    2,092
    Location:
    Mid way between Beijing and the Ronne Ice Shelf
    An Arduino isn't as different from a microcontroller as you may think.

    Many microcontrollers these days have a native USB interface.
     
    (*steve*), Mar 18, 2017
    #2
    1. Advertisements

  3. Blacksun

    Austin Clark

    Joined:
    Aug 29, 2016
    Messages:
    16
    Likes Received:
    8
    Location:
    Hutchinson, KS
    I'm not sure if a pure plug-n-play solution is easily achievable or not. If you're ok with using your own software on the PC, I'd just stick with what you have now. That is, use a USB to serial converter to communicate with the microcontroller from your PC. The Arduino development board took care of that for you originally. You'll need to get a USB to Serial converter IC for your final project alongside the microcontroller itself.

    As Steve mentioned, there are also microcontrollers with native USB support, but I wouldn't worry about that for this particular project. Unless, again, you ABSOLUTELY need something completely plug-n-play (which still might not be possible).
     
    Austin Clark, Mar 19, 2017
    #3
  4. Blacksun

    Blacksun

    Joined:
    Mar 18, 2017
    Messages:
    2
    Likes Received:
    0
    Okay Thanks! I'll try to improve my software first of all.

    I tought this was a cool idea and I eventually could make a kickstarter project out of this. that's why I don't want an arduino inside. It's too big and pricey if I would want sell them. But I just got started with this project, not even sure how far I will get. I am learning a lot about at this moment. Which is nice :)
     
    Blacksun, Mar 19, 2017
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.