Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to turn on/off a light bulb from my PC using VB

Posted on 2005-04-07
12
Medium Priority
?
3,093 Views
Last Modified: 2010-05-18
What do I need and how can I turn on/off a light bulb from my PC using VB programming?
0
Comment
Question by:wcoka
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 7

Expert Comment

by:andreba
ID: 13733749
- A microcontroller with a program to execute your required action
- A connection to your machine (usually through COM port)
- A VB application that sends the message to be interpreted by your microcontroller, which consequently will switch on your light..

:-)
0
 
LVL 5

Expert Comment

by:Rubyn
ID: 13733766
0
 

Author Comment

by:wcoka
ID: 13733772
Where can I find this microcontroller and how should I do the connection to my machine? Also where can I find an example the message that my application should send to the microcontroller?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:andreba
ID: 13733806
Sorry, we can't do homework here..
Do a bit more research on your subject..

:-)
0
 
LVL 5

Expert Comment

by:Rubyn
ID: 13734120
wcoka: For interfacing a PC with external electrical device, you need to have idea about interfacing methods and electrical device. So you need to learn many things before attempting the project.
The general idea of interfacing is activating a relay which in turn activates any electrical device.
To control the relay you need some interfacing circuit attached to your computer port. The easiest way is using your LPT port, link I posted previously. You can also use Communication port. http://www.rentron.com/PC-Remote1.htm Now,  you need to control the interfacing circuit using the port with your program.

You can ask any doubt in the process of doing the project, but dont keep any thread for multiple questions, Higher points will increase the response.
0
 
LVL 11

Expert Comment

by:bingie
ID: 13734982
You dont really need a microcontroller - You can do this from the parallel port - provided you connect a large enough triac (to dim) and relay to controll the bulb.

I just answered a question here: http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Controls/Q_21366989.html on controlling a LED with the parallel port.

Perhaps that can help you.
0
 
LVL 32

Expert Comment

by:Erick37
ID: 13736330
I think the easiest way would be to get The Clapper® and attach your light bulb to it.  Then, record a WAV file of yourself clapping twice.  To activate the light, play the sound through your VB code, adjusting the volume of speakers as needed.

See:
How To Play a Waveform (.WAV) Sound File in Visual Basic
http://support.microsoft.com/kb/q86281/

On a more serious note - you could use the X10 (home automation) modules to control just about anything from your computer.

See:
Two-Way X-10 Power Line Interface
http://www.radioshack.com/product.asp?catalog%5Fname=CTLG&category%5Fname=CTLG%5F002%5F001%5F001%5F000&product%5Fid=980%2D0197
0
 

Author Comment

by:wcoka
ID: 13744079
I'm reading this tutorial http://www.aaroncake.net/electronics/vblpt.htm but when I try to run any of the examples from here I get a VB error and I closes... do you think that it cold be because I´m runnig winXp and that dll(WIN95IO.DLL)?
0
 

Author Comment

by:wcoka
ID: 13749214
I download a Port Parallel Monitor at http://www.geekhideout.com/parmon.shtml and in one of my machines that has XP it works fine but at another I get an error message of "Privileged Instruction" any ideas why?
0
 

Author Comment

by:wcoka
ID: 13761286
Any help?
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 14402887
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month21 days, 3 hours left to enroll

810 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