Is BBB compatible with Arduino Sensors?

Hello,

I am new to this BBB thingy. Previously I used Arduino. Planning to shift to BBB. Does BBB support arduino sensors e.g. Ultrasound sesnsor, PIR sensor etc.

The Beaglebone black will support anything you can physically attach, and have a driver for.

So while maybe that driver does not exist for the beaglebone black currently, you can always write one.

The previous response is correct. Let me elaborate a little more on his answer. The sensors that are available for the Arduino all have an interface that is used to communicate with them. Some use SPI, some I2C, some just a plain old analog to digital converter connection. The BBB does in fact have all of the communication protocols that the Arduino has. However, the libraries you get with the sensors for use in your Arduino will not work with the BBB. You will have to write your own drivers to communicate with those sensors.

As far as physical connections, all you need are some jumper wires to run from the shield pins to the header pins of the BBB. You won't be able to just plug it in as is, as the communication protocols needed are on different pins.

Currently I am using the GPRS shield, the TFT shield, and the SD shield with my BBB. Finding the correct pins to connect them to was a breeze. Writing the code was more complex, but I use my BBB in bare metal mode. I'm sure the Linux drivers would be much easier :wink:

If memory serves. I seem to recall someone “ported” Ardiono “stuff” to the beaglebone black. What, where, and how, I do not remember. BUt IMHO that’s all a bloody mess anyway . . .

Wattup,
The other software-related answers were nice. I would like to just add that you should be aware of the voltage levels you are dealing with. The term “Arduino Sensors” is actually not very descriptive because it does not clarify if it is referring to the 5vdc Arduinos or the newer 3.3vdc (also known as 3v3) Arduinos. The BBB uses 3v3 logic levels AND the analog inputs are 1.8v max. So, having said that, I personally would probably be comfortable interfacing 99% of the “Arduino Sensors”, but that doesnt mean you should just hook and pray…you might need level shifters, etc.

I did a BBB project (link below) which used a light sensor, which was designed for 5v applications, but since the circuit is ratiometric, I was able to just use the BBB’s 1.8v analog reference voltage as my excitation source and the resulting analog sensor voltage was right where it needed to be!
http://www.voltvision.com/beaglebone-black-and-sounds-of-the-night-installment-4-of-7/

Good luck!

-frenchy (Steve French)
www.voltvision.com

The BBB is quite a different beast from Arduino (and there are many of those; I assume you mean one of the simpler ones such as ‘Uno’). Arduino is simple to use, like a bicycle. It’s great when that is what you need. BBB is more like a powerful motorcycle - lots more capability but a step or ten up in complexity… and learning curve. BBB has a pretty complete operating system capability (I use Ubuntu 14.04) which the simpler Arduinos lack. BBB has ethernet, HDMI, etc baked in which Arduino does not, and the simpler Arduinos can’t realistically add that. The more complex Arduinos can, but then you get to about the same price point as BBB and you arguably have a kludge. I don’t mean any of this disparagingly, just that the “best” solution for you depends… on what you are trying to do, and a lot of other factors. Personally I like BBB for some applications where you want Linux, HDMI, Python, etc, and Teensy 3.1 for smaller ones. They are all tools - pick the one you like best or that fits your needs best.

You’d hope, this being 2015 (and not 1995) that there would be some standard and portable way to have hardware device drivers you could use anywhere. There are some efforts in that area such as Pingo but this issue is gnarly… figure out a good solution and you’d have a great business. The use of I2C and SPI as common hardware interfaces has helped a lot but there is a long way to go until all sensors could be “plug and pray” on any hosting system.

BBB also has the PRUs which seem like a solution for any number of special realtime interface issues. And the BBB community is pretty great too! Mr Kernal, Robert Nelson, and Mr Beagleboard (Gerald Coley) and a ton of others are working hard to make BBB great. Adafruit is also a good source of BBB parts and tutorials.

Welcome to the community!

Adafruit is also a good source of BBB parts and tutorials.

You have to watch out for the Adafruit stuff though. Not that I need their info often, but when I did, I often find it incomplete, outdated ( as in wont work with current images ), or just flat out wrong. Also some of the hardware they sell marked for the beaglebone black is not exactly good “with” the beaglebone black. So again, you have to know something about the given hardware, before diving in. I chock this up to bad QA on Adafruit’s behalf. e.g. they did no testing.

A perfect example would be those cheap stubby wifi dongles. The beaglebone black sometimes will not like these as their radio is easily interfered with by the hdmi signal, and / or the board ground plane.

If you want a really good learning resource. Check out DR. Derrek Molloy on youtube, or his blog. His book is supposed to be good as well, but I can not confirm as I did buy a hard copy, but have not read more than a few pages. With that said, I’m fairly certain it is a good book.

Short of all that, google can be the best resource. IF one can learn to sift through all the “noise”. Then knowing that 99% of the time, Linux is Linux . . .

Well, I get that BBB is a lot more powerful than Arduino (UNO) and I have no doubts about that. Frankly speaking, that’s the reason I am into this BBB kind of thing. I was wondering if I could reuse my arduino uno compatible sensors i.e. with BBB. That would really be a kick start for a beginner like me.

And which programming language would be best. I know C only and trying to learn Python on my own. I am open to any suggestions.

Well, I get that BBB is a lot more powerful than Arduino (UNO) and I have
no doubts about that. Frankly speaking, that's the reason I am into this
BBB kind of thing. I was wondering if I could *reuse* my arduino uno
compatible sensors i.e. with BBB. That would really be a kick start for a
beginner like me.

Arduinos are designed as a 5 volt system, which means that the
peripherals are as well (the shields).

You can't connect them directly to the processor, not when the shield
is powered from 5 volts.

Some chips and chipsets on the shield may work at 3.3 volts. Those
can be directly connected to any pin except the ADC pins.

If the chips only work at 5.0 volts, you will need a level shifting
chip (see level translators at TI.com). Series resistors do not work,
it's not a matter of current, it's a matter of voltage. Use a chip.
you might be able to use a resistive voltage divider, but it will cost
you speed. Best to use the chip.

This does not address ADC pins. The A/D pins on a MEGA are good for 0
to 5 volts. On an XMEGA, good from 0 to 3.3 volts. 5 or 3.3 being
the nominal supply voltage, don't exceed VCC on the chip.

The ARM processor pins are good to a maximum of 1.8 volts. You'll
have to adjust that, too.

What I'd suggest (and there might be one, or you'd have to design it),
would be a cape that does level translation and ADC buffering (op
amps, but don't run the op amp from more than 1.8 volts and make sure
it will do rail to rail on the outputs). The cape can have pinouts
for the arduino shield. Even then, you have to pick which pins will
be inputs and outputs, since most chips do groups of 8 or 16. There
is a 1 bit level translator, though.

the level translators will go from almost any voltage up to 5.5 to any
other voltage up to 5.5... They'll go both ways.

Harvey

And which programming language would be best. I know C only and trying to learn Python on my own. I am open to any suggestions.

There is no right or wrong language.

Maybe this can help you:

Looks interesting. Last commit was 2 years ago though.

There is also IEEE 1451, which is not driver code per se but a way to have smart sensors which can identify themselves to a host system vs being hard-coded by hand every time.
https://en.wikipedia.org/wiki/IEEE_1451

If there is a working driver (C++) for Ardunio and it uses I2C or SPI it should be straightforward to adapt it to BBB either in C++ with macros or preprocessor directives, or a Python wrapper. I have some Arduino drivers I’ve written (TMP102 among others) which I want to run on BBB so I will try to give this a spin soon and report back here… and release my drivers on Github once they are good enough to do so.

Bruce

If there is a working driver (C++) for Ardunio and it uses I2C or SPI it should be straightforward to adapt it to BBB either in C++ with macros or preprocessor directives, or a Python wrapper. I have some Arduino drivers I’ve written (TMP102 among others) which I want to run on BBB so I will try to give this a spin soon and report back here… and release my drivers on Github once they are good enough to do so.

I think for the beginner, it would be best to start with “devices” that are known working with the beaglebone black. Or at minimum, in the case of USB type peripherals. Something that works with Linux, and uses libraries / API’s availible / working on ARM ( armhf in the case of debian ).

What you described above, Would be very daunting for a newb to Linux device driver development. Hell, it’s not something I would personally enjoy doing . . . and I do have some experience attempting to port Arduino drivers to other platforms. It never worked out very well. . . and I always wound up writing my own stuff from scratch.

@Bruce Boyes,

Anyway, not trying to argue with you about whats best exactly. Just trying to share my experiences with the process over the last few years as a hobbyist embedded device developer. It has not been an easy path for sure, but it has been educational . . .