[PYTHON] Power SG-90 servo motor with raspberry pi

Thing you want to do

I want to press a small button with a servo

2016/03/08 It still works, but it may or may not work due to insufficient current, so it is not recommended for purposes other than a little movement as a trial. I was sick (≧ F ≦). I will organize it in another article.

What I bought

--SG-90 Akizuki Denshi --Jumpa Male-Mess

code

from RPIO import PWM
import time

servo = PWM.Servo()
SERVO_X = 23

# 0
servo.set_servo(SERVO_X, 1500)
time.sleep(1)

# -90
servo.set_servo(SERVO_X, 400)
time.sleep(1)

# 0
servo.set_servo(SERVO_X, 1500)
time.sleep(1)

servo.stop_servo(SERVO_X)

What I was able to do

I feel that the servo motor does not move exactly to 0 °, 90 °, and -90 ° even if I intend to do it according to the specifications. I'm not sure where 0 ° is in the first place, and I wonder if a servo motor is such a thing.

I thought it was okay in terms of electric current, but there was no problem.

push_button-compressor.gif

Recommended Posts

Power SG-90 servo motor with raspberry pi
Servo motor control with Raspberry Pi
[Raspberry Pi] Stepping motor control with Raspberry Pi
GPGPU with Raspberry Pi
DigitalSignage with Raspberry Pi
Power on / off your PC with raspberry pi
Mutter plants with Raspberry Pi
OS setup with Raspberry Pi Imager
Try L Chika with raspberry pi
VPN server construction with Raspberry Pi
Try moving 3 servos with Raspberry Pi
Power on / off Raspberry pi on Arduino
Using a webcam with Raspberry Pi
Control the motor with a motor driver using python on Raspberry Pi 3!
Graph display of household power consumption with 3GPI and Raspberry Pi
Measure SIM signal strength with Raspberry Pi
Hello World with Raspberry Pi + Minecraft Pi Edition
Build a Tensorflow environment with Raspberry Pi [2020]
Get BITCOIN LTP information with Raspberry PI
Try fishing for smelt with Raspberry Pi
Programming normally with Node-RED programming on Raspberry Pi 3
Improved motion sensor made with Raspberry Pi
Try Object detection with Raspberry Pi 4 + Coral
Working with sensors on Mathematica on Raspberry Pi
Use PIR motion sensor with raspberry Pi
Make a wash-drying timer with a Raspberry Pi
Infer Custom Vision model with Raspberry Pi
Operate an oscilloscope with a Raspberry Pi
Create a car meter with raspberry pi
Inkbird IBS-TH1 value logged with Raspberry Pi
Working with GPS on Raspberry Pi 3 Python
Discord bot with python raspberry pi zero with [Notes]
I tried L-Chika with Raspberry Pi 4 (Python edition)
Enjoy electronic work with GPIO on Raspberry Pi
MQTT RC car with Arduino and Raspberry Pi
CSV output of pulse data with Raspberry Pi (CSV output)
Observe the Geminids meteor shower with Raspberry Pi 4
Get CPU information of Raspberry Pi with Python
Play with your Ubuntu desktop on your Raspberry Pi 4
Get temperature and humidity with DHT11 and Raspberry Pi
Stock investment analysis app made with Raspberry Pi
Logging Inkbird IBS-TH1 mini values with Raspberry Pi
Connect to MySQL with Python on Raspberry Pi
GPS tracking with Raspberry Pi 4B + BU-353S4 (Python)
Measure CPU temperature of Raspberry Pi with Python
Record temperature and humidity with systemd on Raspberry Pi
Machine learning with Raspberry Pi 4 and Coral USB Accelerator
Run LEDmatrix interactively with Raspberry Pi 3B + on Slackbot
Using the digital illuminance sensor TSL2561 with Raspberry Pi
Easy IoT to start with Raspberry Pi and MESH
Display images taken with the Raspberry Pi camera module
Using Akizuki Denshi's 4WD car FT-MC-004 with Raspberry Pi
Try to visualize the room with Raspberry Pi, part 1
Try debugging Python on Raspberry Pi with Visual Studio.
Detect mask wearing status with OpenCV and Raspberry Pi
Control brushless motors with GPIOs on Raspberry Pi Zero
Take the value of SwitchBot thermo-hygrometer with Raspberry Pi
Try moving the servo motor with RasPi (180 degree version)
Measure temperature and humidity with Raspberry Pi3 and visualize with Ambient
Log the value of SwitchBot thermo-hygrometer with Raspberry Pi
Ubuntu 20.04 on raspberry pi 4 with OpenCV and use with python