background image

 

 

4.  Demonstration 

 

With Arduino 

Here we demonstrates how to use Grove - MOSFET to control a motor. We provide power for it 

with  external  power  source,  but  if  your  controlled  device  needs  current  smaller  than  300mA, 

Seeeduino can totally support it and no extra power source needed.

  

 

// demo of Grove - MOSFET 

// use pin 6 to control a motor 

 

int motorPin = 6; 

 

void setup() 

    Serial.begin(38400); 

    pinMode(motorPin, OUTPUT); 

    Serial.println("Grove - MOSFET Test Demo!"); 

 

void loop() 

    motorOnThenOffWithSpeed(); 

    motorAcceleration(); 

 

void motorOnThenOffWithSpeed() 

Содержание Grove MOSFET

Страница 1: ...1 Grove MOSFET User Manual Version 1 0 Release date 2015 9 22 Wiki http www seeedstudio com wiki Grove_ _MOSFET Bazaar http www seeedstudio com depot Grove MOSFET p 1594 html ...

Страница 2: ...2 Document Revision History Revision Date Author Description 1 0 Sep 22 2015 Jiankai li Create file ...

Страница 3: ...3 Contents Document Revision History 2 1 Introduction 2 2 Specification 3 3 Interface 4 4 Demonstration 5 With Arduino 5 With Raspberry Pi 6 5 Resource 8 ...

Страница 4: ...ision of Seeed Technology Inc this manual has been compiled and published which covered the latest product description and specification The content of this manual is subject to change without notice Copyright The design of this product including software and its accessories is under tutelage of laws Any action to violate relevant right of our product will be penalized through law Please conscious...

Страница 5: ...ching frequency can reach up to 5MHz much faster than normal mechanical relay There are two screw terminals on the board One for outer power source and the other for device you want to control Grove MOSFET will pass the power from one end to another when closed But if outer power source is absent your device can still draw power from microcontroller via the Grove interface ...

Страница 6: ...3 2 Specification Working voltage 5V Vin 5 15V MOSFET Model CJQ4435 ...

Страница 7: ...4 3 Interface Vin accepts 5V 15V power of which current is less than 2A Vout attach actuators here ...

Страница 8: ...ur controlled device needs current smaller than 300mA Seeeduino can totally support it and no extra power source needed demo of Grove MOSFET use pin 6 to control a motor int motorPin 6 void setup Serial begin 38400 pinMode motorPin OUTPUT Serial println Grove MOSFET Test Demo void loop motorOnThenOffWithSpeed motorAcceleration void motorOnThenOffWithSpeed ...

Страница 9: ... i 256 i analogWrite motorPin i delay delayTime for int i 255 i 0 i analogWrite motorPin i delay delayTime With Raspberry Pi 1 You should have got a raspberry pi and a grovepi or grovepi 2 You should have completed configuring the development enviroment otherwise follow here 3 Connection Plug the sensor to grovepi socket D6 by using a grove cable 4 Navigate to the demos directory cd yourpath Grove...

Страница 10: ...Full speed grovepi analogWrite mosfet 255 print full speed time sleep 2 Half speed grovepi analogWrite mosfet 128 print half speed time sleep 2 Off grovepi analogWrite mosfet 0 print off time sleep 2 except KeyboardInterrupt grovepi analogWrite mosfet 0 break except IOError print Error 5 Run the demo sudo python grove_mosfet py ...

Страница 11: ...8 5 Resource Grove MOSFET Eagle File CJQ4435 Datasheet MOSFET_WIKI Getting started with Arduino ...

Страница 12: ...Mouser Electronics Authorized Distributor Click to View Pricing Inventory Delivery Lifecycle Information Seeed Studio 103020008 ...

Отзывы: