NooTriX

A Robotic Elevator using Lego & Arduino – Part 3

A Robotic Elevator using Lego & Arduino – Part 3

In the first two parts of this series, we have introduced the mechanics of our Lego-based elevator and we discussed how to balance it to lift some load. Today, we will be discussing the connection between the Lego Mindstorms’ motor and touch sensors with an Arduino board.

Lego Components Characteristics
First things first, we need the characteristics of the Lego components of our elevator. The philo’s web site is THE place for this. It provides info about different Lego motors including the Mindstorm ones. We are using the RCX which motor current can goes up to 120 mA depending on the load. The voltage varies between 4.5 V and 12 V . Changing the voltage changes the rotation speed from 57 rpm (4.5 V) up to 375 rpm (12 V).

Regarding the touch sensors, getting the info is much easier. Just plug it to a multimeter set to measure the resistance. The Lego touch sensor embeds a potentiometer. When nothing is sensed, the resistance is infinite, meaning that there is no contact. But, when the sensor is touched, its resistance varies from approximatively 500 Ohms (strong pressure) up to 1.5 kOhms (light pressure).

The H-Bridge
We will be using an Arduino Uno Board. The maximum current that can be provided by each pin is 40 mA, which is far below what the Lego motor might require. To avoid burning the Arduino board, we need a power amplifier. The best way to go is to make an H-Bridge to control the motor (see Picture 1).

wpid-hBridgeSchema-2014-01-11-08-02.jpg

Picture 1: H-Bridge

The logic behind the H-Bridge is easy. The four transistors (T1 to T4) are used as electronic switches. When they are ON, they can deliver current to the motor. When they are OFF, no current can flow through their collectors. In an H-Bridge, transistors switch in pairs to allow the motor rotate either forward or backward. To make forward rotations, transistors T1 and T4 are switched OFF, while T2 and T3 are turned ON (See Picture 2a). For backward rotations, we use the opposite configuration (see Picture 2b): T1 and T4 are ON, while T2 and T3 are OFF.

wpid-hBridgeSchemaMotorForward-2014-01-11-08-02.jpg wpid-hBridgeSchemaMotorBackward-2014-01-11-08-02.jpg
Picture 2a: H-Bridge set for motor forward rotation Picture 2b: H-Bridge set for motor backward rotation

The Full Circuit
Our H-Bridge will be driven by the Arduino board, which leads us to the voltage issue. The Arduino operates at 5 V, while we have chosen to use 12 V for the motor since we found that it leads to a higher lift power. Thus, we need to insulate electrically the Arduino board from the H-Bridge. The best option is to use optocouplers (also known as opto-isolators). They allow transmitting Arduino signals to turn transistors ON and OFF by means light only. Hence, the Arduino is protected while still controlling the H-Bridge. The full circuit is provided on Picture 3, where only used pins of the Arduino board are represented. The internals of the quad-optocoupler chip CNY74-4 are also represented in grey for sake of easing understanding.

wpid-electronicsSchema-2014-01-11-08-02.jpg

Picture 3: Full circuit of the elevator

We use 6 pins of the Arduino: two for power and 6 for controlling the elevator. Pins number 2 and 3 are used in input mode. They allow detecting when the elevator’s touch sensors are pressed, that is when the elevator is at its maximum or minimum height. Pins 6 and 7 are also in input mode. They are connected to push buttons that allow driving the elevator up or down.

Whenever a push button is pressed the appropriate pair of transistors of H-Bridge is switched on through pins 10 and 11. This obviously means that these two last pins are in output mode. These two pins are enough to control the 4 transistors of the H-Bridge, since transistors function in pairs.

Tips and Tricks
Regarding transistors, we have chosen to use TIP 122 and TIP 127 ones. Those are darlington transistors that can deliver high power, up to 65 W. That is much beyond what we need for the lego motor. So, we can reuse the circuit for controlling other motors in the future.

It is also worth mentioning that the circuit uses color LEDs at different stages. While this makes the circuit look nice, the actual reason is to help debugging. The green and the red LEDs signal that touch sensors are pushed. Yellow and Pink LEDs turn ON when the motor is commanded to rotate forward or backward.

The last tip is that we recommend using a screw shield for the Arduino. It makes life easier for connecting your circuit to the Uno. For smaller circuits, an alternative is to use an Arduino shield that integrates a mini-breadboard. Last, for the lazy, there is an Arduino motor shield that includes the optocouplers and the power transistors.

Related Articles

0 Comments

No Comments Yet!

There are no comments at the moment, do you want to add one?

Write a comment

Write a Comment

Related Posts

    Computers with Emotions Talk by Peter Robinson

Computers with Emotions Talk by Peter Robinson

1 comment Read Full Article
    Robots can Help Understand Humans Talk by Pierre Yves Oudeyer

Robots can Help Understand Humans Talk by Pierre Yves Oudeyer

0 comment Read Full Article
    Human-Level AI Talk by Murray Shanahan

Human-Level AI Talk by Murray Shanahan

0 comment Read Full Article
    Learn How Make Robots Hear and Localize Sound Sources

Learn How Make Robots Hear and Localize Sound Sources

0 comment Read Full Article
    Fast 3D Printing of Robot Parts

Fast 3D Printing of Robot Parts

0 comment Read Full Article
    How Many Actuators are Needed to Build a Robot?

How Many Actuators are Needed to Build a Robot?

0 comment Read Full Article
    Free Online Course on Developmental Robotics and AI

Free Online Course on Developmental Robotics and AI

0 comment Read Full Article
    Sharing USB Devices over Wifi using Arduino Yún

Sharing USB Devices over Wifi using Arduino Yún

2 comments Read Full Article
    Upgrade the Arduino Yún’s Linux

Upgrade the Arduino Yún’s Linux

4 comments Read Full Article
    ROS Indigo Igloo Preinstalled Virtual Machine

ROS Indigo Igloo Preinstalled Virtual Machine

27 comments Read Full Article
    PiBot: The Raspberry Pi-Based Robot

PiBot: The Raspberry Pi-Based Robot

0 comment Read Full Article
    Hands on the Arduino Yún

Hands on the Arduino Yún

0 comment Read Full Article
    Jimmy the 3D Printed Open Source Humanoid Robot Alternative to Nao

Jimmy the 3D Printed Open Source Humanoid Robot Alternative to Nao

1 comment Read Full Article
    How to Customize Your Turtlebot

How to Customize Your Turtlebot

0 comment Read Full Article
    Virtual Machine with ROS Hydro Medusa Pre-Installed

Virtual Machine with ROS Hydro Medusa Pre-Installed

33 comments Read Full Article
    A Robotic Elevator using Lego & Arduino – Part 4

A Robotic Elevator using Lego & Arduino – Part 4

1 comment Read Full Article
    Intelligent Robots Should Maximize Their Future Options

Intelligent Robots Should Maximize Their Future Options

0 comment Read Full Article
    Super Simple Robots for Weekend Projects

Super Simple Robots for Weekend Projects

0 comment Read Full Article
    A Robotic Elevator using Lego & Arduino – Part 3

A Robotic Elevator using Lego & Arduino – Part 3

0 comment Read Full Article

The Future of Human-Robot Interaction

Read Full Article