To do this, we need a Potentiometer (or “Pot”) as shown in the diagram from the SSC-32 manual.
A potentiometer is basically an adjustable resistor, so the as you turn the dial on it, the resistance acting on the electricity moving through it increases or decreases.
We used the ohmeter to check the resistance of the pot by measuring across the two outside connectors. The meter showed that this was a 25K ohm pot and when we adjusted it, the reading didn't change, confirming we had the correct leads.
We then tried reading the resistance across the center and outside leads and found it varied as we turned the handle.
We then connected up the three leads of the pot to the “+” (5 volts), “-” (ground) and “A” (the first analog input) pins of the SSC-32 card using the breadboard. We also connected leads to the “A” and “-” pins so that we could monitor the voltage being given to the “A” input as we adjusted the potentiometer. The connections are shown below:
With the pot adjusted to 5 Volts we used the terminal program to send a “VA” command to check the value of the “A” input which came back with “FF” or 255 in decimal. Note that the first 3 bytes (56 41 0D) are the “V”, “A” and carriage return we typed in.
Note that the initial “VA” command did not give the correct value because one dummy command at the beginning is required to change the input from digital to analog mode. We then adjusted the pot to 0 Volts and tried the command again:
This time the response was “00” or 0 decimal.
We then calculated what the response should be if the voltage was set to 3 volts:
If measuring the value correctly, the response to the “VA” command should be 3 volt/ 5 volt * 255 or 153 decimal which is “99” in hex. When we tried it we got the correct result!
We also tested the other 4 inputs pins by tying them to either Ground or 5V. They can all be queried at the same time using the “VA VB VC VD” command which returns 4 bytes instead of 1.
Now that we know they work, we can connect the compound eye to these inputs. The eye is actually connects to 4 input pins, one for each direction around it(up, down, left, right). It also has two other pins, one to power the receivers, and one to power the emitters.
We then tried reading the resistance across the center and outside leads and found it varied as we turned the handle.
We then connected up the three leads of the pot to the “+” (5 volts), “-” (ground) and “A” (the first analog input) pins of the SSC-32 card using the breadboard. We also connected leads to the “A” and “-” pins so that we could monitor the voltage being given to the “A” input as we adjusted the potentiometer. The connections are shown below:
With the pot adjusted to 5 Volts we used the terminal program to send a “VA” command to check the value of the “A” input which came back with “FF” or 255 in decimal. Note that the first 3 bytes (56 41 0D) are the “V”, “A” and carriage return we typed in.
Note that the initial “VA” command did not give the correct value because one dummy command at the beginning is required to change the input from digital to analog mode. We then adjusted the pot to 0 Volts and tried the command again:
This time the response was “00” or 0 decimal.
We then calculated what the response should be if the voltage was set to 3 volts:
If measuring the value correctly, the response to the “VA” command should be 3 volt/ 5 volt * 255 or 153 decimal which is “99” in hex. When we tried it we got the correct result!
We also tested the other 4 inputs pins by tying them to either Ground or 5V. They can all be queried at the same time using the “VA VB VC VD” command which returns 4 bytes instead of 1.
Now that we know they work, we can connect the compound eye to these inputs. The eye is actually connects to 4 input pins, one for each direction around it(up, down, left, right). It also has two other pins, one to power the receivers, and one to power the emitters.
No comments:
Post a Comment