![]() | ||
|
|
Random Nonsense / Geek Stuff All those random tech ramblings you can't fit anywhere else! |
![]() |
Thread Tools |
![]() |
#1 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
hi, is there a way to connect something to my computer so i can link about 50 bulbs to it and control them using visual basic
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
#2 |
Been /.'d... have you?
Join Date: Jul 2002
Location: Moscow, ID
Posts: 1,986
|
![]()
Yeah, but you'll have to design the controller. I hope you're good at electronics.
__________________
#!/bin/sh {who;} {last;} {pause;} {grep;} {touch;} {unzip;} mount /dev/girl -t {wet;} {fsck;} {fsck;} {fsck;} {fsck;} echo yes yes yes {yes;} umount {/dev/girl;zip;} rm -rf {wet.spot;} {sleep;} finger: permission denied |
![]() |
![]() |
![]() |
#3 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
im fairly good at electronics, ive been doing electronics stuff since i was 2 and im 15 now so i have 13 years experience and i have all the tachers at my school that could help me.
do you have any circuit diagrams or anything??
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
#4 |
Cooling Savant
Join Date: Dec 2002
Location: Dallas
Posts: 339
|
![]()
Make a circuit that uses the parallel port to control the bulbs. Do a search on the net you should find plenty of schematics. This was one of my favorite projects in school but instead of controlling light bulbs I build a controller to control motors.
![]() |
![]() |
![]() |
![]() |
#5 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
ok, does anyone have any information on expanders, or even know what they are?????
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
#6 |
Responsible for 2%
of all the posts here. Join Date: May 2002
Location: Texas, U.S.A.
Posts: 8,302
|
![]()
Do you mean a multiplexer?
I almost built one myself, at your age. The circuit was originally designed to control scale railroad models, specifically, the track switches. The idea is that you send out a code, which corresponds to the switch number, and that effectively turns it in the opposite state that it was (i.e. ON to Off, and reverse). Since then, I've been more interested in LED displays, but that light show project has always been something I've wanted to experiment with. |
![]() |
![]() |
![]() |
#7 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
it only changes the state????????
what if i want to tell it to switch off and its already off??????? i could ive with it but it would be verry confusing how do i get 50 outputs from my pc then and how would i go about controling them with visual basic?????????
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
#8 |
Cooling Savant
Join Date: Dec 2002
Location: Dallas
Posts: 339
|
![]()
The standard parallel port has only eight pins for data (one for each bit). This does not mean you can only control eight items (by changing state of 1 or 0 aka on or off). I don’t know of a simple 8-bit BCD (binary coded decimal) to decimal converter. Any way an 8-bit port can address 255 items (in your case 255 light bulbs).
|
![]() |
![]() |
![]() |
#9 |
Responsible for 2%
of all the posts here. Join Date: May 2002
Location: Texas, U.S.A.
Posts: 8,302
|
![]()
With some good programming, you shouldn't need to know if it's on or off: you should already know that.
![]() The 8 bits are used as addresses. Example: First light bulb: 0000 0001 2nd: 0000 0010 3rd: 0000 0011 ... These zeros and 1's are binary "codes" that you can send out through the parallel port (or serial, or USB, or whatever you see fit). The way you know how many you can address, is by taking the value "2" (# of possible values for each digit) to the power of the number of bits (digit), so 2 to the power of 8, is 256. If you want more, you can cascade the data into two bytes, where the first specifies which submodule to address, and the second byte is the actual address, within that module. Then you'd have up to 256 possible "bulbs", for each 256 sub module address, so 65536 "bulbs". Of course there are much more practical ways to address that many "bulbs". If you want to control 50 outputs, then you'd need at least 6 bits (i.e. two bits remain unused). You'd then need to figure out what type of interface you want to use, and get a module for VB to access that port. If you do need to know the actual status (i.e. is it on or off) then you'd be better off dropping the parallel port, and go with a serial one, because it's easy to have data come back and forth. Parallel ports can do it, but you're talking about a bi-directional port, and it's nowhere near as common as what you can do with a standard RS-232 (serial) port. If you want a challenge, do it through USB. If you're feeling a little nut, go through the Firewire port. |
![]() |
![]() |
![]() |
#10 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
i dont know about usb and that, it sound a bit too complicated, yes i did want a challenge but not that big,
right, if i understand you correctly, i send the binary value of 00000001 then that would switch the first bulb on, then if i send the value 00000000, does that mean that nothing will happen?? and if i send the value 00000001 again, that would switch the first bulb off????? is that right????? what if i give it that value and i forget to change it back to 00000000??? will that light keep flashing like mad???? what i i want to switch 2 lights on at the same time?? would i have to switch them on one after the other but verry quickly? can the chip do that quick enough, like if i send 2 different values, is there not a chance that it would ignore the first if the second comes in too quick??
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
#11 |
Responsible for 2%
of all the posts here. Join Date: May 2002
Location: Texas, U.S.A.
Posts: 8,302
|
![]()
You're on the right track.
0000 0000 is usually your first address, so that would be your first bulb. Alternatively, you could rig it so that 0000 0000 turns everything on or off. The speed depends on the weakest link which, in this case, would be the serial interface. At 9600 baud, you could issue 120 commands per second. You can go faster. The RS-232 protocol is pretty solid: the odds of a communication problem are usually because of poor wiring. Note that the max cable length (spec) is 50 feet. If you run it longer, then the data rate drops (no signal integrity). I've seen 2400 baud over 1/4 mile of CAT3 cabling. ![]() |
![]() |
![]() |
![]() |
#12 |
Cooling Savant
Join Date: Mar 2001
Location: Yonder
Posts: 318
|
![]()
I don't have anything to add to this discussion, but please lay of the question marks a bit. It's hurting my eyes
![]() |
![]() |
![]() |
![]() |
#13 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
ok, ill stop with all the question maks, at this point id like to ask everyone to let me know straight away if there is anything in any of my posts that you dont like.
so, about this interface or whatever, i can write a program that will control 8 LEDs through the parallel port, i can have any combination i want. now lets say that 00000001 works light1, if i switch output 8 on from my computer, i will get that, what do i do next, do i have to switch output 8 off again before i can do the next command? what if i want light3 to light up, i would give the value 00000011, but, my program can only switch one output on at a time, so if i wanted to get that value i would have to do something like this call switch out8=on call switch out7=on you would then have 2 outputs on, the thing is, there is a milisecond or so between them both switching on, this means that it would light 1 and 2 up and not 3
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
#14 |
Cooling Savant
Join Date: Dec 2002
Location: Dallas
Posts: 339
|
![]()
Lets say you use the command output 378, 0
This tells the computer to send the address 378 the data 0. Since the parallel port is an 8 bit port the computer will set the bits as 0000 0000. Now lets say you sent the port the value “1” the port would change to 0000 0001. If you then sent the data 0 to the port the port would change back to 0000 0000. This is why I would recommend making data value “0” all off. What you really need to do first is design the hardware that will control the bulbs. Decide what value will control what bulb e.g “1” or 0000 0001 input will control bulb number 1. Think about it this way in electronic designing what comes first the hardware or the software? |
![]() |
![]() |
![]() |
#15 |
Cooling Neophyte
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
|
![]()
right, i think i understand that but where does 378 come from?
am i right in saying that what im really doing is creating a circuit that will switch one of 255 light buls on depending on the combination of the 8 inputs (from computer), then instead of connecting it straigh to the light bulb, you put some sort of latching circuit on it, is that basicly what im doing?
__________________
"That which seems simple is often overlooked" ~ Me "It's nice to be important but its more important to be nice" ~ Scooter |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|