optocoupler output to microcontroller

Status
Not open for further replies.

Kick

Full Member level 6
Joined
Sep 27, 2010
Messages
345
Helped
16
Reputation
32
Reaction score
15
Trophy points
1,298
Location
India,Bangalore
Visit site
Activity points
3,178
hii all,
Can I connect optocoupler output to any i/o pin of uC? or shall I connect it to INT(interrupt) pin?
 

You can connect the optocoupler output in any I/O pin and also in interrupt pin.

Main thing is how to read the optocoupler. Or interruppt,

That is you can only deside depending upon your project.
 

thanks for your reply.

I don't have idea about how to read optocoupler(I hope it's programing part). My part is hardware, so if i connect to any i/o pin it will work right??
 

Hi,

so if i connect to any i/o pin it will work right

if you connect it right it will work.

*************
Why do you need the optocoupler signal? What is it for?
The answer to this tells you if you should connect it to a port pin, an INT pin, a counter clock input, a capture input...
We can not give you the answer.

About the voltage levels:
We don´t know the ucontroller supply voltage and the max pin input voltage and the same is with the optocoupler.
some optocoupler outputs are pushpull, the other are OC and maybe need a pullup.
Also here we don´t know what optocoupler you use, and therefore we can not give you the answer.

Klaus
 

hii,

thanks KlausST

I am going to do below attached circuit. In this I will replace uC with any other BLE IC (most probably CC2541 or CSR1010) and power supply for uC will be 3V. I hope now you got an idea about my project.

thanks.
 

Attachments

  • dimmer chematic.DSN.pdf
    17.8 KB · Views: 112

Hi,

with the circuit all seems OK. The optocoupler is the zero cross detect. The controller nedds to react fast on this.
For this an interrut is the way to go.

Circuit:
The optocoupler has OC output
with pullup
it is fed to the INT input.


in software on rising edge of INT you should clear the counter. (you could also use falling edge but then you have less time to react)
program the compare register with your desired value (only when you want to change brightness). the higher the value the bigger the delay the less brightness.

Klaus
 
Reactions: Kick

    Kick

    Points: 2
    Helpful Answer Positive Rating
thanks for your great reply KlausST.

- - - Updated - - -

and can I use CC2541 or CSR1010 BLE ic instead of this atmega ??
 

I have posted the datasheet of both IC's.
 

Attachments

  • cc2541.pdf
    970.3 KB · Views: 102
  • CSR1010 Data Sheet CS-231985-DS.pdf
    470.6 KB · Views: 123

Hi,

sorry, i don´t have enough time to go through the documents.

Please look for "operating input voltage levels" and "interrupt capabilities".


Klaus
 
Reactions: Kick

    Kick

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…