Saturday, 12 July 2014

RC Car - Part 2

If you haven't read it, you might want to read the first part of this weekend project.

I finally got the time to continue my RC Car project. This time my goal was to control the car from my laptop. Continuing from my last design, I tried to communicate with the car via radio frequency using nRF24 module. This was an easy task as we already made a chat app via radio frequency using the same module. I used an Arduino Nano to communicate serially with my laptop, then attached an nRF24 module to it.
Arduino Nano + nRF24 module
Then for the receiver (the car), I used Arduino Pro Mini (much cheaper than Arduino Nano) + nRF24 module. Then I attached it to an H Bridge module, L298N to control the motor so it can go forward and backward. H Bridge is a module that allows you to control high current voltage in or out of the circuit. For our project, it allowed me to control the motor to rotate clockwise or counterclockwise and allowed me to power the motor (which wasn't sufficiently powered via Arduino). Finally, I connected the H Bridge with the Arduino Pro Mini and two motors.

Oh! Almost forgot the battery. I connected them with the H Bridge since we needed its high current to flow to our motors.

From left to right: nRF24 module, Arduino Pro Mini, H Bridge, awesome chassis, and LiPo battery
The last piece was the code. From my Arduino Nano (the one connected with my laptop), I read 4 serial input: w, s, a, d (I know, I'm a gamer). Then I mapped each input to binary output, then sent it to the Arduino Pro Mini. The Arduino Pro Mini would then control the H Bridge and consequently control the motors.

InputWhat It DoesOutput
wForward1010
sBackward0101
aTurn Left0110
dTurn Right1001
Anything elseStop0000

Finally, not so awesome demo:
video

My right (or left?) motor was broken after 2nd attempt so it wasn't spinning at all.

The project was depressing, but ultimately fun. If I were to continue this project, I would try throttling the speed of each motors for more stable movement and trying more sophisticated transport layer, Bluetooth. For now I'm just content that my design worked :)

Sunday, 22 June 2014

RC Car - Part 1

My friend and I were working on a weekend project. We have successfully made a chat app over radio frequency easily one weekend and decide to take the project one step ahead. Our goal was to remotely control an Arduino-brained car from the internet. The car will optionally have a live video camera that's going to be broadcasted to internet. The grand plan is something like this:

We use Arduino for the car because it's more energy efficient compared to Raspberry Pi. On the other hand we use Raspberry Pi to interface the car with internet because it's much easier to program, thus allowing us to rapidly iterate the code. Everything looks good, for now.

Problem With Connectivity


Then we realized that we might not be able to send the video over radio frequency because it's too slow. Fortunately, I have MRF24WB0MA WiFi module by AsyncLabs for our disposal. I tried to assemble it with Arduino Uno and program it with AsyncLabs' WiShield library.


It's... not working.

I tried to debug it for hours and found that it got stuck trying to execute DRV_STATE_START_CONN. Later on I found that the WiFi module is sending an unrecognizable byte: 14
Where are you "14"
To date I haven't found the solution. My ultimate goal is controlling the car, with or without the camera. But I'm still confused for why do the WiFi library fails for me. And I don't even know whether the camera will work with Arduino Nano. Will it have enough computing power? For now I'll give up on this one and probably fallback to Bluetooth for future work.

Problem With Power


Of course with my (kinda) Computer Science background I have close to zero knowledge in hardware (even though my FYP is hardware related). I unashamedly bought 15 motors from eBay, not knowing what are they for, what the working voltage is, what the required current is, what the torque is, or any hard stuff I don't even know what the meaning is. All I knew was: all motors are equal; give high voltage on one end and low voltage on the other one it will spin. I was half-wrong.

First I need wheels. I want to understand the physics behind a car as much as I can - and that's why I won't buy a ready-to-go Arduino Robot Chassis. My friend suggested an awesome solution. I "sew" this together:
Yes, those are bottle caps

I did a test run. I gave the motor a go by connecting it to my Arduino Nano. Then...

It is not strong enough


When I tried to press the wheel against a plane, the wheel was not spinning. I tried to connect the motor directly to battery. It was a lot faster than the last one. Still, it wasn't fast enough. Then I checked the documentation of the motor.



FOR HOLY GOD SAKE, it was an RC aircraft motor, not an RC car motor. And the working current is merely 0.03mA. I'm sure it's not even enough to cut a paper.

Fortunately I have some spare motors from Hubsan X4 quadcopter which seemed more reliable. I connected it directly to the battery - my hand could barely hold the motors. "Looks good," I thought. But when I tried to connect it to my Arduino, it was weak. Then I began to wonder.

What makes it slow on Arduino?


Apparently, Arduino pins only gives out 40mA of current. We might be able to increase the current output by serially combine the pins. But that's not a scalable solution. What if one day we need to power a monitor?

Then I consult the internet (which doesn't really help), then my friends. They suggested that I use transistor as a switch so the motors can be powered directly by the battery while allowing us to control the on-off logic using Arduino.


It worked! Finally, something worked. This weekend is not lost! Though I need new transistors because I just busted 3 of them.

That's for the first part of it. Hopefully we can finish this project. If you have similar experience please kindly leave comments and help us :)

Tuesday, 13 May 2014

Remaking of All Manga Mobile

Hi guys, it's been a while.

All Manga Mobile has beed suspended for almost forever and I'm super busy with life that I don't have the time to manage it. Since I'm pretty leisure right now, I can now announce that I'm in the middle of remaking All Manga Mobile. Tentatively, this manga reader is called Gogo Manga.

I'm scraping all source code from previous manga reader and its server. The server is so expensive and the revenue from the ads doesn't cut out for its operation. If you live in 3rd world country, you might notice that All Manga Mobile is considerably faster than other manga reader (except for the reader itself, sorry). It's because we do lot of awesome stuff on the server side and we'll keep it (or even improve it) in our new server.

The main feature of Gogo Manga is its cross-platform-ness. Its first version is going to be available in your browser, as a desktop app and as an Android app. You can sync all your favorite manga across platform by logging in using Facebook. But that's not all.

Sadly those who have paid for Pro Manga Mobile will not be able to easily migrate to Gogo Manga and will probably have to pay for the pro version. I deeply ask for your apology for this inconvenience.

If you have any feedback for our current All Manga Mobile / Pro Manga Mobile, feel free to comment or email me at hallucinogenplus@gmail.com. Who knows we might incorporate it in Gogo Manga ;)

Thursday, 13 September 2012

Problem (and Solution) with Mangaupdates

Hi, this is your programmer :)

Today I want to share my experience on fixing a bug on MangaUpdates. First I have to explain the bug.

We use various site to empower All Manga Mobile. We scrap manga sources from MangaReader, MangaFox, etc to manga and images. And we go to MangaUpdates for manga information. Why do we use MangaUpdates? Because it has the most reliable manga rating and status (Ongoing, Discontinued, Hiatus or Completed) in the internet. I visit MangaUpdates at least once a day!

We use Jsoup for scraping the site. Jsoup is very handy and easy to use. I've been using it for years (just 2 years actually). I will not discuss how I use Jsoup here since it will take a lot of time and page :(

The problem is: we Jsoup accept very specific charset. We can use "UTF-8", "ISO-8859-1", and "LATIN-1" as input  charset . But it will fail for something trivial like "LATIN1" or "LATIN 1." And what's worse, recent MangaUpdates, which usually give correct charset name, decide to give us "LATIN" as its charset name. In turn our server broke for days and I figured it out a bit too late. I made a hack so we won't accept any URL from MangaUpdates for a while until I had the time to fix it.

And the time came just now. What I did is basically getting the byte of the Jsoup response and parse it manually by assuming its charset is "LATIN-1" or "ISO-8859-1" instead of "LATIN." Here's some snippets

My code used to look like this:

Document mangaUpdatesDoc = Jsoup.connect(url).get();

Now it looks like this:

Connection con = Jsoup.connect(url);
Response resp = con.execute();
String html = new String(resp.bodyAsBytes(), "ISO-8859-1");
Document mangaUpdatesDoc = Jsoup.parse(html);

A bit long and inefficient. But at least it works!

Hope it helps!

Saturday, 28 July 2012

All Manga Mobile v.0.2.0

After weeks of development, we officially release All Manga Mobile v.0.2.0. This is a huge update (which is the reason it took so long for release).

Here's full changelogs:

  1. Added manga source on Advanced Search. Selecting specific manga sources might reduce your network workload significantly!
  2. Added more manga source. French, German, Indonesian, Italian and Spanish manga are now available!
  3. Changed reader significantly! This will result in very fast reading experience. This reader is in very beta phase. Please let us know if there's anything wrong.
  4. Beta offline reader. This will let you view images on one folder as manga with its navigation and things. And because it's still in beta phase, please let us know if there's anything wrong.
  5. Progress bar on reader.
  6. Pretty and more informative notification.
  7. Achievement has more info now.
  8. Faster read list loading (will be very slow first time but will be blazing fast later on).
  9. Added new scale mode.
  10. Search result fix for Android 4.0 above so the results can be sorted by name and rating.
  11. Fix more bugs.

New manga source selector. And new manga sources, too!

Beta offline reader. Open your images as manga from your favorite file browser.
And I (All Manga Mobile's programmer) learned a lot from this updates. I'll write some technical post about this later.

More features is coming up! Stay tuned!


Give us a drop at Facebook and let us know what do you think about this new version!.
Get it on Google Play

Saturday, 30 June 2012

All Manga Mobile v.0.1.4.1 released for more bug fixes

We know we're making so much update lately but we hope you are not bothered by it. All Manga Mobile v.0.1.4.1 contains more bug fixes, some performance improvement and more! Here's a complete changelog

  1. Fix some force close bug while reading manga and going to next chapter.
  2. Fix some search bug where search doesn't work when you try to exclude only one genre.
  3. Slight performance improvement.
  4. Decrease file size (All Manga Mobile is less than 1 megabytes now!)
  5. Reading on "Fit to height" mode now more fuller and better than before!
  6. Remember some annoying bug when the page just went blank without reason? You can fix that by selecting "Refresh" on reading option! (we are working on automatic fix).
Notice the new "Refresh" option 
Right now we're working on improving server performance and adding manga source for Spanish, French, Indonesian, Malay and Italian language. Be sure to keep updated on All Manga Mobile!


Give us a drop at Facebook and let us know what do you think about this new version!.
Get it on Google Play

Wednesday, 27 June 2012

All Manga Mobile v.0.1.4 released!


New version of All Manga Mobile (v0.1.4) is on market now! It includes bug fixes, slight performance improvement, new reading UI interface and new manga source: MangaHere.
You can edit your settings straight from reading mode!

Give us a drop at Facebook and let us know what do you think about this new version!.
Get it on Google Play