SB72 + Photoelectric Sensor

Discussion to talk about hardware related topics only.
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: SB72 + Photoelectric Sensor

Post by v8dave »

Hi Chris,

I am not familiar with that platform but looking at the datasheet there are 4 IO pins available for you to use. It is explained in this document on the Netburner website complete with code sample on it's use.

SB72 GPIO Configuration

The IO is on PC0 to PC3.

These should work just fine for what you want to do but you will need to poll the input a these don't have any interrupt capability.

Cheers,
Dave...
chrishardy99
Posts: 7
Joined: Wed Sep 01, 2010 5:43 pm

Re: SB72 + Photoelectric Sensor

Post by chrishardy99 »

Connector a resistor from the GPIO pin to +3.3V and it will work.
Any thoughts on what I could use as the 3.3V power source here? I'm supplying 5v to the SB72 board, would there be some point on the board that I could assume has a regulated 3.3V power source? Or would it be better to set up a separate one?
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: SB72 + Photoelectric Sensor

Post by v8dave »

Hi Chris,

That's a very good point. There is no reference to 3.3V being available on the board IO connections so you will likely have to use an external 3.3V regulator to do this unless someone from Netburner can offer a solution?

The only reference is to +5V being available and I don't see the IO being 5V tolerant so I would not connect that to the resistor.

Cheers,
Dave...
chrishardy99
Posts: 7
Joined: Wed Sep 01, 2010 5:43 pm

Re: SB72 + Photoelectric Sensor

Post by chrishardy99 »

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.
Hi,

So I gathered the components and set up a 3.3V power source on a breadboard and started playing. I connected things as per the above instructions, but I can't get the input to go high.

While the switch to ground is open, If I connect the GPIO pin directly to the 3.3v source it will go high (I can verify in the NB debugger) but if I connect it after a 10k resistor it wont. Any thoughts on what am I missing?

Thanks again,

Chris
chrishardy99
Posts: 7
Joined: Wed Sep 01, 2010 5:43 pm

Re: SB72 + Photoelectric Sensor

Post by chrishardy99 »

Oops.. software error. Didn't set the GPIO for Input. This is working as it should now.. thanks everyone for all the help. Especiallly Dave!
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: SB72 + Photoelectric Sensor

Post by v8dave »

Glad to see you got it going. Is quite satisfying when it just works isn't it?

Good luck with the rest of the project.

Dave...
Post Reply