I'm new on Arduino and I have some questions. For controlling of a sensor I have to generate a rectangular signal of 2Hz (5V; 50% DC) and the signal has to be given to the sensor constantly while Arduino is doing other tasks like reading and saving sensor data.
I would like to know how to solve this issue. Do I need an external hardware (e.g. oscillator)? Is it possible to do it by coding?
Regards and thank you very much for the support
BeDa
the sensor is no mystery ..., it is an NDIR-sensor (CO2). I would like to control the bulb of the sensor with a MOSFET and take the rectangular signal for the gate. I plan to do this independently from the measurement.
Yes it is because you still have not told us what sensor you have. Now we know the type of sensor but have no idea what NDIR-sensor you have.
You know because it is your sensor, we do not know stuff simply because you know stuff.
I plan to do this independently from the measurement.
So you are happy to take a measurement with the IR source off?
sorry for the missing details and the missunderstandings. It is an Alphasense IRC-AT-sensor and the analog frontend is LMP91051. The MOSFET, the LMP91051 and the sensor reading should be controlled by the Arduino Uno. The wording "independently" means, I start the light source of the sensor with the rectangular signal and it is not interfered by any other operations of the Arduino like calculations and sending data. There is no synchronisation needed.
Regards and thank you very much for your support
BeDa
The MOSFET, the LMP91051 and the sensor reading should be controlled by the Arduino Uno.
Look it is no good trying to pull rabbits out of a hat. You know what you have but we have no idea. So please post a schematic and links to your sensors.
There is no synchronisation needed.
So I repeat you are happy to take a measurement with the IR source off?