라즈베리 파이 피코 모터 - lajeubeli pai piko moteo

1. 소비자상담센터 : 02-2283-1300 

2. 상품준비 및 배송기간안내

        a. 국내상품 : 

        b. 해외상품 :

             1) 해당상품: 

아이콘이 부착된 상품 

             2) 구매금액 700,000원 이상 : 입금확인 후 최소 5일 ~ 최대 2주 

             3) 구매금액 700,000원 이하 : 입금확인 후 최소 1주 ~ 최대 8주 

             4) 단, 해외계약업체에 품절되지 않은 상품에 한함 

   ② 구매상품 종류가 많을 경우 예상 준비기간 보다 더 소요 될 수 있습니다. 

   ③ 주문하신 상품은 출고완료 메일 또는 문자 수신 후 익일~최대7일(도서,산간지역) 

      이내에 수령하실 수 있습니다. 

   ④ 제주(\3,500원)/도서지역(\5,000원)은 배송비가 추가됩니다. 

      제주,도서, 산간지역은 타 지역보다 배송기간이 길어질 수 있습니다. 

   ⑤ 

 아이콘이 부착된 상품이라도 국내재고가 있을 수 있습니다. 

   ⑥ 해외 현지 사정으로 인해 공지한 배송기간보다 더 길어 질 수 있습니다. 

   ⑦ 해외상품은 반품/교환/취소가 어려울 수 있으니 신중히 주문하시기 바랍니다.

3. 소비자의 단순변심/착오구매에 의한 청약철회제한안내 

    전자상거래 등에서의 소비자보호에 관한 법률 제17조 제2항 및 동 시행령 

      제21조에 의한 청약철회 제한 사유에 해당하는 경우 및 기타 객관적으로 

      이에 준하는 것으로 인정되는 경우에 한합니다. 

   ② 소비자의 단순변심, 착오구매에 의한 교환/반품 시에 발생하는 배송비는 

      소비자가 부담합니다. 

   ③ 판매자의 실수,제품하자 등의 사유로 인한 배송비는 판매자가 부담합니다.

4. 상품의 교환/반품/보증조건 및 품질보증기준안내

    상품이 공급된 날(배송완료일)로부터 7일 이내에 교환/반품을 신청 할 수 있습니다. 

      그러나 아래의 사유에 해당 하는 경우에는 교환/반품 신청이 받아들여지지 않을 수도 있습니다. 

        a. 소비자의 책임으로 인해 상품이 훼손/멸실 된 경우(확인을 위한 포장훼손제외) 

        b. 소비자의 사용에 의해 상품의 가치가 현저하게 감소한 경우 

        c. 시간의 경과로 인해 상품의 재판매가 불가하게 된 경우 

        d. 판매방식의 특성으로 판매자에게 회복할 수 없는 피해가 발생한 경우 (주문제작 상품, 청약철회상품 등) 

   ② 교환/반품/보증조건 및 품질보증기준은 『소비자기본법』에 따른 소비자분쟁해결기준에 따라 피해를 보상합니다.

5. 소비자피해보상 처리, 재화 등에 대한 불만 및 분쟁처리 안내

   ① 본 상품은 소비자 분쟁해결기준(공정거래위원회 고시)에 따라 피해를 보상받을 수 있습니다.

  1. Home
  2. News

(Image credit: Tom's Hardware)

The Raspberry Pi Pico is an enticingly small, yet powerful board that offers users the chance to create projects both great and small. One type of project is robotics and for this we need motors. So how can we control DC motors with a Raspberry Pi Pico? Can we connect them directly to the GPIO? The short answer is no. 

The GPIO pins of the Raspberry Pi Pico cannot deliver the current needed for a DC motor and, if we were to try, there is a good chance that we would damage the Pico. Instead we need a motor controller that acts as a bridge between the Pico and our motor. We turn two Pico GPIO pins on / off and they control the motor controller which will in turn, turn on / off two outputs to make the motor move.

For this project you will need

  • Raspberry Pi Pico running MicroPython (see how to set up Raspberry Pi Pico)
  • Thonny installed on your computer
  • 4 x Male to male jumper wires
  • Half or full-size breadboard (opens in new tab)
  • Motor controller board. In our case, we used a DRV8833 (opens in new tab) chip, but L298 or L9110S chips should also work.
  • 5V / 6V DC Motor. We used a micro gear metal motor, but a standard DC hobby motor will also work. Note that the motor will need 2 x male to male jumper wires to connect to the breadboard.

(Image credit: Tom's Hardware)

Hardware Setup of DC Motor with Raspberry Pi Pico

The chip we are using in this project is a DRV8833 and our particular version is made for breadboards, but there are many other versions including a version designed for embedding in robots. There are also other motor controllers on the market, such as the L298D and L9110S which are simple and affordable components for robotics. All motor controllers share the same input/output conventions. 

(Image credit: Tom's Hardware)
  1. Place the Raspberry Pi Pico into the breadboard so that the micro USB port hangs over the end of the breadboard.
  2. Place the DRV8833 motor controller into the breadboard so that the pins are either side of the central channel.
  3. Connect the VBUS pin of the Raspberry Pi Pico to the VCC pin of the DRV8833 using a jumper wire. This will power the motor controller directly from the 5V supplied via USB.
  4. Connect the Raspberry Pi Pico GND pin to the GND pin of the DRV8833.
  5. Connect GPIO 14 of the Raspberry Pi Pico to IN1 of the DRV8833.
  6. Connect GPIO 15 of the Raspberry Pi Pico to IN2 of the DRV8833.
  7. Connect OUT1 and OUT2 to the pins of the motor, it doesn’t matter which for this test.

(Image credit: Tom's Hardware)

Software Setup of DC Motor with Raspberry Pi Pico 

With the circuit built, connect your Raspberry Pi Pico and open the Thonny application.

import utime from machine import Pin

2. Create two objects, motor1a and motor1b. These will store the GPIO pin numbers used as outputs to control the DRV8833 motor controller.

motor1a = Pin(14, Pin.OUT) motor1b = Pin(15, Pin.OUT)

3. Create a function to move the motor “forward”. To do this we need to tell one pin to pull high, the other low. This, in turn, communicates our intended direction to the motor controller and the corresponding output pins will follow suit forcing the motor to move in a set direction.

def forward(): motor1a.high() motor1b.low()

4. Create a function to move “backward.” This sees the GPIO pin states reverse, causing the motor to spin in the opposite direction.

def backward(): motor1a.low() motor1b.high()

5. Create a function to stop the motor. By pulling both pins low, we tell the motor controller to stop all movement of the motor.

def stop(): motor1a.low() motor1b.low()

6. Create a final “test” function that will call the previous functions and run a test sequence that will spin the motor “forward” for two seconds, then “backward” for two seconds. It then stops the motor.

def test(): forward() utime.sleep(2) backward() utime.sleep(2) stop()

7. Create a for loop which will run the test function five times.

for i in range(5): test()

Save the code to the Raspberry Pi Pico as motor.py and click on the green arrow to run the code. The motor will rotate in both directions five times.

Get instant access to breaking news, in-depth reviews and helpful tips.

Les Pounder is an associate editor at Tom's Hardware. He is a creative technologist and for seven years has created projects to educate and inspire minds both young and old. He has worked with the Raspberry Pi Foundation to write and deliver their teacher training program "Picademy".

Toplist

최신 우편물

태그