SB72 + Photoelectric Sensor
-
- Posts: 7
- Joined: Wed Sep 01, 2010 5:43 pm
SB72 + Photoelectric Sensor
I'm very new to all of this, and I was wondering if I could get some information about the best way to connect a photo eye to an SB72 board. I see that there are 4 available GPIO pins - what would be involved in using these? Is there a better way? Any help or guidance would be massively appreciated!
Re: SB72 + Photoelectric Sensor
Hi Chris,
It all depends on the electrical output of the photo electric eye. Can you provide a link to the datasheet and we can then offer you some ideas?
If the output is a simple switched output, then you can simply read it on the GPIO port after converting it electrically to the input requirements of the SB72. Most types of devices like this switch to GND when active but until we see the information this is just a guess.
Dave...
It all depends on the electrical output of the photo electric eye. Can you provide a link to the datasheet and we can then offer you some ideas?
If the output is a simple switched output, then you can simply read it on the GPIO port after converting it electrically to the input requirements of the SB72. Most types of devices like this switch to GND when active but until we see the information this is just a guess.
Dave...
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: SB72 + Photoelectric Sensor
I agree w/ Dave: the interface to the NB depends on the sensor. The most common error in connecting devices to NB modules is a voltage mis-match. The voltage must stay between a 3.3V maximum, and a 0V minimum. There are many opto sensors available meeting this requirement.
- Chris Ruff
- Posts: 222
- Joined: Thu Apr 24, 2008 4:09 pm
- Location: topsail island, nc
- Contact:
Re: SB72 + Photoelectric Sensor
I think this is too early of a question.
The first question should be "what light sensing do I need? proportional? on-off? analog with a threshold?
Once that question is answered one would choose the opto device. The opto device will then point to what kind of hardware interface.
One way to handle this is to use a simple opto-transistor biased by say 30k to 3.3volts. buffer the output of the opto collector with an op-amp and drive a resistor array->four wide comparator to drive the 4 signals and give you 16 steps of sensed light.
or use one op amp to buffer and another to act like a comparator with a pot to generate the on-off signal for one of the GPIO lines
or use an external A->D chip connected to QSPI to get high resolution
Things like that..
Chris
The first question should be "what light sensing do I need? proportional? on-off? analog with a threshold?
Once that question is answered one would choose the opto device. The opto device will then point to what kind of hardware interface.
One way to handle this is to use a simple opto-transistor biased by say 30k to 3.3volts. buffer the output of the opto collector with an op-amp and drive a resistor array->four wide comparator to drive the 4 signals and give you 16 steps of sensed light.
or use one op amp to buffer and another to act like a comparator with a pot to generate the on-off signal for one of the GPIO lines
or use an external A->D chip connected to QSPI to get high resolution
Things like that..
Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
Re: SB72 + Photoelectric Sensor
It would be interesting to know if Chris already has a photo eye in question or simply asking how to do it generally?
Knowing if he has some particular hardware would allow us to offer a solution, assuming he is not an electronics engineer and purely software.
Chris Ruff has some good ideas for this.
Care to give us some more info Chris (1)?
Dave...
Knowing if he has some particular hardware would allow us to offer a solution, assuming he is not an electronics engineer and purely software.
Chris Ruff has some good ideas for this.
Care to give us some more info Chris (1)?
Dave...
-
- Posts: 7
- Joined: Wed Sep 01, 2010 5:43 pm
Re: SB72 + Photoelectric Sensor
Thanks all for your input so far! I now have a photo eye sitting on my desk, it is an Omron e3z-t61, which I believe will switch to ground:
http://www.omron247.com/doc/pdfcatal.ns ... 3Z1204.pdf
To set the IO signal, could I draw 5v from the same power supply I'm using for the SB72, get it down to 3.3v with a voltage regulator like:
http://www.sparkfun.com/commerce/produc ... cts_id=526 ?
Seeing as I'm using a sinking PE, I'll need to have some sort of pull-up resistor in my circuit too right?
Please remember all this is new to me (I'm a software guy), so I'm still getting my head around all the lingo and how things like electricity actually work!
You all rock, btw. Thanks again for your help!
http://www.omron247.com/doc/pdfcatal.ns ... 3Z1204.pdf
To set the IO signal, could I draw 5v from the same power supply I'm using for the SB72, get it down to 3.3v with a voltage regulator like:
http://www.sparkfun.com/commerce/produc ... cts_id=526 ?
Seeing as I'm using a sinking PE, I'll need to have some sort of pull-up resistor in my circuit too right?
Please remember all this is new to me (I'm a software guy), so I'm still getting my head around all the lingo and how things like electricity actually work!
You all rock, btw. Thanks again for your help!
-
- Posts: 7
- Joined: Wed Sep 01, 2010 5:43 pm
Re: SB72 + Photoelectric Sensor
Oh also, to answer Chris R's question, I just need on/off sensing.
Re: SB72 + Photoelectric Sensor
Hi Chris,
You don't need any voltage regulator with this. Simply connect the supply to the device as per the specifications, 12-24V as shown in the drawing on page 6 of the data sheet. Connect GND to the GND of your Netburner and the output to your GPIO pin. Connector a resistor from the GPIO pin to +3.3V and it will work. Something like 4K7 or 10K will be fine as I assume your switching speed will be low.
If you need to use a separate power supply to power the sensor, make sure you connect the GND of this supply to the GND of the Netburner supply so that there is a common reference.
The output form this device is known as OPEN COLLECTOR which means it is not connected internally to anything and needs a pullup resisitor to make it go high.
Regards
Dave...
You don't need any voltage regulator with this. Simply connect the supply to the device as per the specifications, 12-24V as shown in the drawing on page 6 of the data sheet. Connect GND to the GND of your Netburner and the output to your GPIO pin. Connector a resistor from the GPIO pin to +3.3V and it will work. Something like 4K7 or 10K will be fine as I assume your switching speed will be low.
If you need to use a separate power supply to power the sensor, make sure you connect the GND of this supply to the GND of the Netburner supply so that there is a common reference.
The output form this device is known as OPEN COLLECTOR which means it is not connected internally to anything and needs a pullup resisitor to make it go high.
Regards
Dave...
-
- Posts: 513
- Joined: Sat Apr 26, 2008 7:14 am
Re: SB72 + Photoelectric Sensor
Depending on the application, you might try one of the many variants of the Sharp GP1U style sensors, E.G. http://search.digikey.com/scripts/DkSea ... 25-1994-ND with datasheet at http://media.digikey.com/pdf/Data%20She ... nt_id=5042that work between 2.4 and 3.6V, ie directly off the NB 3.3V supply. The output of the GP1U device could either be directly connected to one of the EPORT inputs and read via polling or IRQ, or could be input into one of the timer inputs if yopu cared how long the input was active or inactive. Depending on the exact GP1U device, they detect light from an LED modulated at frequencies from ~30-58Khz that you could probably direct drive from a timer pin at the appropriate frequency. The LED and GP1U device should cost a total of less than $2 in singles.
-
- Posts: 7
- Joined: Wed Sep 01, 2010 5:43 pm
Re: SB72 + Photoelectric Sensor
Hi Dave, thanks for your comments- is there a pin or something on the SB72 that I can use for the +3.3V?
Cheers, Chris
Cheers, Chris