May 29, 2018

Starting with Smart Robot Car Kit V3.0 Elegoo

In this post I want to share my experience assembling the Smart Robot Kit V3.0 from Elegoo. In next entry my intention is to focus in programming the car.

The guide in documentation is clear enough. The kit includes a CD with documentation and same documentation can be downloaded from www.elegoo.com. I'm not going to describe detailed steps because as I said before the documentation is pretty clear,  and if you want more visual help you even can search videos in youtube that shows every step.

This is how the kit comes, you can see all stuff comes with individual bags.



DC Motors

Very nice detail that the motors have a cable tie which holds the wires so the solder joint doesn't break.


Chasis and motors


During mounting a motor on chasis the screw didn't match completely with the hole in the aluminium block (as shown in image above), fortunately as the aluminium block has same two holes in both extremes, I inverted the side of the aluminium block so I can use the holes located in the other extreme and those holes fitted nicely.


L298N module

Here you can see the chasis with the motors and in the center the L298N module. There is no risk to make mistakes with wiring because connectors fit exactly in the proper way.



What is L298N module for?
Basically this is the driver which controls the 4 DC motors. The driver has 4 sockets for each motor, 1 small socket for power and a larger socket for control data.

Line Tracking sensor

Left image shows the sensor with the screws and right image has the chasis upside down and the sensor attached at front.



Arduino and sensor shield board

The arduino board should be attached to the top layer of chasis and the shield board goes over the arduino. The easiest way to figure out how those two boards fit is aligning the side that has two holes in image below.
 


Battery

Battery goes in rear part of the top chasis and wired with shield board.




Microservo SG90
This servo motor moves in a 180 degrees and is used to move the ultrasonic sensor to right and left in order to detect obstacles.

The Shield board has annotations in all connectors and they are numerated from 1 to 7. We want to connect the microservo in connector number 2 servo.



The connector and the color of the cable should match:
Brown = GND - Ground
Red = +5V - Power
Orange = 3 - Control signal



Ultrasonic Sensor HC-SR04

At left image the parts to use and at right image the mounted sensor.

 



Chasis

 



A tricky wiring is between line tracking sensor and shield board, because the order of the lines are different in both connectors:

In shield board connector the order is: GND, +5V, etc



In line tracking sensor the order is: +, -, etc



So the extreme of the cable which starts with red cable should go with line tracker. This is just to keep the convention of colours.

Car completed


One step I didn't mention was the bluetooth module which is a small board that is inserted in socket number 7 of shield board.

Final Comments

That's all for now. My next task is to learn about how to control all components and make a structured and maintainable code to play with the car.

As a conclusion, I found the assemble process enjoyable and frustration-free. I believe one can build a similar car buying the parts individually but you might face several problems about compatibility between components.

If you are interested in learning electronics maybe a good idea trying to build a second car with some variation and defining which components to include. If you are more interested in learning the programming part, just buy one of those kits and move forward.

March 27, 2018

Multiple JDKs

Recently I had to run a web app that I built around 5 years ago with Tomcat 6 and Java 6 in macOS High Sierra. The problem was I have Java 8 installed and used in another projects and I didn't want to change configuration files for JAVA_HOME , PATH and other stuff to point Java 6.
Thanks to this stack overflow entry, I used some tools that helped me:

  • Homebrew cask: To install mac applications
  • Jenv: To manage JDKs installed in your machine

I tried to install java7 with cask, but Oracle Java 7 is now behind a login page so no longer possible to use cask for that. I found this page where it says one can use zulu7 which is a certified OpenJDK 7 version from Azul Systems. However, I just download manually the Java 7 package from Oracle site instead.

After Java 7 installation I just added the Java 7 to Jenv:

> jenv add /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/

I went to tomcat bin directory and set up java7 to be used:

> jenv local 1.7.0.71

then, run tomcat:

> jenv exec ./startup.sh

And done!

According to this, if the tool you can execute has a jenv plugin, you could use directly the command of the specific tool, for example mvn and jenv will intercept that and set up the JAVA_HOME before the actual mvn command is executed. That's very nice.

Additional Information

Useful commands for jenv:
jenv commands
jenv help <command>
jenv versions

This is a detailed blog with similar info. Another one.

Issue with Homebrew on Mac about creating /usr/local/Cellar.

List of Casks available to install applications. 

PID Controller for Line Tracking Robot Car

In my previous entry I described my experience assembling the Smart Robot Kit V3.0 from Elegoo . Since then, I have spent some time reading ...