You are on page 1of 5

Welcome to Pico sensor kit repository

Driver Motor L9110s


L9110s.py

Learning target

In this course, we will learn how to use pins of the Raspberry Pi Pico board.

How to use and control L9110S driver motor with 2 DC motor 3.3V.

2. Preparation

Raspberry Pi Pico board *1

Pico sensor expansion board *1

PC *1

USB data cable *1

L9110s driver motor *1

DC motor 3.3V * 2

Male-to-male DuPont line *3


3. About wiring
Follow this schematic diagram and make connections.

Connect IN1 pin of L298N with GP0 Pin of Raspberry Pi Pico

Then Connect IN2 pin of L298N with GP1 Pin of Pico

Connect IN3 pin of L298N with GP2 Pin of Pico

Now Connect IN4 pin of L298N with GP3 Pin of Pico

Then Connect GND pin of L298N with GND Pin of Pico, Make comman
connection between 12V GND and raspberry pi pico’s GND

Connect push button as shown in schematic diagram.

You can use any value of resistor above 1K Ohm.

To power motors, I connected 12v DC adaptor.


4. About code

Thonny programming

About how to using ThonnyIDE, please check the tutorials in【2.Development


environment】
from machine import pin
from time import sleep

IN1 = Pin(0, Pin.OUT)


IN2 = Pin(1, Pin.OUT)
IN3 = Pin(2, Pin.OUT)
IN4 = Pin(3, Pin.OUT)

Button1 = Pin(16, Pin.IN)


Button2 = Pin(17, Pin.IN)

while True:

if Button1.value() == 1:
IN1.high()
IN2.low()
IN3.high()
IN4.low()

elif Button2.value() == 1:
IN1.low()
IN2.high()
IN3.low()
IN4.high()

elif Button1.value() == 0:
IN1.low()
IN2.low()
IN3.low()
IN4.low()

elif Button2.value() == 0:
IN1.low()
IN2.low()
IN3.low()
IN4.low()
5. Phenomenon

Click the green run button of Thonny IDE to start running the program. Click the

red stop button to stop the program.

You might also like