I tried for a while to make the IR sensor immune to daylight but it was way over me technically. I tried to send and receive the light in a certain frequency but that didn’t work…
It felt more my way, to teach the Arduino about the outside world instead of limiting it to a signal anyway. During my tests I saw that daylight, especially direct sunlight have very strong IR radiation. So, I started working on a code that will recognize the environment and command the unit accordingly.
The code is recognizing the environment by calculating the average value from all 6 sensors and initiating 2 different algorithms accordingly. It also has a control against the effect from the direct sunlight. Otherwise, the unit would give a very strong response to direct sunlight.
I also improved the hardware by covering the back of the sensors and placing them in tubes to minimize environmental effects.
It works fine indoors. I will see how it reacts outdoors tomorrow. When it is ready I will do the first flight test with the IR sensors, hopefully outdoors.
Focusing on the indestructible Nano recently, I haven’t been able to work on the MonoBot. Having the nanoC resolved, I had a chance to revisit the bot.
Since the maiden flight and realizing that the regular IR sensors are useless in daylight, I worked on a solution which I hope would solve this problem. This solution utilizes the sensors almost like motion sensors and they react to changes in the environment, whether this is an obstacle or a change in the light source, etc… But I never had the chance to test this until a couple of days ago.
This time the problem wasn’t the IR sensors, in fact I could only test them in one occasion during 18 minutes of trying. The servo jitter that I kinda solved with the filtering code and the delay that the code causes were the major problems. So, I tried to control the unit most of the time and didn’t feel comfortable to activate the IR sensors except one occasion and that short video is attached. At 24 second mark you will notice the unit ascend and bounce back with the help of the bottom sensor. However, probably, because of the noise in the signal and the delay caused by the code, the second bounce didn’t happen and the throttle was all over the place during that time.
After experience, I tried hardware solutions one more time, pull down/up resistors, capacitors, different feed voltages, feeding the Arduino board from a separate source, etc… One more time, nothing worked… I believe this is an Arduino nano problem and there are lots of blogs but no real solutions. And I am pretty sure if I used a UNO board I wouldn’t have this problem but that is too large for the unit.
So, I camped in front of the computer for 2 nights to sort this problem with a new code. After many unsuccessful tries I believe I came up with a better solution, which eliminates the jitter COMPLETELY and improves the response time significantly. The second half of the video shows the results. The shaking of the nozzles for a second right after I boot up the unit is because of resonance and has nothing to do with the signal quality. After that one second you will see that the nozzles are as still as rocks, which makes me very happy.
Will adjust the response rate of the sensors and test it again once the weather conditions allow me…