How to Interface Servo Motor with PictoBlox

Interfacing Servo with PictoBlox_FeatureImage
About This Tutorial
This tutorial discusses what are servo motors, how to control them, and how to interface them with PictoBlox using evive.
Tutorial Info

Components Required

ImageComponentQuantityAvailable in Kit
evive1
USB A-B Cable1
Micro Servo Motor with Accessories1

Introduction

A servo motor, or simply, a servo, is a rotary actuator that rotates or push parts of a machine to which it is connected, with precision. Unlike DC motors, these motors generally rotate to a particular angle, and then stop.

 If pull apart a servo motor, you find the following inside it:

  • A DC Motor
  • A Potentiometer
  • A gear train, i.e. a series of gears that are connected such that their teeth are engaged/interconnected. (A gear can be visualised as wheel with teeth, not the regular teeth though; sometimes more and sometimes less than 32!)
  • A control circuit: This circuit is the actual brain behind the precise working of the servo. It controls how much the servo should move or rotate depending upon the input it receives.

evive has two dedicated servo motor outputs pins, as shown below:

evive servo output channel

Interfacing Servo Motor with PictoBlox

For interfacing the servo motor with PictoBlox, you must first connect the motor to one of evive’s servo channels as shown in the figure below:

evive Alert
While connecting the servo to evive’s servo channel, make sure that brown wire goes to the left-most pin.

You can control the servo using evive in two ways:

  • By using evive’s inbuilt menu
  • By writing a script in PictoBlox

You can control a servo motor in PictoBlox with the help of the following block:

  • set servo on () to () angle: This block allows you to set/change the angle of the specified servo motor to a specified value.

You can find this block in the Actuators palette.

Activity: Controlling Motor Direction Using a Potentiometer

evive Notes Icon
When working with evive on PictoBlox for the very first time, or if you’ve previously uploaded another code to evive, you must upload the firmware in order to upload new code to it. You can find the procedure for the same HERE.

Follow the steps below to write the script:

  1. Connect evive to your computer and open PictoBlox; if already open and working on a project, save that project. Then, click on New.
  2. Go to the toolbar and click on the Board menu. Then select evive as your board. Pictoblox Board Selection
  3. Next, click on the Connect menu and from the fly-out menu, select the Port to which evive is connected e.g. COMXX or ttyXX.Once you select the port, the icon beside the Connect tab will become connected.Connect-Disconnect Icon
  4. Go to the Events palette and drag and drop the when flag clicked block.
  5. Next, go to the Control palette and drag and attach the forever block below the when flag clicked block.
  6. Then, drag and drop the set servo on () to () angle block from the Actuators palette inside the forever block; channel 1 is set as the default servo channel.
  7. Drag and drop the potentiometer () reading block inside the set servo on () to () angle block from the evive palette; potentiometer 1 is set as the default potentiometer.Interfacing Servo with PictoBlox - GIF

Below is the complete script:

Interfacing Servo with PictoBlox

Click on the green flag to run the script. 

Click on the red octagon, next to the green flag to stop the script.

Conclusion

It this tutorial, you learned how to interface a servo motor with PictoBlox.

Hope you had fun! 🙂

Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Related Projects & Tutorials
evive-Plug-and-Play-Part-1
evive – Plug and Play: Part 1
In this tutorial, we are going to give you a hands-on experience of evive’s plug and play interface through activities for controlling a DC motor, a servo motor, understanding the inbuilt touch sensors of evive.
PictoBlox – Stage Mode
In this tutorial, you learned about PictoBlox's Stage mode and how to control hardware in real-time using a USB cable or over Bluetooth. 
PictoBlox-Upload-Mode
PictoBlox – Upload Mode
In this tutorial, you'll see what is PictoBlox's Upload mode and how to use it to control our hardware wirelessly, i.e. without being connected to computer.
All articles loaded
No more articles to load
Featured Projects
All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart