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:
    22,454
    Likes Received:
    1,869
    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:
    9
    Likes Received:
    4
    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

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.
Similar Threads
  1. rogervan
    Replies:
    11
    Views:
    472
    Sunnysky
    Aug 12, 2016
  2. April
    Replies:
    6
    Views:
    251
    hevans1944
    Nov 24, 2016
  3. zacchi4k

    Help a noob repair a flat cable in a Dualshock 2

    zacchi4k, Dec 5, 2016, in forum: Electronics Repair
    Replies:
    13
    Views:
    463
    73's de Edd
    Dec 9, 2016
  4. dopeness

    I have a question about a fan I built using a dc motor.

    dopeness, Jan 7, 2017, in forum: General Electronics Chat
    Replies:
    14
    Views:
    196
    Audioguru
    Jan 8, 2017
  5. Name...
    Replies:
    5
    Views:
    187
    duke37
    Jan 10, 2017
  6. unseen_rider
    Replies:
    8
    Views:
    148
    Qualcomm_inside!
    Mar 12, 2017
  7. Michael/5of9
    Replies:
    6
    Views:
    152
    shrtrnd
    Mar 23, 2017
  8. Gregg Seipp
    Replies:
    3
    Views:
    104
    Arouse1973
    Mar 19, 2017
Loading...