From Fab Lab Wiki - by NMÍ Kvikan
Jump to: navigation, search

Electronic components

what components must do in my project?

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:

  1. 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.
  2. 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.
  3. All of that would be managed by an Arduino card / code linked to my computer (I work with Windows pc).

The components

  1. Arduino UNO starter kit.
  2. HMC5883L gyroscopic component
  3. HC-SR05 utrasonic mesuring component (X2 - head detector and presence detector)
  4. Servomotor (360°)
CR electronic-components.jpg

The softwares

  1. Fritzing - for shematics
  2. Arduino code editor - To code
CR code-softwares.JPG


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.