lunes, 20 de mayo de 2013

Full Rotation Servos - Schema


As promised, I added support for Full Rotation Servos. Here you have the Fritzing Schema. It looks simpler than the Drivers Version ( here ).

I'm testing the modified LIB using prototype 1 ( this one ). This way I will test if there is any problem using another type of Arduino. Prototype 1 has an Mega ADK, prototype 2 has a Leonardo.

I expect to finish test in one or two days, depending of the free time available... Some comments from your side will encourage me to do it faster!

Keep Doing!

martes, 7 de mayo de 2013

The motors(2)

I received a few days ago the new motors. Now I use 12 Volts, 90 rpm motors. You can see yourself in the picture the big different between the old ones (the little thing in front) and the new ones.

The new motors allow a fast movement while having a very good behavior at low speed.
I purchase these new motors directly in China here.

You can see them in action here:

The next step will be to use full rotation servos. This will ease the construction and keep the bill of materials shorter, therefore the cost of materials will be reduced. 

But this involves writing software to control them... hope to be finish this week end!

Keep Making!

lunes, 6 de mayo de 2013

1000 thanks for 1000 Visits!

I just wanted to inform you that the visitor's counter reached 4 digits this week end. Thank you all for considering this little blog good enough to click through and invest your time reading it!

I was quite busy at home lately. I will re-take full speed immediately. For the moment, I need to post another video with the new motor (higher gear ratio, slower but with more torque!), then I want to try using normal servos (software needed), then I have an idea on how to build an "El Chiapo LIDAR" that I would like to test (materials on the way to me)...

Hope to double the visit counter soon... Meanwhile, keep making!

domingo, 28 de abril de 2013

Code is uploaded to Sourceforge

Hi folks!

I just uploaded the library with comments and 2 examples to Sourceforge. You have the code here:

As you can see there, I put quite a lot of comments on the Lib file. It should be easy for you follow the code. 

I create 3 classes: 

B_Wheel: Virtual class to deal with any wheel / driver combination. 

Driver_Wheel: Class to deal with wheels commanded by a driver using 2 outputs to define direction and a PWM output.

Platform: Class able to control a 3 omni-wheel platform. This class uses an array of pointers to B_Wheel variables. This way, this class can control any kind of wheels.

I will extend this lib by providing an additional wheel-drive type: Full Rotation Servo like this one of Sparkfun. This way, 99% of wheel-drive combinations were covered.

The To-Do list is quite long: Full rotation Servo, 4 wheel platform, 2 wheel platform (not omni), incorporation of compass to control direction, LIDAR support...

If you have any question or doubt, please put an comment in this page and I will answer you.


domingo, 21 de abril de 2013

Platform 2.0

Here you have! Platform 2.0 on moving. 

I think the motors are too fast. To set the platform on moving you must request a high speed from the remote controller. Moving slowly is hard... 

Too much speed and to few torque:  I choose a wrong gear ratio (too low). I will test it with a different motor type/gear ratio to see what are the results.

I'm just adding comments to the Arduino source code to make it more understandable. I hope to be finish  this week.

Keep Reading!

viernes, 12 de abril de 2013

To be open or not to be open... that's the question

Sometimes I have discussions with my colleagues about how economics can be influenced by Open Source creations.  Basically, they consider stupid to give out know-how for free. Companies making their know-how open are throwing out value or, even worst, giving engineering for free to their competitors. When we reach the hot point of the discussion, I always mention the same history. It’s the history of a big company giving a book for free. Not  a little company, not a simple book… look:

There are a few books that dramatically influenced human history. Some of them are about religion, others about economics, politics... I would like to present you one of those books. This one is about computers.

Here you have a photo of it:

I recovered it during a warehouse clean-up in my former company.  I still have it. Please read the preface. Why did we stop to do this kind of things?

This book describes in very deep detail the first IBM Personal Computer. Standard communication protocols were explained, electronic diagrams were included, even the BIOS was disassembled, including comments!



This book helped to create a lot of parallel business, from printers to video cards, from file compressing software to anti-virus. But, most of all, it gave millions of companies, individuals and families a wonderful gift: the transaction cost of complex communication decreased by a factor of 10^n.

At that time, Apple was selling his Apple II with commercials showing it at home, in the kitchen. 

On the early 80’s, IBM was a Hardware company in a hardware world. The name of the game was “the one who grows faster gets all” (sounds familiar?) and the Pc won that first round of the game. Macintosh came a few years later. Then the mobile phone, the Ipad… The rest is history.

IBM created the XT (including Hard disc, wow!), then the AT (having mathematical coprocessor, wow again!). Mobile computing came right after. But plenty of alternative companies were struggling to deliver better & cheaper Pc’s. IBM won a huge pile of money selling Pc’s but 25 years after his creation, IBM completely left the Pc business making loses on this part of the company.

In my opinion, IBM made 2 wrong assumptions:
- They expected to be & to remain the center of a community forever.
- This community was formed by companies creating & providing hardware depending on IBM new Spec’s.  “Who cares on the software? Who knows which software will be used tomorrow? “

But once you get open, you are just one more. People care about which is the original one only for a short while, then they go for the best option.

Microsoft took over IBM by proposing a radically different paradigm. They detected that future was all about software, not hardware. And, on top of all, they didn't focus on the hardware community: they focus on end users. Computer producers were just the sales channel, not the customers. They focus on End User Companies using a nice approach: You must have our products because everybody else have them.  Do you want to share documents with other companies? Then you must pay us first!”  Brilliant: The more people entering into this Ponzi scheme now, the more people will enter in the future.

Microsoft was /is not an open company.  You get nearly nothing for free out of them. Microsoft philosophy is: “I develop, you install & deliver, they pay us”. One could think that the Microsoft /Copyright concept won the IBM/Openness one. But it is not true. Microsoft (and many other) used the Open System provided by IBM to grow.  

After earning a huge amount of money, IBM went to his real core business: let’s create information systems that help people. They went software. And Microsoft... well Microsoft will die as Microsoft.

 To be or not to be open, that's the question...   What is your answer to this dilemma?

viernes, 29 de marzo de 2013

Wiring up the elements

First things, first. We need to create a diagram of our wiring in order to prepare our job. Normally, an engineer creates wiring diagrams to indicate other people how to connect things together in the proper way. So, if I will wire myself... why shall I do a wiring diagram? 

There are a few very good reasons: 

1.- To keep track on what you did! Working a few hours per week, you shouldn't assume you will remember everything. 

2.- If you need to troubleshoot your design, you will need to check 2 things: the concept and the implementation. To visualize the concept you need a wiring diagram. 

3.- Obviously, if you need external help you need your wiring anyway.

So, do yourself a favor and create proper documentation of your projects!

If you're a beginner, I recommend you to use Fritzing. Once more, this software is easy to learn, to install and yes, it's for free! Here you have my Fritzing diagram:

CAUTION: When using library elements on Fritzing, please double check for accuracy. For example, the pin out of the Bluetooth Modem included in Fritzing is not compatible with mine. If you have a close look on the photos of real wiring you will realize the difference.

You can find the source code of this fritzing wiring here. It is not possible to preview this type of files. If you want to work with it, you must install Fritzing first and then download the file to your computer...  or you use the above picture!

Bill of materials:
1x Arduino Leonardo.
2x Motor Driver 1A Dual TB6612FNG
1x Bluetooth Mate Silver WRL-10393
3x small motors (I'm trying some different motor types. I will update this when I'm finished!)
1x Battery

4x Accumulators, to create 4,8 Volts.
1x +/- bus as explained here below.

Wiring Description:
I always create a + - bus for my projects. This is useful to power all the electronics we will install. It looks like this.

To avoid problems with the polarity, I use the 3 points plug I described here some time ago.

Bluetooth Modem: Imagine you are connecting 2 microphones with 2 loudspeakers. You must connect Data Source with Data Destination. Serial communication is the same: I connected the Tx Modem to Rx Arduino and also RxModem to Tx Arduino.

I used an "DiY plug" to connect it. This is the result

Drivers: The selected driver must receive 2 power voltages: one for the electronics and another one for the motors. I used a battery pack for the 7Volts, then I use the +5Volts from the Arduino Board to power the drivers and the modem. Here, a picture of the splitter board:

I wired together both "Stby" pins to control them with a single output. (Output No 2). 

Then I wire PWM, AN1, AN2 of motor1 to outputs 3, 4, 5. I repeat the same for motors 2 and 3 using outputs 6,7,8 and 9,10,11. I prepared the wiring of motor 4 on the driver's side, but I didn't connect it to the Arduino. 

This leaves us only 2 digital in/out's (12 and 13) available for other purposes. If I need more digital I/O's I will use alternative techniques to free some of them. But for the moment I prefer to solve the wiring of the drivers using simple techniques.

Phase 1: soldering the wiring.

Phase 2: Gluing the plugs to create a socket.

Observe that I bend the motor pins to allow me to plug / unplug them when the driver is in his socket. Believe me, it is always a help to have an easy way to disconnect motors...

Then we add the battery pack. The final result looks like this:

I needed some 2 "part-time days" to create the concept, figuring out how to put all the elements together, then soldering & wiring. So, this is something you can do in a single week end. If you are good at soldering, you may be finish in a few hours.

Wiring is finished. Now, the very interesting part of the project. The software! But you must give me some little more time for it. 

Keep doing!

sábado, 23 de marzo de 2013

Installing the main elements

The picture above shows the elements we need to fix on our wood board. Let's start with the motor/wheel.

To fix mechanical elements having not a "clear fixture point", I use metallic perforated band like this one:

I bend it in the form I need. This are probes No1 and 2 for my motors:

After some attends, it is easy to reach nearly perfect results. Here support No. 3:

As you can see, I bend the form that I need, then I saw it out of the strip.
You can purchase ready made supports, if you want. But hey, c'mon, we are makers, aren't we?

Now let's fix the elements on the board. I use metallic screws for the motor, nylon screws for the arduino board and hot glue for the rest of the elements.

I use those screws:

I  mark the holes with a hand drill, then I use a small cordless drill to make the holes. (One day I need to create an entry to describe my tools & workbench...)

We reach this:

Then, I glue the rest of the elements using hot glue. I always use plugs to connect the electronic modules. I'm not rich, so I expect to re-use them in other projects. I glue the plugs on the wood board, then I plug the devices on them. I fixed the Bluetooth modem in this way.

The final picture: 

Now, we must wire the elements, then we will upload some software on the Arduino. Things are getting interesting now... Keep reading!

miércoles, 27 de febrero de 2013

Let's go physical ! (1)

Today, we will start building the platform! The first thing we need is to create an equilateral triangle, this means, a triangle with all their sides having the same length. You can create the platform using any material resistant enough to hold the elements we will mount on it. I suggest you to use wood board. It's cheap, easy to find and also easy to work with.

To cut your triangle, I suggest you to use this diagram. First mark point P0, then draw a line. Mark points P1 and P2 at 17,32 cm left / right of P0 (yes, I know, it's a funny number). Then draw a perpendicular line starting at P0.

Mark the Center Point 10cm away from P0, then P3 20 cm further.Now you can draw the lines joining the points P2 and P3, P1 and P3. Draw the lines P2 - Center and P1 - Center too. This two lines will help you to aling the motor axes later on.

I use a thin wood board, (some 4 mm thick). I cut the board using a medium size cutter and a metallic ruler. I just mark the line with the cutter using the ruler as a support,  using a light pressure on the cutter. I repeat it 3, 4 times using every time a little higher pressure. After this, the line is market and you don't need the ruler. I make the same cut over and over, each time with a higher pressure. After 10, 12 times the cut is done!

This is the result:

As you can see, I cut the corners of  the triangle. We must do it to mount the motor & wheel there. The distance of the cut depends on your motors. In my case, I need a 4 cm cut made in this way:

The final result once everything is mounted in place looks like this:

App Inventor

I created the "Omnidrive" App using App Inventor

App Inventor is a programming environment that allows you to create simple Android Apps in an (quite) easy way. Again, it is ligth, (mostly web based) and it is for free. (So far, I didn't use any commercial Software to design my platform. I hope to reach my final target in this way too!)

App Inventor offers you 2 Shells: The Viewer and the Block Editor. The viewer is where you create the Screen of your App. Here you create and organize all the visual (and non visual) elements of your App.
The Block Editor allows you to code your app in a funny way: There is a "white piece of paper" where you put together a kind of puzzle pieces into blocks, each covering a different function linked with the elements you previously created.

But we aware of it: you cannot use this tool to create complex apps. It allows you to use all the nice hardware elements of your Android device (Accelerometer, Photo/Video Camara, Bluetooth, compass, your locations, the music player, etc...). As soon as you want to do something more than just start/stop something, things can go pretty messy. You reach a nice level quite fast, but then you get "glue on your shoes". Each incremental improvement costs you more and more...

In my opinion, a "block" where you could program directly in Java would be a plus.

A feature of App Inventor, and a real nice one, is the ability to use your own device for testing your App nearly in real time via Wi-Fi. You modify something in your computer and, after a few seconds, you can see / test your modified app directly in your device.

All in all, I recommend to use it as an start point to start programming Android Apps. You can even deliver them via the Google Play, as I did with mine!

Remember I publish the source code of this App here!

domingo, 10 de febrero de 2013

The Remote Controller App

These are the steps you should go through to use my App "Omnicontrol" to control your own system.


- An Android device with the app loaded on it. You can download the compiled application from Google Play going here.
- A Bluetooth Modem. I use the RN-42.( )
- An Arduino Board. This example works only on the Mega or Leonardo Arduinos. I explain you later why.
- A USB cable.
- Some wiring materials.
- A computer with the Arduino Software.

This is what you must do:

1.- Wire the Modem in this way. 

The red cable is connected to the +5V, the black one to GND. Be informed that the Modem will be delivered to you without headers. So, a little bit of soldering will be needed.

2.- Connect the USB cable and load the test sketch. You can find it here:
It is a very short one!

3.- The modem will blink in red at this moment, because it is not linked to any other Bluetooth source. It's normal.

4.- Switch Bluetooth on in the Android device, search for new devices and pair it with the RN-42 modem.  This is the typical step you perform prior to use any Bluetooth device. Please refer to your Android documentation & the modem documentation if you need more information on this point. The modem shall appear as "Firefly ...........".

5.- Once you paired the devices in the Android device, start there the App "Omnicontrol". Press "Select device".  A list of all paired Bluetooth devices will be presented to you. Please press the name of the Bluetooth Modem you want to connect to (Again, "Firefly........."). You will go back then to the main screen.

6.- Press "Connect". If everything went Ok, after 1 or 2 seconds, the status bar will change from Red to Green and the text "Connected" will appear. The blinking red Led on the Modem switches off and the green one goes on (As in the picture above).

7.- If you press "Power On", the App starts sending telegrams. If you press it again, you stop the transmission. Have a look on this former entry of my blog to see a video with the whole process.

8.- While the communication is on, go to your computer and open the Serial Monitor in the Arduino IDE. (Tools -> Serial Monitor). You will see something like this:

The Structure is quite simple. There are letters, then associated values:
M -> Magnitude
A -> Angle
E -> Switch is On or Off. (E = Enable). When you switch off, you will receive a single time "E0", then communication stops.
T -> Turn

I programmed the Android App in such a way that when "Power On" is false, no communication takes place. If this is not OK for you, you can easily adapt the App to your own needs. F.ex. you may use this On/Off switch to control not the Move Enable but something else mounted on your robot.

The source Code is here:
This App is programmed with AppInventor. I will comment it in a next entry.

On the other side of the comm. channel, in you Arduino real sketch, you can read the values using a simple piece of code. Like this: (This works as it is on a Leonardo. The Serial1 must be changed to Serial2, 3 or 4 in the Arduino Mega)
r =;
    switch (r)
      case 'M' : vel = Serial1.parseInt();              // Magnitude
      case 'A' : ang = Serial1.parseInt();              // Angle
      case 'E' : moveEnable = Serial1.parseInt(); // Move Enable
      case 'T' : turning = Serial1.parseInt();         // Turning

I suggested you to use an Arduino Leonardo or Mega. Both boards have at least 2 Serial ports. This way you can upload & debug your Sketch through one port, while the Bluetooth communication is working on the other. This allows you to keep everything in place while modifying & debugging your sketchs.

The Arduino UNO has only 1 Serial port used for everything, included upload your sketchs.

This means: in an UNO, if you have the Bluetooth modem connected, you cannot connect your computer. Using this board is perfectly possible, but you will need to re-wire constantly from one configuration to the other each time you upload / test your sketch. Needles to say, the above mentioned test will not work on an UNO.

Bluetooth is tricky but the RN-42 do a nice job, making things much easier as I would expect. I ordered by mistake the HID version. It can be used too, but I recommend to use the normal one, the one I indicated before.

When using the Bluetooth modem, be sure to have adjusted the proper Baud Rate in your Arduino Serial Port (default value is 115200 Bauds) and that the Modem is working in SPP mode. If you are using the HID version, you must switch to this mode before using it. Again, refer to the modem documentation to see how to do it.

I didn't test this system with other Bluetooth modems, but if you are able to open a SPP channel with the correct Baud Rate on it, it must work too.


miércoles, 6 de febrero de 2013


I just created a project in SourceForge to publish all the files of my project.

This is the link:

I look forward to your comments!

sábado, 26 de enero de 2013

Tipp 2. fixing the grippers of your third hand

When you use use a lot your "third hand" you turn the grippers to different positions quite frequently. Thus, it is possible that the fixing of the grippers wears off. They wont support in position any part / board having a certain weight. 

To solve it, I just solder them! Grippers are made on a soldable alloy. The arm is not soldable, but if you apply the soldering iron for a while, the soldering material will flow between the two parts. Once cooled, they are fixed forever!

The motor (1)

You can take 2 ways when choosing the motor. The easy one and the not so easy.

The easy one is to use a normal servomotor configured to infinite rotation (sometimes called full rotation). A normal servomotor controls the POSITION of his axis. This means, it turns until it reach his commanded POSITION. But it is possible to modify this kind of servomotor in such a way that it turns to a certain SPEED but never reaches is command position. You can do this my "fooling" the control installed into the servo. You interrupt the position feedback. Therefore, the servo keeps turning and turning but never reaches is target position.

There are different ways on how to do this. Have a look here and here.

You can also purchase a ready made continuous servo. For example here.

Working in this way allows you to directly connect the servo to your controller. No additional electronics are needed. Less wiring and therefore less complexity. This is the way I used for my first prototype.

But there is a draw backs in this approach.

Servomotors are a combination of a DC-Motor + Electronics + Gear. The included gear has a big reduction ratio. Therefore, the original motor (high-) speed is reduced to a small one at the output. This is necessary to increase the output torque of the servo. Low speed is good at the beginning as it let's you clearly see what's happening. But very soon you will want more speed.

If you purchase a DC Gear Motor, you choose the Gear ratio. So, you can select a faster or slower motor.
Have a look here to see a selection table that shows 2 motor types with different Gear Ratios.

In motor (2) I will show you the combination DC Motor + Drive. Things will be faster there!