Author Topic: Low logic switching question  (Read 2779 times)

0 Members and 1 Guest are viewing this topic.

Offline Electron_1Topic starter

  • Contributor
  • Posts: 18
Low logic switching question
« on: March 31, 2015, 07:51:59 pm »
Hi guys,
Just wondering if somebody could point me in a good direction. I am making an opto-isolated breakout board for the limit switches on my CNC machine and am breadboarding it at the moment.
When I trip the limit switch the logic (3.3v) goes low. I have a separate 5v supply on the board which is powering an LED. I was wondering what the simplest way to activate this circuit might be ?
Basically what I'm trying to achieve is that when my 3.3v goes to 0v my 5v circuit switches on and lights a warning LED and when my 3.3v is at 3.3v my 5v is off. I could use an IC but I presume there is an easier way ?
Many Thanks.   
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 3076
  • Country: au
Re: Low logic switching question
« Reply #1 on: March 31, 2015, 11:00:49 pm »
You could use an NPN transistor e.g. BC547, connect the emitter to ground a 1k resistor to base as input(from 3.3v logic), and a 1k connected between collector and +5v. It will give a low output when the input is HIGH and a +5v output when the input is LOW.
 

Offline Electron_1Topic starter

  • Contributor
  • Posts: 18
Re: Low logic switching question
« Reply #2 on: April 01, 2015, 07:02:40 pm »
Hi. Thanks for your answer.
I've just been playing around with this configuration on a breadboard and have some problems.
The only transistor I have here is a ULN2803 darlington array. In theory everything works out fine. I connected everything as suggested and when I trip my limit switch my 3.3v logic goes low and my 5v goes high activating the LED and also informing the CNC software that a switch has been triggered and to kill all activity. However when I deactivate my limit switch (it's an inductor switch) my 5v goes low and my 3.3v goes high. However it only goes to 1.7v instead of 3.3v. Unfortunately this is not enough for the software and so it thinks the switch is still triggered. I presume I'm dealing with a voltage drop across the ULN2008 and am wondering how to combat this ? I'd really like to make it work with this chip if possible, as it's quite difficult to get parts where I live and can sometime take me weeks to access new components.
Again any help is appreciated.   
 

Offline Electron_1Topic starter

  • Contributor
  • Posts: 18
Re: Low logic switching question
« Reply #3 on: April 03, 2015, 06:41:16 pm »
Hi guys,
Would love if someone could guide me. I'm having a hard time trying to figure out where I'm going wrong.
Have used the method moffy described above (thank you moffy) but I can't really get my head around whats happening.
I've tried this with both a ULN2803 and a 2N3904BU. My 3.3v logic is coming from the output of a 4N25 opto-isolator.
I've fed this through a 1k resistor to base, my emitter to ground and my + 5v through a 1k resistor to the collector. Both chips are exhibiting similar characteristics.
Basically my 3.3v is returning to around 1.7v in the case of the ULN2803 and about 1.5v in the case of the 2N3904BU.
This means that my software cannot deactivate the limits as it is not reading 3.3v.
I'm sure I'm doing something simple incorrectly ?   
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->