Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by KnightRiderGuy · Dec 14, 2014 at 11:17 PM · standaloneapplicationappusbexternal controller

Stand Alone App To Operate USB Controlled Relays

Is it possible for a stand alone Unity app to run actual physical devices via a USB controlled relay board? If so are there any tutorials, special plugins that may be needed? Any help on this greatly appreciated.

Comment
Add comment · Show 11
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Dec 15, 2014 at 08:38 PM 1
Share

I've controlled servos and motors from Unity via USB connection to an Arduino, which was relatively trivial to set up.

avatar image TSRajesh · Dec 15, 2014 at 09:09 PM 1
Share

I haven't used the Arduino.. I believe it is some "generic / all purpose" microcontroller board.. And from what you say, i gather it has a USB peripheral built in. (Does it also have a host / OTG?). If so, I would expect them to provide some driver also, for windows. Right? Then that would make things simple. Just that.. I have never tried (I don't even know what it takes) to call external "windows" device drivers in Unity..

avatar image TSRajesh · Dec 15, 2014 at 10:09 PM 1
Share

And, on simil;ar search, I found this.. https://www.youtube.com/watch?v=E$$anonymous$$AWe2d7lC0

Where we control the LED (Or relay in your case) via Serial Port / UART.

Unless you are too particular about using USB, I suggest UART. Off my head i can think of the 8051 microcontroller that could do the job. No separate device drivers.. (and the microcontroller would come to less than 4-5 US$. It used to be equivalent of $1 in india, and then add to it a crystal and a few relays, and a power supply..). And teh best part is, you don't need a separate device driver.. Unity's C# shoudl have all you need. (Again, look at the video..)

avatar image meat5000 ♦ · Dec 15, 2014 at 10:12 PM 1
Share

As long as you can send and receive data from Unity, you can set up a separate/external program to handle the USB Stream.

avatar image meat5000 ♦ · Dec 15, 2014 at 10:16 PM 1
Share

Yeah if you have a commercially viable idea... don't go spilling it all over the internet.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TSRajesh · Dec 15, 2014 at 06:03 AM

USB driver is a whole new beast. I am not sure how much of experience you have with the USB protocol / drivers.., or with embedded systems as a whole. Unless it is of the standard classes (Mass-Storage class etc..) you will find that you may want to write a special USB driver. Hooking it up with Unity is again an entirely different effort.. I am not sure what that takes. Maybe you'll have better luck with a simpler standardized interface.. something like the UART (Serial Port).

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image KnightRiderGuy · Dec 15, 2014 at 06:34 PM 0
Share

I seemed to recall that someone somewhere else had asked about this too but I can't recall where but from what I remember about the post it certainly seemed possible.

avatar image TSRajesh · Dec 15, 2014 at 08:28 PM 0
Share

Of course.. it is possible. In fact, I have done this.. a usb to parallel output, (can use to control relays) with a custom class implementation.. The Software (PC side) as well as Firmware (microcontroller with the USB peripheral controller on it) in my previous job. VC++ on the PC side.. I am not sure about integrating it into Unity though. Question.. Are you able to do it Outside of unity? If so, then you only have to worry about calling that driver from unity.. (Unity doesn't have any framework for writing device drivers). If not, it is not a trivial process..

avatar image KnightRiderGuy · Dec 15, 2014 at 09:27 PM 0
Share

Thanks, nope I have had no experience with this sort of thing myself, I do know people who are good at that type of stuff though. I just think it would be a cool idea if I could make an interactive interface for my 2 TV monitors on my $$anonymous$$night Rider 2 TV dash and actually have them turn devices on inside of the car. I already wired my switch pods unit to activate external speakers for $$anonymous$$.I.T.T.s Voice Projection unit part of which was wired into the upper console. I started creating my interface in Unity 3D because I had heard that Unity could do this.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

28 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to view 3d model fully controllable in unity 5 0 Answers

Portrait Android app? 1 Answer

mobile app crash 0 Answers

using Unity for standalone application Visual C++ 1 Answer

lighter and faster application (android) - advices 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges