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

Latest Posts

    Donate Some CPU Cycles to Help Scientists Solve the World’s Biggest Problems

Donate Some CPU Cycles to Help Scientists Solve the World’s Biggest Problems

0 comment Read Full Article
    Affordable Virtually Indestructible Drones

Affordable Virtually Indestructible Drones

4 comments Read Full Article
    The First Voice Commanded Robotic Vacuum

The First Voice Commanded Robotic Vacuum

0 comment Read Full Article
    3 Game Changing Solutions to Recharge Your Smartphone without an Electric Outlet

3 Game Changing Solutions to Recharge Your Smartphone without an Electric Outlet

0 comment Read Full Article
    Starwars BB-8 Droid Working Miniature Version Awakens

Starwars BB-8 Droid Working Miniature Version Awakens

0 comment Read Full Article
    Meet Cozmo: A Playful Little Robot with Emotions

Meet Cozmo: A Playful Little Robot with Emotions

1 comment Read Full Article
    Wall-E Disney-Pixar Movie

Wall-E Disney-Pixar Movie

2 comments Read Full Article
    Game Console and Other Pets Care Automation Gadgets

Game Console and Other Pets Care Automation Gadgets

0 comment Read Full Article
    Solar Roads: The Next Green Electricity Power Plants?

Solar Roads: The Next Green Electricity Power Plants?

0 comment Read Full Article
    Turning Footsteps Energy into Green Electricity

Turning Footsteps Energy into Green Electricity

0 comment Read Full Article
    Warka Water: Collecting Water Out of Thin Air

Warka Water: Collecting Water Out of Thin Air

0 comment Read Full Article
    Will Boston Dynamics Make Domestic Robots?

Will Boston Dynamics Make Domestic Robots?

1 comment Read Full Article
    Will Your Next Robot Take Care of Folding Your Clothes?

Will Your Next Robot Take Care of Folding Your Clothes?

0 comment Read Full Article
    Machines Uprising: From Fun To Deep Thoughts

Machines Uprising: From Fun To Deep Thoughts

0 comment Read Full Article
    Grillbot Takes Care of the Chore of BBQ Grill Cleaning

Grillbot Takes Care of the Chore of BBQ Grill Cleaning

0 comment Read Full Article
    Roomba 980 vs Neato BotVac Connected: Review of the Two Best Robotic Vacuum Cleaners

Roomba 980 vs Neato BotVac Connected: Review of the Two Best Robotic Vacuum Cleaners

18 comments Read Full Article
    Neato Botvac Connected: The First Vacuum Robot Controlled from a Smartwatch

Neato Botvac Connected: The First Vacuum Robot Controlled from a Smartwatch

2 comments Read Full Article
    Best Wireless All-In-One Inkjet Printers with Scanner and Copier

Best Wireless All-In-One Inkjet Printers with Scanner and Copier

1 comment Read Full Article
    Drone Racing League Level 1: Miami Lights  Semi Finals

Drone Racing League Level 1: Miami Lights Semi Finals

1 comment Read Full Article
    Vacuum Robot Love Story Commercial

Vacuum Robot Love Story Commercial

0 comment Read Full Article

More Posts