Hello everyone!
I just started a new project. The idea is to have have motion sensors that can detect paintballs hitting them and then sending a simple digital signal to a ESP8266 that can display it on a AP webserver. I need it to be kinda instant, since it's supposed to be a snap shooting training tool. (Google "Paintball snap shooting" to get a picture of what i want)
For the motion sensors i used MPU6050s connected to arduino nanos which uses the "getMotionInterruptStatus" to detect the motion and in turn sets a GPIO pin to HIGH. This can then be read by the ESP8266. (Don't know if this is the best solution, maybe another sensor type is better? I'm planning on having an aluminium plate about the size of a head as the target.)
I want to connect 2 of these sensors to the ESP8266 and I have no idea how im going to solve all the timings to get "instant" feedback on the web page. I have tried to make a very simple ajax web page that just reads the digital pin in the loop and displays the value, which works sometimes, but far from every time. I have thought about using interups, but i have no idea how to implement that with 2 sensors and a webserver.
When you get it working consistently, then worry about minimizing the time between steps. Realize that real-time begins when your Arduino reads the sensor. Work from there for minimum times. No one here has your setup so no one here can test changes.
Perhaps the first step is to actually quantify the times for the steps. Then you have a meter to tell you if you are getting better or worse results.
What is the exact purpose of the web server?
Who would view the webpage?
How would it be displayed?
If the web server's purpose is to give feedback to the trainee, I wonder if there might be an easier way to give fast feedback. Rather than using a web server, something like a sound or a light-up signal could be triggered right from the microcontroller.
If there was some extra "non-time-critical" information to be displayed, it could also be shown with a web server, following slightly behind the immediate sound/light feedback.
The purpose is to visualise hits on the target, display a timer and count hits. I’m thinking about a very simple UI with just a split screen (to visualise each target with a color ) and then a circle in the middle or something with timer and counter. This is meant for both the user and for example a coach. But also as a target practice mini game.
I have no experience with ESP8266, so this might be a silly question to ask, but is there any particular reason than you can't get rid of the Nanos and handle the interrupts directly on the ESP8266?
I see your code for the Nanos, but is there any code you could show for the ESP8266 side so far?
I only previously read this topic from the perspective of what needed to be done for moderation purposes, I never really considered the actual question.
Now you mention your point I don't see any reason for interrupts or multiple processors, the ESP should be able to do everything.
You certainly don't need a Six-Axis (Gyro + Accelerometer) MEMS MotionTracking™ Device just to detect the impact of a paintball on a target!
It does sound like serious overkill!