Forum Discussion
fudspong
11 years agoExplorer
USB Analogue to Digital Interfaces
Does anyone have any experience of these? I've found a few multi-channel A2D USB interface hardware providers via Google but I'm a complete beginner when it comes to this kind of stuff.
I have an idea for a specific Rift experience that has a hardware component that will need low voltage measurement (up to 12v), equivalent rotational positioning on the hardware translating onto your Rift avatar, and analogue "steering" with force feedback. I'm planning on cannibalising a force-feedback wheel for the steering but I need help with the continuous voltage measurement and for the rotational mapping. Preferably a hardware-processed solution to avoid CPU overhead.
Can anyone point me in the right direction? I'm not really a hardware guy so the simpler the better. Plug the sensors into the controller, plug the controller into the computer via USB.
I have an idea for a specific Rift experience that has a hardware component that will need low voltage measurement (up to 12v), equivalent rotational positioning on the hardware translating onto your Rift avatar, and analogue "steering" with force feedback. I'm planning on cannibalising a force-feedback wheel for the steering but I need help with the continuous voltage measurement and for the rotational mapping. Preferably a hardware-processed solution to avoid CPU overhead.
Can anyone point me in the right direction? I'm not really a hardware guy so the simpler the better. Plug the sensors into the controller, plug the controller into the computer via USB.
10 Replies
- geekmasterProtegeThe traditional approach in the hacker community is to throw an Arduino at it, but there are better solutions these days. Here is one that is ARM Cortex M0 based, has built in FPGA circuitry allowing you to software-rewire it with various onboard digital and analog modules (including analog input and analog mux for multiple channels), comes with a "snap off" USB to serial adapter, and only costs $4USD (you can save on shipping cost by ordering multiple units):
http://www.cypress.com/?rID=92146.jpg)
That is a very flexible approach, breaking out lots of I/O pins.
If you want a cheap hack, some sound cards allow DC coupled inputs, for reading analog inputs, and there is software out there to handle that (sound card oscilloscope programs).
But if you are not the hacker type, just buy a ready-to-go unit, but you will pay extra for that, and you will miss an excellent opportunity to learn something new.
(I have spare time while waiting for an appointment in 20 minutes, or I would have my head buried in code right now instead of answering this post. You may not see me around here much while embedded in my current projects.) - fudspongExplorerHoly moly GM, thanks for the great reply, I have looked at arduino and will take a closer look at your alternatives, but I'm not a hardware hacker, more invested in UIX rather than hardware/programming so it's another learning curve I could do without. Is there an off-the-shelf solution that will pipe variable voltage and positional information straight into unity via USB, preferably without CPU overhead?
I have a good idea but I don't think it will be possible unless I can buy the parts off the shelf and tinker with the software myself. - geekmasterProtege
"fudspong" wrote:
... Is there an off-the-shelf solution that will pipe variable voltage and positional information straight into unity via USB, preferably without CPU overhead? ...
I do not have time to google that for you, but here is a good place to start:
USB custom hardware interface for Unity3D:
http://dangerousprototypes.com/2013/07/03/usb-custom-hardware-interface-for-unity3d/
Arduino sketch for connection with MPU-9150 (and Unity):
http://geedesign.com/blog/?page_id=892
Or you could use a $11.88USD STM32F3DISCOVERY dev kit with "foculus" (reverse-engineered Rift Tracker) code:
http://yetifrisstlama.blogspot.com/2014/03/the-foculus-rift-part-2-reverse.html
https://github.com/yetifrisstlama/Foculus_Rift_Tracker_STM32F3DISCOVERY
http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF254044
STM32F3DISCOVERY board with built-in "9-axis" IMU
Good luck, and happy learning (your brain needs exercise to stay young)! - geekmasterProtege
"fudspong" wrote:
... I'm planning on cannibalising a force-feedback wheel for the steering but I need help with the continuous voltage measurement and for the rotational mapping. Preferably a hardware-processed solution to avoid CPU overhead. ...
Another option is to use a simple VCO (voltage controlled oscillator) to convert your analog voltage into a frequency. You can also use a PWM circuit for that. Then use a sound card input and measure the frequency, or measure the PWM frequency on a digital input pin. You would still need to get that data into Unity, and you may be able to borrow code from the previously mentioned projects.
I also recall a kickstarter awhile back for a hardware input device with Unity support, which may be closer to where you want to start. Let's google that... Ahh, here it is:
The Makey Makey:
http://www.theverge.com/2012/5/15/3021373/makey-makey-usb-input-device-kickstarter-35
But it appears to be digital-only inputs. A cool hack though. Watch this video of it in action:
If your custom hardware has HID device support, Unity can read it as a joystick or game controller (including the analog voltage input):
http://www.gamedev.net/page/resources/_/technical/apis-and-tools/usb-base-custom-hardware-interface-for-unity3d-r3267
The available ways to do what you want are pretty much limited only by your imagination. - fudspongExplorerAwesome, thanks guys, this will get me started nicely :)
- geekmasterProtege
"fudspong" wrote:
Awesome, thanks guys, this will get me started nicely :)
No MPD (Multiple Personality Disorder) here, so "Thanks guy" would be more appropriate at this point in the dialog. ;) - fudspongExplorerApologies, GeekMaster, I was excited about getting so much quality information from one of the forum heroes that I had a brain-fart. I spent a couple of days googling these things and wound up frustrated because I didn't know the right keywords for what I was looking for, and you come along and dump it all into my lap. Nice one! :D
- geekmasterProtege
"fudspong" wrote:
... I spent a couple of days googling these things and wound up frustrated because I didn't know the right keywords for what I was looking for, and you come along and dump it all into my lap. Nice one! :D
Google-Fu mastery comes with practice (lots and lots of practice). It just so happens that I have used the internet since before there WAS a "world wide web", and I started web browsing when there were only 250 websites on the entire planet (no search engines yet). I have had plenty of time to hone my Google-Fu powers (i.e. much more than the 10,000 searches it takes to encode it into muscle memory, like a reflexive tennis serve).
These electronic draft articles were reprinted far and wide (and even in ordinary newspapers) back in the day when the public was first allowed to use the internet:
http://uanr.com/articles/internet101.html
http://uanr.com/articles/internet102.html
http://uanr.com/articles/internet103.html
Of course, the versions on paper had corrections, pull-quotes, and plenty of relevant clip-art. Notice my mini-review of "AlphaWorld (Virtual Reality Land Grab)" in there. But I have been into VR since the early 80's. In fact, I have a copy of the book "Artificial Reality" by Myron W. Krueger sitting in front of me now, which I bought back in 1983.
Having been a computer programmer for more than half a century (taking it up as a dedicated hobby a few years after writing my first program), I have more than a reasonable amount of experience at this stuff. I get email notices from hackaday when new stuff gets posted, and occasionally there is something worth going to that website to check out. That is where I discovered the ARM dev kits in my first post in this thread.
Anyway, I have tons of 3D photos from the trade shows I have gone to recently (GDC, IEEE VR, NeuroGaming, SVVR, AWE, and E3). I need to upload more of those photos and write some articles. I actually learned significant social skills these past few months, and I have been perfecting my "Jedi Mind Trick" mastery (including talking my way into a free $995 E3 admission WITHOUT proof I was somebody "important", with a little help from my friends at Virtuix). Fun times indeed! Here are some of my photos (much more to upload later):
http://uanr.com/photos
I really should wrap some HTML around these 3D cross-eye photos to make them easier to navigate, some day RSN... ;)
So yeah, knowing the magic keywords to google is pretty much an automagic reflex for me these days. My fingers just squirt them out into the keyboard as I think about the topic of interest, so really, not much effort involved at all. Just doing my little part to make the world a better place for us all...
Now, getting back to connecting external hardware to Unity3D, and considering that I have a box full of Power Gloves in my collection of collections, if I ever get time (yeah, right!) I should mod one for Unity like this:
-- Geekmaster, the metacollector ;) - fudspongExplorerNice to meet a fellow surfer. My first exposure to the internet was in the mid-to-late-80s at the University of Bradford (still not sure it deserves the capital letters) doing a BSc in Media Communications when I found out I could download software off another generous owner rather than buy it from source, and all it cost was a couple of days of my time in the computer lab and the loss of a girlfriend. In hindsight I should have just bought the software.
Lessons learned the hard way.
Thanks again for your efforts GM, it will take me a while to work through what you've given me. People that give freely and generously of their time and expertise are a joy to meet on forums so thank you, I hope to do the same if anyone needs assistance with interface design. - fudspongExplorerOK I finally got around to making a start on this. Because I'm an electronics n00b I went with an off-the-shelf Leo Bodnard board along with a bunch of Hall Effect sensors. As GeekMaster said above, I paid more but at least it looks like I will actually be able to do something with it. Rare Earth magnets are on order from eBay, along with other various hardware items (universal joint from a Renault car, various brackets).
First step is to build myself a cockpit (for my own personal fun) before working on my Great Idea (TM).
http://www.mycockpit.org/forums/content.php?r=88-Hall-Effects-Sensors-to-make-a-joystick
http://simhq.com/forum/ubbthreads.php/topics/2958931/Uni_joint_stick_DIY_hand_grip.html (scroll to near the bottom for a real WOW moment)
I've also been lurking on a few forums where people have been building their own 6DOF Stewart Platform using windscreen wiper motors, which also looks just about within my abilities and budget. Need to find a coder that can subtract the kinematic values from the Rift headtracker. But that plan is months away yet.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago
- 4 months ago
- 3 months ago