Tuesday 19 November 2013

BBB_Monitor: Interface for BeagleBone Black

BBB_Monitor: Amazing Management Interface for BeagleBone Black 





This article is about a management interface for the card BeagleBone Black (BBB) that I’ve developed. If you are interested in developing for a BeagleBone Black by an easy way, this article is made for you!

Usually work on a card is really hard and take much time to build something interesting. Nevertheless capacities with cards like BeagleBone Black are huge, we can do almost anything! I am very interested in the BeagleBone Black in particularity so it’s why I took the time to develop a management interface.

Why the BeagleBone Black ?

The BeagleBone Black has a 1GHz ARM processor and provides GPIO ports, ADC, PWM, and more. It’s really comparable to the Raspberry except for one thing: Raspberry's community is bigger than the BBB’s one! But I truly believe that the BBB's community has a very high potential and can easily compete with Raspberry's projects.


Now, more about the software

My software, ‘BBB Monitor’, wants to provide a single interface which regroup all IO functionalities of the BBB and which support most of common sensors and others components.

This first version of my software allow you to interact graphically with a large amount of component (detailed later in this article), I’m working on a system which exports automatically component’s values and configuration in files. So the next version will allow you to interact with component from external scripts or programs.





Please understand that this project is at his beginning, I count on your feedback to make this project stronger. If you want to get involved in this project, please read the ‘How to get involved’ part at the end of this article, and don’t hesitate to contact me.





Get it now for free !


BBB_Manager V0.1.0.a (alpha version) :

=> DOWNLOAD LINKS:

BBB_Monotor V0.1.a (Windows only for UI tests)


Default managment interfaces:
- GPIO Interface [ set I/O mode, H/L state and none/rising/falling interrupt to selected GPIO ports ]. 
- PWM Interface [ set frequency and duty cycle to selected PWM ports ].
- ADC Interface [ read values of all ADC ports ].
- I2C Interface [ read/write bytes on specific I2C address].
  
Extended component managment: 
 - Webcam support [ face tracking, color tracking, motion detection ]
- HC-SR04 Ultrasonic Ranging Module (firmware + interface) [ measure distance ].
- Generic Piezoelectric transductor (firmware + interface) [ playing RTTTL songs & tones ]. 
- Generic Servomotor manager (interface only) [ calibrate / set the rotation angle ].
  
Other functionnalities:
- XML import/export of component configuration.
  
Under developpement / Unstable fonctionalities:
- DHT11 temperature sensor
- 3D accelerometer / magnetometer manager


BBB_Manager V0.1.1.b (beta version) :

Will coming soon .... (maybe less than one month).
This next version will probably include:

- SPI
- UART
- Barometric pressure sensor
- 3D Accelerometer support
- Webcam support
- Generic linear sensor.

AUTOMATICALLY EXPORT SAMPLED VALUES AND CONFIGURATION IN FILES (LIKE WITH THE SYSTEM TREE) THAT ALLOWS YOU TO INTERACT WITH BBB_MONITOR FROM EXTERNAL SCRTIPTS OR PROGRAM (Bash/Python/C/Java).

For more informations or to help developping, please follow the "Developpers : Help me to make the project stronger ! " section.



Install dependencies

 

Java installation
First, you need to install Java on your BBB, so, they are two solutions, first one consists to use the package manager by executing the following commands into the shell :





$ opkg install openjdk-6-common

$ opkg install openjdk-6-java

$ opkg install openjdk-6-jre

$ opkg install openjdk-6-jdk

$ opkg install openjdk-6-vm-zero



If this doesn't work in case of these packages aren't in your package list (it was my case) you could follow above URLs to download and install needed package for armv7a using (wget & opkg) :


PRUSS kernel module installation
In order to use components that use PRUS (Programmable Realtime Unit Subsystem) processors of the BBB you should also install the uio_pruss kernel module:





$ opkg kernel-module-uio-pruss


Run the interface !


Now you can DOWNLOAD the last version of the manager, unzip it and copy it on the BBB using an USB key, SCP (copy via SSH) or others.

Run the script "run.sh" using terminal (may be better in case of errors or JAVA exceptions) or directly via explorer. Interface will show up! here we are.


Use GPIO (General Port Input Output) interface

GPIO interface allows you to set pin direction, set/read values and set interrupts. It use device tree, so you should use it in three steps :

  • Select the port by number or by pin (look at the picture)
  • Export the selected port into the device tree by using the button "Export to ..."
  • Now you can do what you want and save configuration by clicking "Save state"  or just refresh values by clicking "Refresh"



GPIO ports could be use to make things like make a blinking LED, read the state of a switch and so on..



Use ADC (Analog/Digital Converter) interface
 Due to the fact that ADC was already be implemented to the kernel, you just need to load the module by clicking on "Load kernel module", this will enable ADC into the device tree. After that, each seven ADC ports will be read and displayed.

You could refresh values by clicking "Refresh" or "Auto refresh" to refresh all ports automatically.


ADC ports could be used to read  output value of analog sensorsl ike temperature, luminosity or others.



Use PWM (Power Wave Modulation) interface

PWM interface allow you to set frequency and duty cycle of each PWM port. It use device tree, so you should use it in three steps :

  • Select the port by number or by pin (look at the picture)
  • Export the selected port into the device tree using the button "Export to ..."
  • Now you can do what you want and save configuration by clicking "Save state" or just refresh values by clicking "Refresh"



PWM ports could be used to adjust DC or Stepping motors speed, generate sound, make a LED blinking or others.


Use webcam interface

The webcam interface still under developpement but will allow you to:


    • Make face-detection.
    • Make color tracking.
    • Use motion detection
    • Use blob tracking algorithm
    • Take photos











      Use dedicated interface for HC-SR04 Ultrasonic Range Sensor
      The HC-SR04 interface allows you to use this ultrasonic sonar module and measure the distance between the sensor and another object from 2cm to 5m  :

      • Select the output trigger port by number or by pin (look at the picture)
      • Select the input echo port by number or by pin
      • Now you can measure the distance by clicking "Refresh" or refreshing it automatically by clicking "Auto-Refresh" button.



      The button "Show interfacing scheme example" show you an example of electronic implementation between the HC-SR04 and the BBB. 






      Use dedicated interface for  Piezoelectric transductor

      The piezoelectric transductor interface allows you to generate tones or to play songs on a speaker or piezo:

      • Select the PWM port by number or by pin (look at the picture)
      • Export the selected port into the device tree using the button "Export to ..."
      • Now you can generate a custom tone by adjusting the frequency, volume and duration or to play a sound by adjusting the BPM rate (Beat Per Minute) and volume.




      Use dedicated interface for  Servomotor

      The servomotor interface allows you to adjust rotating angle value of a specific servomotor :

      • Select the PWM port by number or by pin (look at the picture)
      • Export the selected port into the device tree using the button "Export to ..."
      • You should adjust min/max angle depending on your servomotor model (generally from 0 to 180°) and adjust each duty cycle for these min/max angle (generally from 1 to 2 ms).
      • Now you can set your angle and apply the new PWM value. 




      Find the correct parameters of a specific servomotor could take a while, so it is recommanded to export your configuration to XML with "File -> Export configuration to XML...", then import it when you need, so you would not need to find correct parameters again.

      3D Accelerometer

      This  interface is still under developpement and will allow you to:

      • Measuring magnetic field value in 3D.
      • Measuring acceleration value in 3D.
      • Measuring temperature.

      FOLLOWING SCREENSHOTS ARE FOR THE EXAMPLE, YOU WILL FIND MANY MORE FUNCTIONS DEPENDING ON THE VERSION DOWNLOADED !!


      Developpers : Help us to make the project stronger ! 



      Report your experience
      Making this software stronger only relies on you. By reporting us various bugs and incompatibilities, we would be able to fix them and go ahead !
      If you need to use a particular sensor or functionnality please feel free to send us your ideas, just try to arguing about it and we will implement some of them depending of our possibilities.
      Also we would also be very rewarded if you take the time to simply express your experience.
      You could directly contact me by mail at :
       b.jeremy.github@gmail.com

      Help us making firmwares

      If you are developper and you have developped some firmwares (no specific language is required), you could help the project by giving us the right to use your source code and to create an interface that will implement it.


      Creating new interfaces !
      I'll share you a little fact, if this project grows enough, I will share some parts of the source code, javadoc and implement the possibility to load external components / interfaces in order that developpers could easily implement their own components by using internal API and share them over the Web !
        









      2 comments:

      1. is this project still under development or is it abandoned du to the fact that BBB moved from Angstrom to debian?

        ReplyDelete
      2. Hi, the project only needs a Java Virtual Machine and the PRUSS module to work, i haven't tested it under debian but it should work perfectly on it.

        Concerning the project development, me and my colleague are involved in lot of other projects, so we don't have lot of time to improve this project, that's why we seek developers that may help us.

        ReplyDelete