Go Back   Pro/Forums > ProCooling Geek Bits > Random Nonsense / Geek Stuff
Password
Register FAQ Members List Calendar Chat

Random Nonsense / Geek Stuff All those random tech ramblings you can't fit anywhere else!

Reply
Thread Tools
Unread 09-06-2003, 12:59 PM   #1
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default computer thing

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
the master is offline   Reply With Quote
Unread 09-06-2003, 03:45 PM   #2
airspirit
Been /.'d... have you?
 
airspirit's Avatar
 
Join Date: Jul 2002
Location: Moscow, ID
Posts: 1,986
Default

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
airspirit is offline   Reply With Quote
Unread 09-06-2003, 06:31 PM   #3
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default

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
the master is offline   Reply With Quote
Unread 09-06-2003, 06:45 PM   #4
joemac
Cooling Savant
 
joemac's Avatar
 
Join Date: Dec 2002
Location: Dallas
Posts: 339
Default

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.
joemac is offline   Reply With Quote
Unread 09-06-2003, 08:07 PM   #5
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default

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
the master is offline   Reply With Quote
Unread 09-06-2003, 08:30 PM   #6
bigben2k
Responsible for 2%
of all the posts here.
 
bigben2k's Avatar
 
Join Date: May 2002
Location: Texas, U.S.A.
Posts: 8,302
Default

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.
bigben2k is offline   Reply With Quote
Unread 09-06-2003, 08:42 PM   #7
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default

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
the master is offline   Reply With Quote
Unread 09-06-2003, 09:27 PM   #8
joemac
Cooling Savant
 
joemac's Avatar
 
Join Date: Dec 2002
Location: Dallas
Posts: 339
Default

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).
joemac is offline   Reply With Quote
Unread 09-07-2003, 12:56 AM   #9
bigben2k
Responsible for 2%
of all the posts here.
 
bigben2k's Avatar
 
Join Date: May 2002
Location: Texas, U.S.A.
Posts: 8,302
Default

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.
bigben2k is offline   Reply With Quote
Unread 09-07-2003, 07:17 AM   #10
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default

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
the master is offline   Reply With Quote
Unread 09-07-2003, 09:21 AM   #11
bigben2k
Responsible for 2%
of all the posts here.
 
bigben2k's Avatar
 
Join Date: May 2002
Location: Texas, U.S.A.
Posts: 8,302
Default

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.
bigben2k is offline   Reply With Quote
Unread 09-07-2003, 11:20 AM   #12
iceheart
Cooling Savant
 
iceheart's Avatar
 
Join Date: Mar 2001
Location: Yonder
Posts: 318
Default

I don't have anything to add to this discussion, but please lay of the question marks a bit. It's hurting my eyes .
iceheart is offline   Reply With Quote
Unread 09-07-2003, 09:18 PM   #13
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default

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
the master is offline   Reply With Quote
Unread 09-07-2003, 09:35 PM   #14
joemac
Cooling Savant
 
joemac's Avatar
 
Join Date: Dec 2002
Location: Dallas
Posts: 339
Default

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?
joemac is offline   Reply With Quote
Unread 09-08-2003, 02:15 AM   #15
the master
Cooling Neophyte
 
the master's Avatar
 
Join Date: Sep 2003
Location: moonbase alfa
Posts: 7
Default

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
the master is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 07:48 PM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
(C) 2005 ProCooling.com
If we in some way offend you, insult you or your people, screw your mom, beat up your dad, or poop on your porch... we're sorry... we were probably really drunk...
Oh and dont steal our content bitches! Don't give us a reason to pee in your open car window this summer...