Hi,
Is it possible to connect a Sharp GP2D12 IR sensor to SSC-32 and read it from there? if it is possible, is there any tutorial which helps to start?
the ssc-32 has 4 analog inputs which would allow you to connect the analog output of the GP2D12 sensor and poll them from the host controller (bap, pc, arduino, whatever). these inputs are documented in the oft referred user manual. the header block referenced as 10 has the inputs and the table of contents has a link to the commands required to read those inputs.
I will comment (for lynxmotion) that the pin by pin layout for this header 10 does not appear to be clearly labeled as described in the new html version of the ssc-32 user guide. users wil have to reference the schematic or find other posts on the forum to know about the alternating 5V, GND, 5V GND on the pins opposite the ABCD inputs proper.
I will see if I can modify the on-line manual to make it more clear how to add a sharp sensor to the SSC-32.
Actually Jim and Eddie, my new born robot has a message for you:
#include <all_forums_in_innet.h>
#use rs232, usb, or any other facility you wish
the main() //point is that anyway
{
while(TRUE) //remains TRUE
{
printf("Jim and Eddie are the BEST forum supporters!!\n");
}
}
THANK YOU !!!
Well I read the link you kindly gave. Now I imagine the reading process (in arduino term) like this:
- To set up ssc-32 ABCD input pins for reading in analog mode without pullup, issue this command:
Serial.println("VA VB VC VD");
- To order a pin-reading to ssc-32, issue this command:
Serial.println("VA VB VC VD");
(and the request goes to Rx pin of ssc-32)
2. Next, I have to read the Tx pin of ssc-32, to get the answer of the request.
Questions:
- am I right with this imagination? any comment?
- well, suppose that I have 2 sharp sensors with their data lines connected to A and B on ssc-32. To read them I issue:
Serial.println("VA VB");
right?
3) After issuing the command of input pin reading, what delay should be set?
4) The manual gives an example of byte 102 and 109 as the result of “VA VB” coming from ssc-32. I suppose that the answer is an ascii one, like: “102 109”. Am I right with the format?
5) In the algorithm above, what must be the delay between steps 0 and 1, so that ssc-32 has time to convert pins to analog?
Just for improving the online manual:
here one “is” must be changed to “if”, if I’m right:
…For example is the voltage on Pin A is 2vdc and Pin B is 3.5vdc, the return value will be the bytes 102 (binary) and 179 (binary).
Thank you
I don’t know for certain if you can concatenate VA VB VC VD on the same command line… try it and see if you get 4 bytes returned or just 1.
the byte returned is a binary value, not ASCII for the value.
off hand I don’t know what if any delay is required. just try it… you could use potentiometers like the one shown in the users manual to set a known voltage and then see if the results are what was expected. Once you know you can read and display the information correctly then replace the potentiometers with sensors and yer off and running.
The value returned from the SSC-32 for each channel is binary, from 0-255, where 0 = 0vdc and 255 = 5vdc. So it sends a single binary word to represent this value. It will not look like 102 or 109. a binary representation of decimal 102 would show up on a terminal display as the lower case letter f. The 109 would be for the lower case letter m. But interpreting the value in decimal…
102 x (5/256) = the voltage (1.99vdc)
109 x (5/256) = the voltage (2.13vdc)
The delay in between replies would probably be the same for other replies. Defined as “There will be a delay of 50uS to 5mS before the response is sent.” I will ask for further clarification. Hope this helps.
Thank you Jim and Eddie, it’s now clear (theoretically) to me and I have to set up the experiments. I searched the user manual:
lynxmotion.com/images/html/build136.htm
for that potentiometers which Eddie pointed to, but could not find it. May be I’m not seeking in the right place?
You can request all 4 analog inputs at once, and the SSC-32 will return 4 bytes. So the command string
"VA VB VC VD"
will work fine.
The delay depends on the Transmit Delay register (R1), which defaults to 600 microseconds. But this is just the minimum delay value. The other thing that will affect the delay is what the SSC-32 happens to be doing at the time. The SSC-32 queues up incoming commands and processes them in between other processing it performs. If it happens to be updating the servo output pulses (for example), there might be a delay of a millisecond or so. Usually you will get a reply much closer to the Transmit Delay time. You will probably never see a delay as long as 5ms.
Thanks Mike!
Thank you Jim, I was searching the word potentiometer in the text
Thank you all, now the subject is clear to me
Hooking up a light sensor:
I was able to connect the free end of the 10K resistor to the ground pin (-). The point where the 10K and the photoresistor are connected together went to the A connection (Analog In). The free end of the photoresistor went to the +5V pin.
I then hooked a serial to usb cable up to the ssc32 and my PC. I sent “VA” & Chr(13) to the ssc32 comm port and got back the byte data. It was coming in at around 200 with the lighting in the room. Went down to about 14 with my hand covering it. Worked like a charm!
Great to hear! 8)
I’m trying to hook up four light sensors to test reading multiple sensor values and to test wiring up multiple sensors.
I have one working right now hooked up to
-
-
- A (as described above)
-
- If I hook up a second it should be + - B
- If I hook up a third I’m out of power connections since the board only has two + -
Can I share power to multiple light sensors?
Does anyone have a close-up of connecting four analog sensors to ABCD?
Using shunt jumpers you can make pin connectors to connect to external gizmos. You put the end of a wire in one side of the shunt and solder or crimp, and then slide the other side of the shunt onto the desired pin. Below shows the shunt jumper and wire, and bottom shows them in use on an ssc-32.
http://web.comporium.net/~shb/pix/jump1.jpg
http://web.comporium.net/~shb/pix/analog1.jpg
Hey now thats a great idea. There has been many times I needed a one wire connector and this would work nicely.
Got a picture of you current setup?
I have one light sensor hooked up to sensor input A. It operates the gripper based on the light reading. When the light is brighter it opens when it’s darker it closes. This was an inexpensive way to test the sensor inputs before I buy more expensive sensors. My problem is once I have the modem hooked up I don’t have any power connections left.
http://www.otherrobots.com/lynxmotion/ssc32LightSensor.jpg

Can I share power to multiple light sensors?
Yes, just bring a pair of wires off the board with ground and 5vdc, then connect the sensors to it. Best to solder wires rather than twisting them and putting electricians tape on the connection.