Arduino Mood Cue Instructable

by ealbaladejo in Circuits > Arduino

595 Views, 0 Favorites, 0 Comments

Arduino Mood Cue Instructable

Screen Shot 2021-11-05 at 2.51.54 PM.png
Screen Shot 2021-11-05 at 2.58.42 PM.png

The Arduino mood cue is one of the 15 projects in the Arduino Projects Books. In this project, you will use a servo motor to make a mechanical gauge to point out what sort of mood you're in that day.

Supplies

The supplies you will need are the

Potentiometer,

servo motor,

a motor arm,

100uf capacitor,

3 male header pins. (all listed in the image above)

Do the Wiring in the Book Pt 1

Screen Shot 2021-11-05 at 2.43.12 PM.png
Screen Shot 2021-11-05 at 3.17.56 PM.png

In this project,

you need to attach the 3 male headpins to the servo motor and then

add 3 wires to each of the male headpins.

1 of the 3 wires needs to be connected to the red wire of the servo motor and grounded to positive.

The second wire connects to the black wire of the servo motor and is grounded to negative.

The 3rd wire connects to the white wire of the servo motor and is plugged into -9 on the board.

Wiring Pt 2

Screen Shot 2021-11-05 at 3.17.56 PM.png

Once you have those wires done

you add the potentiometer witch is the white knob that can be spun when connected to the blue base.

Once you add the potentiometer to the place indicated in the book then you need to add 2 more wires on grounded to negative and one grounded to positive.

Both of those 2 wires need to be connected to one of the two metal parts of the potentiometer.

A third long wire need to be connected to the far side of the potentiometer and on A0.

Wiring Pt 3

Screen Shot 2021-11-05 at 3.17.56 PM.png

The last part needed for the wiring is

2 100uf capacitors, one of the two capacitors needs to go next to where the servo motor is plugged into

and the 2nd one needs to go in front of the potentiometer.

The Next Part of This Project Is the Coding

Screen Shot 2021-11-05 at 2.46.47 PM.png
Screen Shot 2021-11-05 at 2.42.07 PM.png

In this project the coding can be done very quickly

In the beginning, you need to include the #include because this is how you use the servo library

to refer to the servo you need to include the myServo command this will make it possible to talk/communicate with the servo.

You need to set up a named constant for the pin the potentiometer is attached to by the part of the coding including "int"

You do the same thing for the value and the angle.

In the void loop section, you need to add all the code to display all the values on the serial monitor

Then you need to add the delay for how fast the thing gets timed witch in this project is 15 seconds.

Testing

You have reached the end of wiring and coding your mood cue the only thing left to do is to test.

If completed properly your motor should swing back and forth when activated.

If your project doesn't work the best thing to do is to troubleshoot and re-look through all the coding and wiring.