Category Archives: Arduino

Processing and Arduino port

Processing app that used serial method to talk to arduino need the correct port to connect with. This app can help you: processingScanner (run on 64bit computer) scanner Double check with your control panel -> Device Manager. deviceManager Device Manager show COM16 where our arduino board connected with, is match with index 0 in the processingScanner. So, the number/index to use in process is 0.

Capacitive Sensing

Capacitive sensing with arduino can easily amaze your friends as it can easily sense human touch through any conductive material such as metal, graphite (pencil drawing), or even fruits (juicy)! First of all, you will need to download and install the CapitiveSense Library from here. Restart your arduino and you should beable to see examples code likes below: capacitive example   Then, construct a circuit with arduino uno board. The resistor I using here is 10k ohm but the best would be 1M ohm. sketch_bb   You will need to upload the following sketches: Touch each end of the sensor and you should start seeing value changes in serial monitor. You may connect it with any conductive material, in this case, i choose vege and fruits. 20141201_220147 You may further enrich the output using processing + serial. The outcome:  

Checking arduino port on ubuntu

Sometime in processing, you will need to listen to the serial port that arduino attached to. Finding out the portIndex is easy on windows by simply checking in Control Panel -> Device Manager. However when you are in linux (ubuntu), you will need to use command to do it.
  1. First plugin your arduino to usb
  2. type lsusb to see list of attached usb devices
  3. type dmesg | tail and it show you which serial port your usb device bind to. In my case, it is something like: [3486.xxxxxx] usb 2-2: FTDI USB Serial Device Converter now attached to ttyUSB0
  4. or, you may also type dmesg | grep tty
  5. Then you need to figure out the index of this ttyUSB0. Ubuntu reserved ttyS0 to terminal and 1 until 31. normally ttyUSB0 means 32.
 

Arduino Clone vs FTDI

FTDI has been acting very unprofessional by pushed out a new driver with Windows Update that bricks counterfeit/clone/incompatible FTDI chips by setting the Product ID to “0000”. Here is the process that worked for me to return the FTDI chip back to its original VID:PID of 0403:6001 from a Linux (Ubuntu) computer.
  1. Plug in your bricked device.  If you run “lsusb” it should show a device at “0403:0000”.
  2. Download ft232r_prog from ft232r_prog (v1.24) and extract to a folder
  3. Install the build dependencies by running “sudo apt-get install make gcc libftdi-dev"
  4. Change directory into the folder cd /ft232r_prog
  5. Type “make” to build the program
  6. Now run “sudo ./ft232r_prog --old-pid 0x0000 --new-pid 0x6001
  7. You are done.  Unplug and re-insert your USB device and run “lsusb” again.  It should show an id of 0403:6001
However, if you just wanto use the chip on windows, you may follow this video tutorial: or https://learn.sparkfun.com/tutorials/how-to-install-ftdi-drivers/all
if somehow your USB Serial Port show a warning icon after you done all these, you may wanto follow this tutorial to set the PID from 0000 back to default 0001. http://electrohobby.es/Archivos/arduino%20nano%20fix.pdf?21e9af
  1. Downlaod FT_Prog_v3.0.56.245.zip
  2. Install and run FT_Prog
  3. Click the magnificent glass and you see Product ID is 0x6000
pid0000
  1. Click USB Device Descriptor
  2. On the right panel, select FTDI Default
  3. Click the lightning icon to Program Devices
  4. Click Program button and it will be alright.

Ordering Beagleboard from Element14 Singapore

Tried to order Beagleboard from element14 and I never expect the process can be as tedious as this. Untitled So, this is my replied to them:
Wah damn mafan… come on, it’s just a beagleboard, i not ordering uranium! I will never recommend my frens, clients and students buy this item from Element14 Sg anymore.
 
1. Yes, you may ship to either address.
2. Fuck singapore custom. ask them get from Malaysia SSM. http://www.ssm.com.my/
3. Everything is on wikipedia and google. http://en.wikipedia.org/wiki/Installation_art
  I give up on this order due to stupid people who tried to stop the earth from rotating.

Installing processing on Ubuntu Desktop

I am using Ubuntu 14.04 To run Processing, you need to have JAVA. By default, ubuntu do not come with JAVA pre-installed due to licensing issue (DAMN! These biz ppl is blocking the earth turning again). There are 2 type of java runtime you can install, one from openJDK and another one from Oracle. Processing2 at this time of writing only work with the later one. Follow this tutorial on how to install Oracle Java to your ubuntu machine. The process can take up to 3 hours if you have a slow Internet line. After successfully installed, you may proceed to download processing. I like to place my processing under /opt.  

Hall Sensor

These are the hall effect sensor i have tested out. 20140918_235432 Meanwhile, I am playing with my new nano board. But the magnet I have here is not strong enough. It need to be very close to the sensor (like 1cm). Gotto order new rare earth magnet from dx.com then. Simple code to output the analog in reading, and if less then the threshold, light the LED.   This sensor in red board is a linear hall effect sensor. 20140918_235205 Next, I try on the black board one. According to dx.com comment, this is a digital output and 10k resister is required between the 5v & signal pin. 20140919_144354 After placing the resistor in between, i getting reading of 1023 (off magnet) & 15 (with magnet). It is analog but the value only 2 state, so like the comment said, it did behave like digital. I can then use a map function to turn the value into either 0 or 1. Next, I tried another sensor that looks exactly the same like above, except the packaging label with “analog hall sensor”. with the same circuit (with resistor removed) and code, this is what i observed:
  • without magnet, ouput reading at 522
  • with magnet place in direction of the top of board, output reading range between 522- 770
  • with magnet place in direction of the bottom of board, output reading range between 522-413
Interesting! seems like it can tell at which direction the magnet is coming from.

Screen base output for Arduino

Arduino itself can be fun enough, but most installation required either screen base output while utilizing the wide range of sensor input. However, arduino itself was not design for screen base project. It works together with processing and required a external machine for this. Then, raspberry pi came out. As a mini computer, it is many time more powerful than arduino, and have a HDMI port output. Maker can code in Python and still connect to the wide range of sensor input. Other than rPi, we also have beagleboard and etc. And now Arduino is working hard to come out Arduino Tre, which can directly compete with rpi. Lets not forgot the pcDuino which was design to solve these issues. However, being a ARM base devices (same with rpi, beagleboard and etc)… we have an issues here with running processing on it directly. Processing required JAVA and it has to be oracle JAVA. Maker have tried to hack around using open-JDK and have various degree of success: Still, processing only supporting java 7. https://github.com/processing/processing/wiki/Supported-Platforms There is a thread in processing forum: processing on single board computer but it is not getting active reply at the time of writing. So in a production environment and if I insist to use processing, I can’t risk myself using an ARM-base machine. Most installation need to run 24/7. The safest way, still, is to use a SFF rig connecting arduino to talk with the sensors. Unless, I give up on processing and start writing native code like python and etc. I am getting a few pieces of gadget (rasPi B, beaglebone black, pcduino, intel nuc+arduino nano) and will experiment with them. Will post report up here then.