1 2 3 Previous Next

BeagleBone Black

63 posts

openrov 1.jpg

OpenROV open-source submarine (via OpenROV)

 

What happens when an entire community comes together to help one man discover underwater treasure? Quite possibly one of the best maker projects ever devised is born, that’s what. Meet OpenROV, an open-source exploration submarine created for the DIY community, powered by a BeagleBone!

 

The OpenROV project began when Eric Stackpole wanted to explore a cave near his home that was rumoured to have buried treasure. When neighbors got wind of his idea, everyone was willing to help (go figure). The real magic, however, began when scientists heard about the idea of creating a tiny, open-source submarine and got to thinking.

 

Makers, engineers and scientists from more than 50 countries banded together to make Stackpole’s dream a reality. Why? Because an open-source robot can be programmed to do just about anything. Scientists believe they can program the OpenROV to do everything from monitor pollution under the sea to discovering new aquatic species. Plus, Stackpole gets to hunt for gold too. It’s a win-win.

 

openrov 2.jpg

(via OpenROV)

 

The robot is 30cm long, 20cm wide and 15cm tall and it looks just like what you always hoped Scuba Steve would use during his underwater explorations. It weighs in at 2.5kg and was designed to withstand depths of up to 100m, although its only been tested at 20m.

 

openrov 3.jpg

OpenROV in action underwater (via OpenROV)

 

The DC-powered design features a single 10cm by 18cm waterproof tube that protects all electronics and equipment from water damage and it can move horizontally, vertically and diagonally with the help of three 800kv brushless motors, two horizontal thrusters and one vertical thruster. It’s also fully controllable via computer keyboard or USB controller.

 

At its heart is a BeagleBone single board computer and their OpenROV BeagleBone Cape. Does that mean they want you to experiment with their cape? It looks like it.

 

The robot is fully functional in both fresh and saltwater and moves at 1m/s. It is still, unfortunately, an energy guzzler, as it takes 8 on-board C batteries for every 60-90 minutes of activity, but improvements are in the works.

OpenROV successfully completed its Kickstarter campaign on Friday and is looking to make several improvements to the design in the near future, including more efficient propellers and better resistance to rusting caused by salt water.

There’s no word on what the final product will retail ─ it is still largely an experiment. Once the kinks are worked out it should launch for the general public, but for now if you’re lucky enough to find one you’ll have to tinker with it yourself. This does, however, grant you the freedom to program it to do your evil bidding. There’s no underwater lair you won’t be able to discover. Fight evil responsibly.

 

 

C

See more news at:

http://twitter.com/Cabe_Atwell

I just saw this: http://hackaday.com/2014/07/22/talking-beagleboard-with-jason-kridner/

 

It's a 14-channel 100Msps logic analyzer using the BeagleBone Black and no additional hardware - it makes use of the on-chip dual programmable real-time units (PRUs).

Apparently it has been used to capture sustained >100MByte sized data streams : ) And also for I2S audio data capture : ) It would be ideal for digital audio testing!

Highly impressive stuff.

 

The BBB has evolved into the universal test tool that we always suspected it could become.

Multifunction instrument based on BeagleBone Black

Probably the best way to understand the Internet of Things is to get some things on the Internet and in this article we're going to do just that.

 

icon_19938.pngWhat we are going to assemble is a greenhouse control system which will be able to monitor temperature and light levels and control the windows on the greenhouse. More importantly, at the end of it, you'll have a development platform built for further exploration. At the core of what we are constructing will be a BeagleBone Black, a powerful, small ARM-based general purpose computer which will play host to a number of Eclipse tools, run an MQTT stack for us and act as the main brain of the operation. It'll be responsible for taking our temperature and light readings and publishing them to the Internet while listening for control messages to set the greenhouse windows.

 

Some would, at this point, attach the sensors and controls directly to the BeagleBone Black (BBB). In real world implementations, it's more common to find micro-controllers in the front-line as it were, connected and controlling the sensors, servos and other hardware as they typically are more resilient to the environment, more compatible with the electrical elements and a lot cheaper. Therefore to be more realistic, we are going to attach an Arduino micro-controller over a Serial-over-USB connector though this could be an actual serial connection or a wireless connection of some description - the advantage of a USB connection for this example is that it also supplies the power to the Arduino.

 

So far, you'll need an Arduino and a BeagleBone Black to follow our build process. There are a whole range of Arduinos with different features but we recommend the ever popular Arduino Uno or the Arduino Leonardo. For the sensors and servos, although you can assemble your own collection of hardware, we are going to recommend the Grove Starter Kit Plus, a shield sporting numerous sockets and a collection of components with de-coupling chips and pre-wired with plugs for the shield sockets. This makes it great for experimentation without breaking out the soldering iron.

 

orion.pngWe're going to use Eclipse Orion on the BeagleBone Black rather than the default Cloud9 IDE as it is a development environment more capable of working with languages other than JavaScript, even if here we are using it entirely with JavaScript. The flexibility of being able to use the same tools with whichever language you decide to work in and the ability to use those tools over the Internet is a huge plus when putting together a prototype or development system.

 

The Eclipse IDE, which many are familiar with, is built as a platform for integrating tools from many different vendors in one coherent framework on the desktop. Eclipse Orion has been developed as a separate project which looks to bring that tool integration philosophy to a web-based browser-native development environment. There's actually two Orion IDE's - the project started with a Java based version with an eye on hosted collaborative development platforms while along side that, Orion Node, a Node.js based version of the system designed for a single user has emerged. The Orion IDE offers a syntax aware editor, with search tools, and a shell environment to support command-line style application building, deployment and running. The Orion Node version is also pretty compact and remarkably easy to install, making it a great way to get working on a small device remotely.

 

Beginning building

 

First though, lets make a start by getting the controller assembled. First, attach the Grove shield to the Arduino. Then, in the components you'll find a temperature sensor, a light and a light sensor  we'll get to the servo later. Plug the temperature sensors into the A0 (analog 0) port, a sideways connector on the lower left side of the Grove shield. This port and its other four siblings are able to read an analogue voltage from an electronic device making them ideal for non-digital sensors. Plug the light sensor into A1, just above A0.

 

And that's the hardware assembled:

 

hackpad.com_VCR1WLsIyOE_p.160075_1402832276223_DSC01899.jpg

 

Note that though the Arduino can be powered over the USB port from the BeagleBone it is better, especially when adding power-drawing devices like servos, to use a 9V power supply (or battery) for the microcontroller.

 

Next we'll need to be configuring the BBB and selecting the operating system. To date, most BBB boards have come with the Angstrom Linux distribution installed on the 2GB of eMMC flash storage; they are identifiable by being labelled revision A or B. Although Angstrom is a functional Linux distribution, it isn't mainstream and the BeagleBone project is in the process of switching its default Linux to an up to date Debian GNU/Linux. There's only one catch... Debian is a bit bigger than Angstrom and although it fits onto the 2GB eMMC flash, if you install the packages we will, you'll find yourself with less than 1% free space. If you have an 2GB BBB, we recommend you get yourself a Micro-SD card and install and boot Debian from that - you may also want to install Debian onto the eMMC for consistency.

Instructions on how to install Debian into the eMMC and the latest images for eMMC and SD are on the BeagleBoard.org site. You will also need to resize the image on the SD card once installed to make full use of the SD cards capacity - a guide to this is also available and, to save time, there's a quick version of the process at the end of the page .

 

As new BeagleBone Blacks labelled Revision C are starting to arrive with 4GB of eMMC and Debian pre-installed so this isn't an issue.

 

Organising Orion

 

The next steps can be carried out locally, if you've plugged your BBB into an HDMI monitor and attached a USB keyboard and mouse or remotely over a SSH connection on a network. If the former, you will still need to connect the BBB to your network. Also remember to use a USB hub as the BBB only has one USB port and we have yet to connect the Arduino we talked about earlier. If over the network, the Debian installation will be advertising itself as beaglebone.local, so all thats needed is to run ssh root@beaglebone.local to log in. (It is possible to connect a BBB to a PC over just a USB cable and ssh in, but this by default doesn't share the PCs internet connection which we'll need to install software).

 

The Debian GNU/Linux image already has an up-to-date node.js installed so what we initially need to do is install Eclipse Orion, the web-based IDE. We can do this like so:

 

root@beaglebone:~# mkdir greenhouse
root@beaglebone:~# cd greenhouse/
root@beaglebone:~/greenhouse# mkdir workspace
root@beaglebone:~/greenhouse# npm install orion









 

We'll be keeping all our work in the greenhouse directory which is why we also created a workspace directory in there. Once installed you can use npm to start Orion too, but before that, there's a small tweak to be made. We need to edit node_modules/orion/orion.conf and change the fourth line, a commented out line for setting npm_path to:

 

npm_path=/usr/share/npm/bin/npm-cli.js









 

And the last line, a commented out line setting the location of the workspace. In this case it should be replaced by...

 

workspace=/root/greenhouse/workspace

 

... though this could of course be any directory.

 

Save the file and we're ready to start Eclipse Orion:

 

root@beaglebone:~/greenhouse# npm start orion

 

Go to your browser and browse to "http://beaglebone.local:8081/" if accessing remotely (localhost:8081 if local) and you should be greeted by the Orion user interface.

hackpad.com_VCR1WLsIyOE_p.189956_1403513024589_orion-ui.png

The icons at the left hand side set the view in the Orion IDE, the pencil shows the workspace and other directory/file views, the magnifying glass takes you to a search centric view and the rectangular icon, representing a console session, gives access to the Orion shell.

Getting Firmata onboard

 

We now have the hardware for the sensors assembled and an IDE installed on our BBB. The next step is to bring connect them and for this we are going to use Firmata, firmware which implements a generic protocol for talking between host computers and micro-controllers. In many ways, it's the software equivalent of the Grove kit we are using as it makes it easy to work with controllers.

 

You can install the Firmata firmware using the Arduino IDE. At this point you have a choice - you can install the Arduino IDE on a PC, Mac or Linux box and use that or you can install it on the BeagleBone Black. The latter course of action will require you to have a screen or a remote X Windows session configured as the IDE is a GUI application. Install the IDE with sudo apt-get install arduino

 

The former approach, installing the Arduino IDE on a PC, Mac or Linux system, is often quicker as you'll only be doing this once in a while. You can download the software from the Arduino downloads page  we recommend the Arduino 1.5.6-r2 beta or later  and follow the installation instructions.

Whichever route you take, once the Arduino IDE is running, select File » Examples » Firmata » StandardFirmata, select the Arduino board and USB/serial port it is connected to the IDE host machine with in the Tools menu and then click the compile and upload button (the tick and the right arrow in the Firmata sketch window). When this is complete, your Arduino board will understand the Firmata protocol and you can plug the USB cable back into to the BeagleBone Black and we can take control of our Arduino board.

 

Back to Orion

 

We can now return to Orion in the browser and start creating some code. Over on the left hand side of the browser are a pencil, magnifying glass and a terminal window. The pencil lets you view, create and edit projects, the magnifying glass lets you search in various ways and the terminal gives you access to a shell. It's this shell we want to go to next because we have Firmata support on the Arduino and need software to communicate with it.

Johnny-Five is such software, developed for Node.js to enable robotics development. Its big feature is that it allows a programmer to work in terms of LEDs, Buttons , Sensors and Servos rather than high/low pins and it simplifies the process of managing them.

To install it, we use npm as we did earlier to install Orion, but now we can run it from within the shell. Go to the text field at the bottom of the Orion shell view and type:

npm install johnny-five

It'll look like this when it's done installing:

 

hackpad.com_VCR1WLsIyOE_p.100400_1404211483449_Screenshot 2014-06-28 11.37.40.png

 

Click on the pencil to get the file view back and select from the Orion menu File » New » Project » Basic and enter greenhouse as our new project's name. This will move us into the directory for the new project in the viewer. Now select File » New » File and create a file called greenhouse.js.

 

hackpad.com_VCR1WLsIyOE_p.100400_1404215568626_Screenshot 2014-06-28 11.38.52 (1).png

 

We can now start entering some code. First of all, we need to tell Orion's IDE that we're writing Node.js code and not to warn about common Node.js commands and classes. This is done through a jslint directive in a comment:

 

/* jslint node:true */









 

Now we need to bring in the Johnny-Five library. At the core of Johnny-Five is the Board abstraction in that we talk to a Board. We'll create that at the same time as bringing in the library:


var five = require("johnny-five"),
board = new five.Board();









 

When the program starts and the Board is created, the library will begin to negotiate with the Firmata enabled Arduino and will reach a point when its ready to start doing some work. We want to capture that "ready" event...


board.on("ready", function() {










The first thing we want to do is monitor the temperature sensor. We want to read the temperature once a second and, if you recall, we attached the sensor to A0. In Johnny-Five, we just have to tell it about that sensor like so:

 

    var tempsensor = new five.Sensor( { pin:"A0", freq:1000 } );


This freq(uency) means that every 1000 millisecond, or second, the sensor will be read and a data event fired. We now want to capture that data event by directing it to our own callback:

 

    tempsensor.on("data", function() {


The event comes complete with a value for the reading (this.value) and we can use that to calculate the temperature by first working out what the resistance of the temperature sensor is and then converting it to a temperature using a formula based on the sensor's data sheet. (See this wiki page on the sensor for more).

 

        var resistance=(1023-this.value)*10000/this.value;
        var temperature=1/(Math.log(resistance/10000)/3975+1/298.15)-273.15;









 

For now, we'll print the result to the console and end the tempsensor callback and the program's code.

 

        console.log("Temp:"+temperature);
    });
});





 

Once we have selected File » Save to write the code to disk, we now have a program ready to run from the Orion shell. If we switch to the shell using the sidebar and click into the command entry panel at the bottom, we can begin typing. The shell will attempt to autocomplete for many things. Type "no" and it will suggest "node". To accept that suggestion, press Tab. We want to start a Node.js program, so type "st" and autocomplete will suggest "start", again press Tab to accept. At this point you can enter a filename but the shell is already anticipating that and will be offering filenames from the current directory; select greenhouse.js from the list and hit return.

The program should start running and, after initializing, start printing readings from the temperature sensor.

 

hackpad.com_VCR1WLsIyOE_p.100400_1404215609798_Screenshot 2014-06-28 14.07.34.png

 

To stop it running, go to the command panel and enter node stop at which point the shell will offer process ids you can stop. There should only be one at this point so select that, hit Return and the process is stopped. We are now reading the sensor, the next step is to get that information out to the world.

Going MQTT

 

We're going to use the MQTT messaging protocol to send our data out. MQTT is built for this kind of task because it's lightweight and flexible. For this part of the example, suffice to say that with MQTT you can send messages with tags to what looks like (but isn't) a file-system hierarchy on a server. To make life easier, Eclipse runs a sandbox server at iot.eclipse.org so we'll use that as the MQTT server. What we need is MQTT support so go to the shell, make sure you are in the top level "Orion Content" directory (if not enter cd .. till you are) and then enter npm install mqtt to install the Node.js MQTT library.

 

hackpad.com_VCR1WLsIyOE_p.100400_1404215664783_Screenshot 2014-06-28 14.23.04.png

 

After that's installed, return to Edit view and bring up greenhouse.js. After the require for johnny-five we want to add code to bring in MQTT and connect to the Eclipse sandbox...


 

var mqtt = require("mqtt"),
client = mqtt.createClient(1883,"iot.eclipse.org");









 

 

And that's a basic connection set up. Now we need to publish our temperature data. After the console.log we'll add this line...


 

client.publish("greenhouse/mygreenhousename/sensor/temp",temperature.toString(), { retain:true });

 

 

The first parameter is the topic, a file-system-like path - greenhouse/mygreenhousename/sensor/temp but don't make assumptions about it working like a path; it's more of an informal hierarchy of names. This first thing for us though is to change mygreenhousename to something that is unique to you to avoid colliding with other users on the sandbox who are also following this article. Now we have the 'greenhouse' and your own name for that greenhouse. Beneath that we have sensor where, going forward, we'll put all our sensor data and beneath that a temp element where we'll post the temperature data.

 

The next parameter is us converting our temperature to a string before posting to make it more readable; MQTT doesn't have any rules for what is called the payload of a message so it could be binary or an image. We've gone with the good old string because we'll want to read it later when testing.

 

Finally we set an option, "retain" to true to ask the server to hold onto the value for any other client that requests the data. If we don't set retain, the value will be broadcast to any client listening for it at the time but it won't be available for clients that connect after the broadcast leaving them to wait. While we're pushing the temperature out every second, we may want to only do that when it has changed and that may be an indeterminate amount of time.

 

Save this code, return to the Orion shell and start the program again. It should start as it did before, but now, if you open a new browser window and look at http://eclipse.mqttbridge.com/greenhouse/mygreenhousename/sensor/temp you should also see that same temperature reflected on the Eclipse sandbox. The eclipse.mqttbridge.com site also monitors to iot.eclipse.org MQTT server and makes debugging easier by allowing you to browse the various MQTT topics that it sees appearing on the server.

 

Now we know that's working, you may want to go back and delete the console.log line.

Let there be light (sensor)

 

We've only done the temperature sensor, but it should simple to add support for the light sensor and it is. After the temperature sensor handler we can add


var lightsensor = new five.Sensor( { pin:"A1", freq:5000 });









To map the light sensor and get it sampled every five seconds and then send that sampled value to the MQTT server like so...


client.publish("greenhouse/mygreenhousename/sensor/temp",temperature.toString(),
{ retain:true });









 

And with just those few lines, if you re-run the program, you'll be transmitting light and temperature data. The process for adding more sensors follows this basic pattern though you can, for example, cut down on bandwidth by only updating when your code detects a change locally or using some other logic. As before, if you browse to if you browse to http://eclipse.mqttbridge.com/greenhouse/mygreenhousename/sensor/light you should see

Moving on

 

In our virtual greenhouse, we are getting the temperature and light readings, but we aren't able to take any action on then like opening the windows. For that you'll need a servo to attach to the window control. If you look in the Grove kit, you'll find one along with all the basic mounting gear. Don't worry about mounting it to anything yet, just take a Grove cable and plug it into digital port 3 (D3) which on most Arduino's is the first digital port that supports PWM (Pulse Width Modulation, useful for controlling servo motors).

 

With the servo installed we can now add some lines to greenhouse.js to control the servo. We'll add this code immediately after the light sensor code. We start by declaring we have a servo on pin 3.


 

var servo=new five.Servo(3);
servo.center();









 

 

Servo motors typically take a value from 0 to 180 and move to that angle. We are going to get the value for the servo via the same MQTT server we are publishing our temperature and light readings to. We will be listening from someone broadcasting a new setting under the greenhouse/mygreenhousename/commands/servo by using the MQTT library's subscribe command.


 

client.subscribe("greenhouse/mygreenhousename/commands/servo");

 

 

Now, when anything happens in that topic, an event will be triggered. We can capture this by waiting for the "message" event...


client.on('message', function(topic,message) {
    console.log("Got topic "+topic+" with "+message);









 

We get the topic value because you can actually subscribe to multiple different topics and wildcard topic names in subscriptions - getting the topic name lets us make decisions based on what particular topic generated the message. For now though, we're only subscribed to one topic so we'll assume that's a servo control message. We can now process the message and we'll keep it simple and just parse whatever's arrived as an integer.

 

    var val=parseInt(message);
    if(val<10) { val=10; }
    if(val>170) { val=170; }
    servo.to(val);
});









 

We also map it into a tighter range (as servos can be mechanically tetchy at the ends of their ranges) and then we tell the servo to move to that position. And that's it. If we run this version of the code, nothing will happen with the servo until we post a value to the iot.eclipse.org server. Again the eclipse.mqttbridge.com server comes to our aid. We can use curl to send a value over HTTP to it like so:


 

curl -X POST --data-binary "100" http://eclipse.mqttbridge.com/greenhouse/mygreenhousename/commands/servo

 

Beyond the servo

 

Of course you could always write another node.js client (or use other language) to monitor the temperature and light levels by subscribing to those topics and control the airflow by publishing new servo positions.

The combination of Eclipse Orion, Johnny-five, MQTT, the BeagleBone Black and Arduino make for a formidable set of tools when setting out to explore what you can create for the Internet of Things. And you can of course add more sensors and control more devices, or take the BeagleBone out of the equation by adding ethernet or Wi-Fi to the Arduino and porting the JavaScript Node.js code to run on the Arduino itself. Or add a meshed wireless controller and use the BeagleBone to coordinate that mesh of devices... and even run the MQTT server on the BeagleBone and...

 

Just add imagination and the Internet of Things is yours!

Final code

 

/*jslint node:true */

var five = require("johnny-five"),
board = new five.Board();

var mqtt = require("mqtt"),
client = mqtt.createClient(1883,"iot.eclipse.org");

board.on("ready", function() {
    var tempsensor = new five.Sensor( { pin:"A0", freq:1000 } );

    tempsensor.on("data", function() {
        var resistance=(1023-this.value)*10000/this.value;
        var temperature=1/(Math.log(resistance/10000)/3975+1/298.15)-273.15;
        console.log( "Temp:"+temperature.toFixed(2) );
        client.publish("greenhouse/mygreenhousename/sensor/temp",temperature.toString(),
                    { retain:true });
    });

    var lightsensor = new five.Sensor( { pin:"A1", freq:5000 });

    lightsensor.on("data",function() {
        var light=this.value;
        client.publish("greenhouse/mygreenhousename/sensor/light",light.toString(),
                    { retain:true });
    });

    var servo=new five.Servo(3);
    servo.center();

    client.subscribe("greenhouse/mygreenhousename/commands/servo");
    client.on('message', function(topic,message) {
        console.log("Got topic "+topic+" with "+message);
        var val=parseInt(message);
        if(val<10) { val=10; }
        if(val>170) { val=170; }
        servo.to(val);
    });
});









New BeagleBone Black Case for the Embedded industrial application of users. This case has followed on from the popular Raspberry Pi DIN rail case which saw many users across Europe and the US using these for industrial use. The modulbox is a DIN mounting enclosure which has been designed according to DIN 43880 to meet the needs of a number of applications including heating & lighting control and energy metering. The case is made from UL94V-0 moulded plastic.

 

The box measures (HxDxW) 90.5x62x68.1mm

 

Available at 25.041EN00.BGB - HITALTECH - MODULBOX, 4M KIT, BEAGLEBONE BLACK | CPC

IMG_20140623_162344.jpg

IMG_20140623_162357.jpg

IMG_20140623_162409.jpg

IMG_20140623_162420.jpg

shabaz

BBB - PRU C compiler

Posted by shabaz Apr 30, 2014

Nice bit of information at this TI URL:

(My underlining below):

 

PRU Development

The Programmable Real-time Unit (PRU) is a low-latency microcontroller sub-system comprised of two or more 32-bit RISC processors, local instruction and data RAM, local peripherals and an interrupt controller. The PRU is efficient at handing events that have tight real-time constraints. The PRU is also known as the Industrial Communications Sub-System since it is used to enable industrial protocols such as EtherCAT®, EtherNet/IP™, PROFINET, PROFIBUS, POWERLINK, SERCOS III, and others. Each 32-bit processor runs at 200MHz, enabling 5ns instruction cycle. Local peripherals within the PRU sub-system include UART, eCAP, MII_RT, MDIO and IEP. The PRU’s fast input and output pins enable detection and reaction to I/O events within two PRU cycles.

Code Composer Studio provides a C compiler enabling users to add differentiation to their products.

 

(Downloading now! )

 

bbb-pru-c.png

I've previously had great results connecting Adafruit 8x8 LED matrix displays to the BeagleBone Black via I2C:

 

I decided to try out the Adafruit bi-color 8x8 LED matrix and hooked it up with the same I2C pins as before.  You'll need to setup the Adafruit_BBIO Python library if you haven't already:

https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/overview

 

You'll also want to grab the Adafruit Python libraries for the Raspberry Pi since they work on BeagleBone Black, too:

https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code

 

Here is the BegaleBone Black running the demo program ex_8x8_color_pixels.py from the repo:

https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code

 

BeagleBone Black & Adafruit 8x8 bi-color matrix

https://www.youtube.com/watch?v=vnHC6bVj5bc

 

I thought it would be interesting to plot the readings from a sensor over time on the matrix with different colors representing the magnitude of the reading:

20140116_104027.jpg

 

I hooked up a pot to the analog input to simulate a sensor.  Here's the Python script:

https://github.com/pdp7/beaglebackpack/blob/master/plot.py

 

It is Invoked by this shell script so that PYTHONPATH will be set:

https://github.com/pdp7/beaglebackpack/blob/master/plot.sh

 

BeagleBone Black: plot analog sensor on Adafruit bi-color LED matrix

https://www.youtube.com/watch?v=QQNqxHQDj5E

 

Cheers,

Drew

http://twitter.com/pdp7

Introduction

This post briefly documents a BeagleBone Black (BBB) based music box. If you’ve ever wanted a Sonos system but (like me) felt they were a little expensive, then it is worth considering using a compact Linux platform like the BBB for creating something slightly similar. I feel the sound quality is not leagues different (better nor worse) than some more expensive commercial offerings.

finished-front.jpg

It was a quick, fun project and costs about £100 including the cases and the BBB.

The idea for this project was simple - a compact box that connects to the home network and allows the ability to send it music to play (or it can play music stored on-board or on a server). The documentation provides just an overview because the circuits are already documented, and every implementation could be slightly different depending on end user needs, speaker enclosure, etc.

Here is the rear view:

finished-rear1.jpg

 

Shown below is a video of it in action. The sound was recorded from the camera in-built mic so is not representative of actual sound quality. For actual sound quality, refer to the MP3 recording here, which was captured by connecting the headphone output (not line output) directly to an ADC and captured by the PC.

 

Components

The main bits and pieces are the speaker box, the BBB and a DAC/amplifier.

Although a BBB and home-built DAC/amplifier was used, a Raspberry-Pi and Wolfson audio card could be used too, for a similar price.

The home-built DAC and amplifier is easy to assemble; it uses medium-sized SMD components that are hand-solderable, and gives results similar to a Meridian DAC which uses the same chip (a Texas Instruments ic). Full circuits and information are at these two locations: part 2 has the schematic, and part 1 has some more technical detail.

There are plenty of other DACs available including pre-built ones. A search for “I2S DAC” will reveal ones that should be suitable (I have not tried them) – this ebay example is just over £10. (Note that you may require a logic inverter, see the comments sections in the links earlier).

 

The speaker is a Tivoli Audio speaker. It is possible to get these in new condition for about £15-20 frequently on ebay, in various color options. Any speaker enclosure would have been fine. The official Tivoli webshop sells new speakers (slightly different model) from £39 upwards.

 

Design and Implementation

The DAC board was mounted inside the speaker, and the BBB was mounted outside. This allows access to all the BBB ports while making the minimal amount of holes in the Tivoli speaker (Speakers are sealed for good audio reasons).

It won't replace main home music systems but that was not the intention, nor is it stereo (that capability is easy to achieve by adding a second speaker connector, but I didn't require it). This is more a bedroom or home study one-box sound system.

 

Step 1: Fit BBB inside a case

The first step was to get the BBB into its own case. I connected a push-switch to safely power on/off the platform. I also wired up a DB9 connector to interface to the DAC.

case-open.jpg

I used L-shaped single-in-line header pins to solder up the connections and heatshrink at the DB9 connector end. The switch and LED were wired up to the power switch pin on the BBB and to the 3.3V supply (via a 100 ohm resistor) respectively. The push-switch is wired to the P9 header, pin P9_9 and to ground (pin P9_1). The LED 3.3V supply can be taken from P9_3.

 

The photo below shows the LiPo battery fitted. I used a paper sticker on the underside of it, to insulate it further. The BBB doesn’t run hot, but the battery could have a spacer between the PCB and itself if desired.

battery-fitted.jpg

Here is the finished result, powered up. It can be safely powered down by pressing the button again (this feature is by default in the current Debian image).

single-cased.jpg

The other side of the case provides access to the USB port, and a small USB WiFi adapter was fitted. I have not got round to finding a software driver for it yet, so for now I just used Ethernet.

 

Step 2: Speaker modifications

The next step was to put the BBB aside and work on the speaker and DAC. The speaker was opened up, and the wadding was removed and stored in a plastic bag to prevent dust and drilled fragments of plastic getting on it. The speaker cable was chopped and discarded, and the grommet removed.

speaker-first-opened.jpg

The DAC board was fitted with L-brackets http://uk.farnell.com/jsp/search/productdetail.jsp?CMP=i-ddd7-00001003&sku=1466881 and the speaker rear cover was marked up for drilling the holes to secure it, and for the headphone and line jack outputs (3mm holes for the screws, and 6mm holes for the jacks).

l-brackets.jpg

The photo below shows the finished result.  The jacks are rather recessed. This is actually no problem for some headphones (e.g. a pair of low-end AKG I own) but others will have problems. I plan to drill to a recess with a larger drill bit to 7mm and it will cover both of my sets of headphones. Note that you want to make the holes as small as practical.

dac-mounted.jpg

After wiring up the DAC to the speaker, the wadding was placed back in position and the cover was closed up again as shown below. Then the DB9 matching connector was soldered (wires protected with heatshrink). I didn’t bother with a cover for it.

rear-before-securing.jpg

After testing, the hole needs to be sealed (perhaps with epoxy resin glue).

Finally, the BBB was attached to the speaker (rubber feet and adhesive foam pads can be used).

 

Step 3: Try it out!

This step was the easiest.

Plug in the power supply, power up and install the audio player software:

sudo apt-get install mplayer




Then, try to play a music file (either from local storage or from network storage):

/usr/bin/mplayer -ao alsa -volume 10 “songname.mp3"




 

Summary/Next Steps

A quick and simple sound system was created. With a pre-built DAC and amplifier, the hardware implementation can be extremely easy.

There are plenty of software options for creating a library of songs and providing an interface for the user to select something to play. I have not tried them. For now I will just use SSH to select music. Eventually the hope is to create a simple browser based app that will allow one to upload MP3 songs from a PC or mobile phone for instant playback. A wake-up alert in the morning with a random song, or the news, will be a good option too (enabled via browser on mobile phone).

shabaz

BBB - Logic Supply BB100 Case

Posted by shabaz Feb 19, 2014

The Logic Supply BB100 case has be available for a while (also in black), I purchased one recently while buying other gear, these were my thoughts on it

(pictures were from a cameraphone so apologies for the quality - better images at the Logic Supply website of course).

board_inserted.jpg

 

If you need your BeagleBone Black boxed up, there are worse ways. I thought it was very well made and quite flexible. The cover can be mounted at three heights, to accomodate capes (the gaps can then be used for wires and ribbon cables for example. I will probably fit the Olimex 1400mAH LiPo inside it too as shown here.

 

The case is steel (not aluminium) and in my opinion is extremely accurately cut and shaped. The case has sub-millimeter accuracy. The base and shell are less than a millimeter thick, yet extremely tough because of the choice of material.

 

All connectors are spot-on centered into their holes and the tiny narrow microSD card slot doesn't scrape or touch the card at all.

 

The board is held in place with four screws on permanently fitted metal stand-offs. The finished result is about the size of a pack of playing cards.

interior.jpg

 

The exterior finish is a matt type, slightly roughened surface so not gloss shiny/smooth. I think the finish is great.

Initially I wasn't a fan of the D-Sub connector punch-out (I don't like using this connector for serial connections although it is a standard) but I now think it is a great idea, since it can serve as the I/O for 8 pins or more if a serial port is not desired. On the other side there is a circular punch-out ideal for coax shaped connectors or for a switch for example (approx 6.5mm dia hole measured with a ruler). These punch-outs mean that for many use-cases one may not need to ever drill any holes in the case.

Very narrow slots allow for all LEDs on the board to be visible.

case-closed.jpg

 

Lots of spare screws are supplied in two sizes; the flush ultra-tiny ones shown in the photo earlier, or slightly larger pan-head. By only fitting two screws, the lid can become hinged.

The rear has punch-outs for providing screwed attachment to another surface, or thin vertical slots can be used for fitting to a metal chassis. Really nice engineering everywhere on this case.

Four thin rubber feet are supplied for optional fitting.

The case is not cheap but metal cases usually do cost more, and so this case is fairly good value for money especially if you want a case you can use as part of a demonstration for example.

Postal cost is quite low in Europe for this case shipped from Netherlands, so that helps too.

 

As a summary, the case is very nice and practical, and I think it is worth the cost.

(BBB - Building a DAC part 1 can be found here).

Part 3 implements a complete design in an enclosure for a Sonos-like solution.

Introduction

The BeagleBone Black (BBB) has a digital audio interface and this was explored slightly in an earlier post.

The findings from that prototype were used to construct up a DAC board and it is described here. The aim was to have a relatively simple, easy-to-assemble board designed for portable use (headphone or small speakers) but with at least iPod-level performance. The circuit is described here and the complete schematic is attached to the post. The entire circuit connects to the BBB using 6 pins and needs no separate power supply. This is a recording using just the microphone from the camera - actual audio quality is much better.

 

For a better quality, the audio from the prototype can be heard in this zipped mp3 file. This was directly recorded from the headphone output so that it is more representative of what the user will hear (the original track that was played through the DAC was downloaded from Amazon, for comparison purposes).

dac-board.jpg

 

Detailed Description

This is the functionality on the board:

dac-layout.png

The DAC integrated circuit and headphone amplifier portion were left unchanged from the part 1 prototype although the DAC was replaced with TI’s PCM5102 which is pin-compatible with the earlier PCM5101A. The PCM5102 device is used in commercial DACs such as Meridian’s Explorer.

The remainder design is kept simple too. Three regulators are used to supply power to the DAC (can be reduced to one to save costs, or replace with the lower cost pin-compatible TC1015-3.3):

supply-schematic.png

An optional speaker output was desired, and the selected device was LM4861 which can run from a single low voltage supply and offers over 1W of power. This is enough to provide loud volume for home use (in the video above, the single mono speaker was a couple of meters away and the audio was played at a volume setting of 15 on mplayer). The circuit uses two of these for stereo, although only one needs fitting for mono summed speaker output (the photo above shows only one populated). The LM4861 input is driven from the headphone output, not the line output, to keep line output and headphone outputs as distortion free as possible.

speaker-amplifier.png

The speakers are muted using the LM4861 shutdown pin driven from the headphone socket built-in switch.

shutdown.png

The board was tested with headphones, a small 4 ohm speaker and a larger home speaker. Sound was as expected, and there are no known issues although more testing needs to be done. The board runs cold unless driving a speaker, in which case the LM4861 which is intended to be run without heatsinking in normal temperatures, would perhaps benefit from a tiny heatsink such as this one. The BBB image that I used outputs 16-bit audio at 48ksample/sec (i.e. the sound is as good as a regular CD player), but the DAC will work at higher resolution and sample rates for those with recordings that would benefit from it. The board was tested on an older Angstrom image and a Debian image. There are discussions in the comments section in the earlier post describing current ongoing exercises to get drivers working for different settings.

 

Summary

The described circuit is low cost and provides hopefully nice performance. The complete schematic and parts list is attached.

pbax

BB-VIEW free pins?

Posted by pbax Feb 3, 2014

Maybe I've missed something, but which pins on the BB-VIEW P1 and P2 are not used by the display? I can't tell from the user manual...

The wonderful Trammel Hudson of NYC Resistor posted the BeagleBone cape PCB to connect the BeagleBone BlackBeagleBone Black to the Adafruit 16x32 RGB LED matrixAdafruit 16x32 RGB LED matrix to create the dazzling Octoscroller:

i.png

OSH Park ~ Octoscroller v2

 

Just ordered updated Octoscroller boards. OSH Park has an awesome zero-friction Eagle CAD to PCB production process.

Drives up to eight chains of 32x16 or 32x32 LED panels with a Beagle Bone Black.

 

Wondering what the Octoscroller is?  Check out Trammel's excellent blog post:

 

Octoscroller » NYC Resistor

Hexascroller has been a central fixture at NYCR for the past few years, with a few ups and downs. It’s replacement, Octoscroller, improves on our classic message alert polygon by having two more sides and two more colors of LEDs.

The brains are a BeagleBone Black running the LEDscape custom PRU firmware. The AM355 CPU in the BBB has two separate realtime microcontrollers built into its die, both with full access to the GPIO lines and cache coherent access to main memory. This bit of hardware/software allows the user application to simply render into a frame buffer, which is then driven to the panels by the PRU.

9702197818_9e7ac1aa82_z.jpg

 

cheers,

drew

http://twitter.com/pdp7

Introduction

There are many compact LCD and OLED displays available, but the documentation tends to be poor. This is just a quick post to record a working configuration (circuit and code) to get a compact OLED display working. A 160x128 OLED display was selected, model DD-160128FC-1A (Farnell code 1498857, also available from Newark). It is a very high quality display.

snoopy.jpg

The display is an Organic LED (OLED) type. For interfacing a similar-sized LCD display, see here.

The code that was written is targetted for the BeagleBone Black (BBB) but can be very easily adapted for any platform. For the BBB, it uses an I/O library called iolib (see here for more details) intended for quickly prototyping a solution. The library code is already included in the zip file attached to this post.

 

The code is prototype level – ideally it would be rewritten to use faster interfaces (e.g. SPI, or PRU processor), but it runs fast enough for many use-cases - with the current code the display update rate is more than sufficient for text information and simple diagrams. Perhaps 30 updates per second are possible with the current code if the entire screen is not being refreshed.

 

The code has a few graphic commands but not much – it is an easy matter to use one of the many existing third party graphics libraries if anything beyond simple text/graphics is required.

The current code has just these capabilities:

  • Point plotting
  • Line plotting
  • Rectangles (filled, unfilled, bordered)
  • Scalable Text
  • Graphic image read from raw file into RAM
  • Graphic image display from RAM

 

Display Dimensions and Notes

The display has a Densitron code DD-160128FC-1A. The screen has the label “UG-6028GDEAF01” on the rear. A connector by Omron (Omron code XF2M35151A  Farnell code 1112561) should fit.

Shown below is a diagram from the datasheet. The screen is very thin (about 1.5mm). There is an in-built controller (Syncoam SEPS525) located in the hatched purple area. The display is organized such that memory address 0 is top-left (where the round blob is shown) like most displays. Personally I prefer to have the origin at bottom-left, so the code uses that reference point as (0,0) instead of top-left.

tech-drawing.png

 

Example Images

These photos were taken in a brightly lit room. The screen appears bright, sharp and has a more rich/saturated quality than LCD displays:

alarm.jpg

 

This animated character is drawn at position (0,0), since co-ordinates are taken from bottom-left in the attached code:

sfighter.jpg

 

An example menu. A circuit board could have buttons to the side:

demo1.jpg

 

Video

Note - The photographs are more representative of what the display looks like in action. The image quality appears extremely bright and sharp when viewed in person – about the same as a mobile phone

The video clip here is only really useful to show the update speeds for the current code. The pulsing/flickering and horizontal banding visible in the video is not apparent in real life.

Click here for the video- having real trouble with it, it is from a camera I don't normally use and the quality is pretty bad - sorry. The final animation is actually quite smooth in real life.

 

Circuit

There is an optional demo board available, but it is quite basic; it has no active components, it is almost just a breakout board. The demo board was intended to speed development up, but the datasheet slowed things right back down again - the datasheet from Densitron is poor and has many errors (they have taken absolutely no care to review it).

This is the required circuit to get the display working in a serial mode:

oled-schematic-main.png

 

An appropriate connector shown here (Farnell code 1112561) should be compatible (35 way, 0.5mm pitch) but was not tested.

 

The display requires a low voltage supply (3.3V max) which matches what the BBB offers. A higher voltage (13V) supply is also required. I didn’t have any appropriate IC over the holiday period, so a Maxim MAX734 was used, with some resistors used to adjust the voltage to 13V. This is not recommended since it is outside the specification of the MAX734, but the circuit is shown below since it worked for the prototype. It is recommended to use a different circuit.

oled-schematic-supply.png

Once assembled, the circuit was connected to the BBB as indicated in the schematic. The 0V, +3.3V and +5V supply rails were powered directly from the BeagleBone, using the BBB header P9 pins 1, 3 and 5 respectively.

 

Software

The code is attached to this post. It is written in C. Refer to the file ‘oled.c’ to see the functions available. The main function currently also resides in that file. It runs five demonstrations when executed.

 

To use it, create a folder off the home directory (/home/root in my case):

mkdir –p development/oled
cd development/oled





The path will now be /home/root/development/oled

Copy the files into this location, then type the following to compile the code:

make install





The demo can now be run by typing:

./oled





 

Summary

It would be worthwhile creating a board for this display, and using it for small projects with the BBB where a high quality image is needed. A good amount of information can be represented on this display. It is easy to use with the example C code library, but will require a 13V supply (a small circuit can be used to generate this from the BBB’s 5V supply rail).

For larger displays, the 4.3” and 7” BB-View displays are available.

 

The revision 1 code is attached below for reference, but is also available here so that changes can be tracked.

20131218_024345-MOTION (1).gif20131223_112415-MOTION (1).gif

20131218_024320.jpg

I previously wrote about using the 8x8 LED matrix with the BeagleBone Black and visualizing Facebook notifications on the matrix.  Adafruit has an interesting tutorial about using multiple 8x8 LED matrix displays together:

 

Animating Multiple LED Backpacks

http://learn.adafruit.com/animating-multiple-led-backpacks

skull2.jpg

The above tutorial was written for the ArduinoArduino, but I wanted to control multiple Adafruit 8x8 LED matrix displaysAdafruit 8x8 LED matrix displays with the BeagleBone BlackBeagleBone Black.  I lucked out when I found Matt Hassel's LED Stock Ticker project for the Raspberry PiRaspberry Pi.  He built upon the Adafruit Python library for the 8x8 matrix and wrote new code to handle scrolling text across multiple displays.  I was able to get Matt Hassel's Python code to run on the BeagleBone Black, and I reworked bi-color matrix code to work with the single color 8x8 matrix displays like my red model.  Here is my GitHub repo for all of my Adafruit LED backpack (8x8 matrix & 7-segment) projects for the BBB:

 

GitHub: pdp7 / beaglebackpack

https://github.com/pdp7/beaglebackpack


A Python program, ticker.py, will scroll a message across the matrix displays.  Before running it, follow Adafruit's instructions to install their Adafruit-BeagleBone-IO-Python library:


Installation on Angstrom | Setting up IO Python Library on BeagleBone Black | Adafruit Learning System

http://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/installation

 

Next follow these instructions on the BeagleBone:

cd $HOME

git clone git://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git

git clone git://github.com/pdp7/beaglebackpack.git

cd beaglebackpack

bash ./ticker.sh -r "Happy Holidays 2013"

 

The message should then scroll across the two displays:

 

Happy Holidays: BeagleBone Black LED ticker

https://www.youtube.com/watch?v=wy1r8esEK6E

 

 

Cheers,

Drew

http://twitter.com/pdp7

UPDATE: Kim the Maker Mom did an awesome job on WGN News this morning.  Kids will be lucky to get these awesome STEM/DIY/maker gifts like littleBits, Bigshot Camera, GoldieBlox, Roominate, etc.  At 4m 25s, check out the BeagleBone Black and Adafruit 16x32 RGB LED panel (displaying output from LEDscape designed at NYC Resistor)


VIDEO: http://morningnews.wgntv.com/2013/12/05/tech-toy-gift-ideas/

BLOG: The Maker Mom: Hot Holiday STEM and Tech Gifts for Kids (Boys and Girls) 2013 as seen on WGN Morning News

Maker Mom on TV.JPG

Kim Moldofsky aka Maker Mom (http://www.themakermom.com/p/about.html) will be on Chicago's WGN TV morning news tomorrow around 8:45am US CST (http://wgntv.com/live/) to present STEM gift ideas including a BeagleBone BlackBeagleBone Black bundle provided by Newark element14 (http://www.newark.com/holidaydeals).  She will demo LEDscape (created at NYC Resistor) running on an Adafruit 16x32 RGB LED panelAdafruit 16x32 RGB LED panel:

 

BeagleBone Black sees color with OpenCV - YouTube

 

cheers,
drew

http://twitter.com/pdp7

LaserGoodies has a sale on amazon.com for our Beaglebone Black Cases. To use the offer online, enter CyberLG1 at checkout.

Link to our Product Page

Sale is Good Till 11:59pm PST 12/02/13.