Help With Sensor Circuit Design

Thread Starter

SiN

Joined Dec 18, 2007
5
Hello everyone,

I am currently trying to design a circuit which will be connected to 7 micro-switches, so that the binary inputs form the sensors can be outputted to a pc.

I would be really grateful for any help with component selection and circuit designs.

I have a basic understanding of electronics but I haven't got a clue where to start, or which components i would need. The sensors which I will be using are
Lever micro-switches.

thanks for your time. :)
 

gootee

Joined Apr 24, 2007
447
You could try searching for something like "interface OR interfacing pc parallel port schematic OR circuit", at http://www.google.com . You should be able to find exactly what you need, from that.

Note that you would need to use uppercase for the two occurrences of the word "OR", above, and should not include the double quote characters when searching (except when specifying exact phrases to match, which would need to be placed inside double quotes, in your search specification).

Also, as far as I know, you can replace the word "OR" with your keyboard's "vertical bar" character, i.e. the | character, when using Google's search engine. Note that using a space character as a word separator implies the logical "AND" operation, for the search engine. You can also try the "Advanced Search" link.

- Tom Gootee

http://www.fullnet.com/~tomg/index.html
 

SgtWookie

Joined Jul 17, 2007
22,230
Along with what Tom said...
Are you going to be writing your own software to read the status of the switches, or are you using some pre-written software package?

If the latter, you'll need to ensure that your circuit design complies with the software requirements.

If you're writing your own code, you'll need to decide whether you'll be working in the Windows or DOS environments, or perhaps something else.

If you're working under Windows, consider using a USB port.

Under DOS, you'll be limited to using RS232 or the printer port.
 

Thread Starter

SiN

Joined Dec 18, 2007
5
I tired searching google first, thats why I posted this topic as the search wasn't very helpful in explaining the reason for using the selected componets. I found this site: http://www.technologystudent.com/pics/pic3a.htm but i would like to understand its operation better and how do you know which components to use?

In reply to SgtWookie, the pcb readings will be connected using a GUI in windows.

thanks your help guys. :)
 

CorruptDB

Joined Dec 15, 2007
6
Check this page, under the "Reading Data From The Parallel Port" section there is a schematic for simple switches connected to the parallel port. However, IIRC the parallel port only has 5 lines available for input, if you need to read 7 switches you will need some way to switch between different inputs.
 

BlackBox

Joined Apr 22, 2007
20
I would suggest using a Microchip PIC to read the status of the switches, packet the data and send it over RS232, or even USB if you get one of the newer PIC18. Easy interfacing and easy programming :)
 

beenthere

Joined Apr 20, 2004
15,819
It should be possible to arrange an octal latch and another gate to originate a latch signal. That would preserve the changed state of the switches and could also send an interrupt to the processor. That would relieve the processor the overhead of running a polling loop.
 

SgtWookie

Joined Jul 17, 2007
22,230
Yes, what Blackbox said. You'll pick up some PIC programming experience along the way, which will come in very handy for future projects. Since you're in the GUI environment, USB is the way to go. Trying to interface with the parallel port can be risky (it's very easy to blow the port) and BIOS settings can be problematic. But with the USB-ready PIC 18 series, most everything is already handled for you.
 

Innocent1

Joined Dec 22, 2007
1
Along with what Tom said...
Are you going to be writing your own software to read the status of the switches, or are you using some pre-written software package?

If the latter, you'll need to ensure that your circuit design complies with the software requirements.

If you're writing your own code, you'll need to decide whether you'll be working in the Windows or DOS environments, or perhaps something else.

If you're working under Windows, consider using a USB port.

Under DOS, you'll be limited to using RS232 or the printer port.
 

Thread Starter

SiN

Joined Dec 18, 2007
5
a friend will be writing the code for reading the status and also building the gui, it will also be tested using labview.

As im still new to electronics (very new) im not sure how to work out what else I will need inorder for my pcb to work.

What I mean by this is I no that I will have 7 micro switches connected as inputs and a usb connected to the pc for the binary outputs, but as for the middle connections im clueless! :confused:

Please could I get help in working out what other components I will need, such as the power supply voltage and resistors? also an explanation on how these were worked out would go a long way for me understanding it all.

This would be a massif help for me understanding electronics and circuit design. Any help is much appreciated. :)
 

nanovate

Joined May 7, 2007
666
Here is a link to the STK500 User Guide. On page 3-2 is a schematic of their switch interface.

http://atmel.com/dyn/resources/prod_documents/doc1925.pdf

This kit might also work for you application. The full function gcc C-compiler WinAVR, is free. The kit is about $80. It has RS232, 8 switches and 8 LEDS. If you need USB support Atmel has the AT90USB series of chips. They have the AVR core and USB built-in.

The power supply would be 5V. In the above configuration the input pin is normally pulled to logic '1' or high. When the switch is pressed the input is pulled low to ground or logic '0'. If you relocate the switch (switch the 10K resistor and the switch) you can reverse this so that it is normally logic '0' and logic '1' when the switch is pressed.

Next I'd look up "debounce" for switches -- both software and hardware.

Other micros:
Silabs also has similar USB devices in the 8052 flavor.
PIC also has a PIC18 w/USB.
 
Top