[Beaglebone Black] Enable On-Board Serial UART

In order to use the built-in UART pins on the Beaglebone Black, we must first activate it.

The device name and pins is as follow:
Credit – http://beaglebone.cameon.net/home/serial-ports-uart

 RX  TX  CTS  RTS  Device  Remark
 UART0  J1_4  J1_5  /dev/ttyO0 BeagleBone Black only
 UART1  P9_26  P9_24  P9_20  P9_19  /dev/ttyO1
 UART2  P9_22  P9_21  P8_37  P8_38  /dev/ttyO2
 UART3  P9_42  P8_36  P8_34  /dev/ttyO3  TX only
 UART4  P9_11  P9_13  P8_35  P8_33  /dev/ttyO4
 UART5  P8_38  P8_37  P8_31  P8_32  /dev/ttyO5

Continue reading

Advertisements

[MATLAB] Real Time Serial Data Logger

Data acquisition is a very important part of test engineering. By plotting the data acquired in real time, we can analyze how the design behave and to determine whether it meet specs or not. Some examples of application are logging aircraft altitude and LiPo battery cells temperature. In my previous project of designing an aircraft altitude controller, the real  time data logger is a key part of the project in determining how the system perform. In that project, I used Java to program a real time data plotter and it was such a pain. The code became so messy that I do not want to look at it ever again. It took such a long time too.

So this time, I turned to MATLAB. As a 4th generation programming language, this is so much easier since it got a Serial interface and plotting function built in. In the end of this post, we should get sometime like this:

Serial Data Log Continue reading

[Arduino] Arduino to Arduino Serial Communication

In this post, we will explore an easy method for transferring data from one Arduino board to another using Bill Porter’s EasyTransfer Library. Here’s a traditional method on how you hook up Arduino’s serial ports. TX to RX, RX to TX, Ground to Ground. TX is the transfer pin and RX is the receiver pin, therefore you connect the one to the other. Finally, in order for the two device to communicate with each other, the two boards must have a common ground. Here’s the wiring I drew using Fritzing, I figured it’s probably time to be neater in describing how to hook stuffs up, lol.

Library Download Link:
http://www.billporter.info/easytransfer-arduino-library/

Continue reading

[Engineering] Arduino to Java Serial Communication 2

In this post, I will talk about using Java as a client and Arduino as a server. To keep it simple, we will only use the Arduino’s built-in LED 13. Before proceeding, please read my other post about Arduino to Java Communication through Serial Port if you haven’t already.

In summary, the only differences in the Java’s side is that we will use jSSC’s serial write method instead of serial read as follows:

serialPort.writeByte(data);

Continue reading

[Engineering] Arduino to Java Serial Communication

Arduino is awesome, but it is pretty much useless as a data acquisition (DAQ) device if we can only read the data in the Arduino IDE. I remember back in Freshman year, worked on a wireless board for my Intro to Engineering project. Back then, not knowing anything really from programming, I decided that it would be cool to make a wireless remote game controller like the Wii controller. So I dug right into it, using the manufacturer’s sample program to get the data I need, write it into a text file, import it into a game I wrote with Game Maker… omg, the errors, the lags. The TA tried to help but it was hopeless, lol. Then I did it again with the Space Hopper project, if I only know how to read Joystick data in Java…

Anyway, did a bit of coding today and this is what I got after messing around for couple hours. Most time was spent trying to get Arduino to send the data out correctly. C++ is just… not my thing. Will probably write a Java Class for it to make it even easier to use.

[WARNING: I REALLY HAVE NO IDEA REALLY WHAT I AM DOING AND SOMEHOW THIS WORKS! THIS PAGE IS JUST TO DOCUMENT MY NOTES!]

Continue reading