Showing posts with label KY-023. Show all posts
Showing posts with label KY-023. Show all posts

Thursday, November 19, 2015

Arduino_Servo

Arduino Servo

Hardware

Servo motors have three wires: power, ground, and signal.
The power wire is typically red, and should be connected to the 5V pin on the Arduino
The ground wire is typically black or brown and should be connected to a ground pin on the board.
For my experiments i used some Servos with
  • Yellow Signal    (In the two scripts below Pin 9)
  • Red      +5V
  • Brown Ground

Example 1: Sweep

This script sweeps the servo

Example 2: Servo Potentiometer control

This script uses a potentiometer to control the servo..
I used the KY-023 XY-axis joystick module ( potmeter in X direction VRx )


More info


Wednesday, November 18, 2015

Arduino_KY-023_XY-axis_joystick_module


Arduino_KY-023 XY axis joystick module



Expected that it would be very easy to test this sensor with the script below as i wanted to use it also for an Arduino project with a servo.
Result: X an Y functioned correct Push button gave problems.
Tested push button separate using the simple key switch KY-004 method using the led (pin 13) on the Arduino  (This script used D10 not D3 for the button )
Result: Key push not function on my joystick !!
Tried another KY-023 XY axis joystick module: button worked. (Led on / Off depending Joystick pressed yes/no)
Tried the KY-023 script below with this other KY-023 module.
Result: X Y functioned . Button works better but still gives some problems: If pressed signal is 0. If not pressed, most times signal is 1 but some noise on line gives sometimes signals 0.
On the joystick module a debounce resistor is not on the module and it is needed for some applications. There is a location for an SMD resistor on the PCB.  Better de-bounce is needed!

Hardware

  • MS ( key) Arduino D3
  • VRy (Joystick y ) A1 
  • VRx (Joystick x ) A0 
  • +5V +5V
  • GND GND


More info