Rest an ARDUINO using IR

Hi guys
Working on project, and a certain stage, I have to Rest the ARDUINO if there is no object between the
Phototransistor & infrared emitter
I’m using these:

So how can I do it?
What should be the code?

Thanks for you consideration

What do you mean by rest in this context? Sending the Arduino to sleep? If so just invert the signal and put it to the INT0 pin. Activating the interrupt will wake the Arduino.

Thanks for your response, yes I mean totally rest “same as pressing the rest button”
But how should I connect the IR’s, since this my first time to deal with these thing
Thanks for your patience

There is no rest button. Do you mean reset? There is no simple solution to reset an Arduino by IR. May I ask why you want to reset the Arduino? If you want to re-activate it after a freeze, a solution which involves software running on the Arduino is not suitable.

Sorry ,yes I mean Reset :sweat_smile:
I want charge employee’s electrical vehicle at certain criteria depends on the position of the Employees,
The arduino will classify the position by RFID card.
So far I’m doing well with this, but the problem if the car left the charger still on, even if another Employee come, it will not respond to his card, until I reset the arduino manually

So far I’m doing well with this, but the problem if the car left the charger still on, even if another Employee come, it will not respond to his card, until I reset the arduino manually

If this is so, you have an error in your software. Post your sketch and we try to find that bug. In normal operations you should never reset an Arduino. Mine are running for months and I did never reset them since they are "in production".

The idea is for example for the manager, we are charging for five second and disconnect for a second
And for like a laborer we do the opposite, I’m controlling relay, such that for the manger it will connect for 5 seconds and disconnect for a second.
This works very fine but the problem ,come if the manger leave the charging still operate .and if another one came and put his card the arduino will not respond, and keep continue in the previous criteria.

:grin: :grin:

As I wrote before: post your code, we'll find the bug.

I currently don't see why charging a battery for five seconds should be a good idea but perhaps I'm missing something. Anyway, I guess you're using delay() for the timing, then you should look at the BlinkWithoutDelay example of the IDE.