Info gathered from other threads for one stop shopping.
Brown +
Blue -
White (sig) to digital side car
Black nothing
If the Sensor is Green: Sensor is powered but does not sense reflection. no output on blk or wht.
If sensor is Orange: ON sensor is recieving at least 2.5 times the signal strength needed to trigger an output and green will turn off. May have to adjust the sensitivity adjustment on top of the sensor to get an orange on if already mounted. Do this by placing over reflective surface and adjust until it comes on. Sensitivity is the screw on top. If orange is not on there will be no output on blk or wht.
If sensor is Yellow: the output has been energized meaning it sensed a reflective object. be careful most bright objects can be sensed regardless of color.
Typical sensor indication is the following
Green ON, Orange OFF, Yellow OFF over dull none reflective surface wht low and blk high
Green OFF, Orange ON and Yellow ON over bright reflective surface wht high and blk low
If you have a flashing LEDs, the sensor has gone in to short circuit protection mode becasue one of the outputs is shorted to ground or it is not wired up correctly. Make sure the black wire is not connected ianything. Make sure the white is connected to the signal pin on the digital side car pwm input and not the + or -. Best way to prevent the shorting out of the black wire is to clip the stripped wire and then wrap it with electrical tape. Inspect the sensor cable for any nicks. I will try and post a quick video by the end of today to show how it works and how to connect it.
Hey do you have or know where I can get a working Java code for the Photoswitches? I have 3 of them connected to the DIO. I dont mind switching my hardware configuration to be compatible with yours if it is not already.
Narcisse- 1340
I would start out by making a handwritten flow chart saying what you want it to do when each sensor is triggered. For example, when the left sensor is triggered, make it go right, and when the right sensor is triggered, go left. When neither are triggered, go straight.
Just use nested case statements and use the DIO ins to be the input for the case statements
Thanks for replying, should i control motor inside the nested loop or change the value for x or y inside the loop ? which will be sufficient enough and how do i know tht i have reached the “Y” part, i just started the programming … ?
thanks for your help, will lwt you know if i have any problems … thanks
I do have one problem with your code however. You need to open everything up in your begin.vi or you are going to run into a lot of problems. Also make sure you close everything in your final.vi
Just a couple additional notes, since I’m an electrical engineering student and happened to be wiring the sensor up today.
The sensor acts like a switch that closes when it sees a white object. It’s using transistors inside rather than a mechanical switch, but as far as the wiring is concerned it acts just like a limit switch (except that it needs +12V power). Like a limit switch, it has a “normally open” and “normally closed” output; one output will be high when it sees a light object, the other will be high when it sees a dark object. Look at the sensor datasheet for all the gory details.
The digital sidecar has built-in pullup resistors, which means that unless you connect the GPIO pin to ground, it will have a value of 5V. This means you don’t need any additional circuitry to hook up the photoswitches. See the Digital Sidecar datasheet for more information.
The attached schematic tries to show the whole picture. Note that you could just as easily connect the black wire to the GPIO pin, it’s just a matter of whether you get a “1” for dark or a “1” for light. (My apologies if I mixed up LO and DO on the schematic. Let me know and I’ll fix it.)
The part number is 42EF-D1MNAK-A(2). The 2 isn’t given, but it’s apparently part of the number based on Rockwell’s part selection tool. If you haven’t found it already, a CAD model (STEP) is available on Rockwell’s site.
To those wondering how you program these things: it’s a switch - a digital input - a 1 or a 0. Once you calibrate it, it will have one value when it’s over the carpet and the other value when it’s over the tape. All you have to do is read the sensor value to determine if you’re on the tape or not.
If you have questions about how to follow a line, look at this white paper from NI, or ask an FLL student.
We have hooked the photoswitch up to the power distribution board and to the signal pin on the DSC, but we only recieve “true” when we use the DigitalInput get() method, no matter what surface the photoswitch is directed at. Any help would be greatly appreciated.
I found that initializing Victors (doesn’t matter if they are really there or not) solved my problem. The DB37 cable apparently needs to send more power and this is only possible by creating more “sensors” in the DSC
But before you do that, do your lights change color? Green when it sees nothing and orange and yellow when it does?
Ack! You need to make sure that you are properly supplying battery power to the Digital Sidecar’s small white Wago power connector. The power should come from a 20 Amp circuit on the Power Distribution board.
What did you use to connect the white sensor wire to connect the photoswitch to the I/O on the digital sidecar?
Sorry for posting such a basic question on a month old thread, but any help would be greatly appreciated. :o