Go Down

Topic: Optical IR sensor open or close (Read 245 times) previous topic - next topic

ART50317

I'm assuming slotted optical sensor is always on until something blocks or come in between them.
Could someone confirm that?

groundFungus

#1
Dec 04, 2018, 03:49 am Last Edit: Dec 04, 2018, 03:53 am by groundFungus
If the output is an open collector NPN photo transistor (very common) that is pulled up, then yes.  The best thing is to examine the optocoupler data sheet to know how the particular device reacts.

ART50317

Man I was looking for this thread. Thought I supposed to get notify when there's reply.

Any way,  since push button always off, could I replace it with optical ir (interrupter)? How would I make it trigger output only when interrupted or something blocks the slotted?

groundFungus

Quote
Any way,  since push button always off, could I replace it with optical ir (interrupter)?
I can't see what you see so how can I answer that question?  What switch, what circuit?  Can you post a schematic?

Post the part number or a data sheet for the opto-interrupter and I can help, otherwise I an guessing and the engineer in me does not like guessing.

wvmarle

Any way,  since push button always off, could I replace it with optical ir (interrupter)?
For lack of details: most likely not if you're looking for a drop-in replacement, you're almost certainly going to need more components and a power souce for those components. With this amount of detail: not much chance to make it work.

Which components? Well, if you post a complete circuit diagram of the device which button you want to replace we may be able to give suggestions.

Quote
How would I make it trigger output only when interrupted or something blocks the slotted?
That's what such a thing normally does: the output is triggered (and then goes either low or high depending on the actual design of your specific interruptor). If it works the wrong way for your application, add an inverter.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

ART50317

#5
Dec 09, 2018, 11:30 pm Last Edit: Dec 09, 2018, 11:38 pm by ART50317
So here is what I want to do. 
I want trigger DFPlayer from (push button/interrupter) P2 input from ATtiny85.
Trigger once, play first track.  This would be equivalent to DFPlayer stand alone IO_1 + GND
Trigger twice, skip track. This would be equivalent to DFPlayer stand alone IO_1 + GND
But this time, second trigger triggers the motor.

Another thread I started, $.50 coin operated kiddie ride using DFPlayer.  I currently have stand alone dfplayer. first coin set contact for IO_1 and ground. Faulty all the time.  I would like to use the interrupter so the coin could just roll pass it. Only 2 tracks and it repeats.
track 1 - "please insert another coin"
track 2 - "attention........ thank you for ride"
Now we(he's) wanting to motorize the ride.

I want to use the ATtiny85 because of its size, if it doesn't work, I might have to go to the next level 'pro mini'.  Please any suggestions and recommendation is appreciated.

https://forum.arduino.cc/index.php?topic=580403.0

wvmarle

That's an interesting take on the ATtiny - that regulator is bigger than the microcontroller!

DFPlayer would be triggered by an output of the Tiny, not an input.

Also you don't need an interrupt for a coin detector. It takes easily 10-100 milliseconds for the coin to pass by that slot, that's a long time. If you miss such an event there's something wrong with your code (copious use of delay() probably).
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

ART50317

As i mentioned, i might go with the pro mini.

The diagram value is not legit, just showing how I would hook up.


wvmarle

The diagram value is not legit
Then hand draw a legit one. Or use some proper circuit drawing software.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

ART50317

I just ordered pro mini board. We can bury this thread. I'll open new question thread with more context when it comes.

Go Up