Regarding to my master degree, my personnal project need a lot of electronic components to work. I use to study differents fields but the electronic and the code never yet. Everything must strat one day! To explain my project I want:
- A spectator controle the orientation of a pojector on 360° using his head. For that I want to use a gyroscopic component that takes into account this orientation included in the headphone he will wear by a servo.
- The projector light on only when the spectator is under it and if he wears the headphone. For that I want to use two ultrasonic components that takes into account the distance that there is between it and an obstacle in front of it.
- All of that would be managed by an Arduino card / code linked to my computer (I work with Windows pc).
- Arduino UNO starter kit.
- HMC5883L gyroscopic component
- HC-SR05 utrasonic mesuring component (X2 - head detector and presence detector)
- Servomotor (360°)
- Fritzing - for shematics
- Arduino code editor - To code
Before the final prject I must learn and create each part of what I want separatly. In this part you will see all of theme separatly.
Controling the servo with the Gyroscoic macgnetometer
With the HMC5883L library we can use the exemple included and download it to the arduino microprocessor. It will sent you the informations that the sensor HMC5883L calaculate. You can read theme by the serial monitor window. then i changed the code in orer to use the heading degree data with the servomotor. So I said him to go on the same position a the heading degree is. So if the sensor has an orientation of 45° from the northe, the servo will go to the position 45°. The delay is very short (few miliseconds) and it calculate and position the servo in the good position each time the loop is calculated (so each few miliseconds). On these pictures you can see the Fritzing schema, the real cabling and the Arduino cde bellow.