Hot answers tagged

75

Some background The most important thing you should know is that the RaspberryPi is a strange beast where the ARM CPU is the not main CPU - it's only a co-processor to the VideoCore GPU. When the RaspberryPi starts, a GPU blob is read from the SD card to the L2 cache and executed. This code then brings up all the important peripherals (RAM, clocks etc) and ...


38

Arduinos usually appear as USB serial devices. The current boards use the USB serial driver built into the main microprocessor, but older Arduinos (and clones) used separate third-party USB-serial chips. To simply receive Serial.print data on the Raspberry Pi from the Arduino, I use the GNU Screen program as a basic terminal: screen [serial-port] [baud-rate]...


13

In case it's not clear, with Raspbian Wheezy, you can run the Arduino IDE and upload sketches to the Arduino when connected to the Raspberry Pi's USB port. To install on Raspbian, just type into the shell (aka command line): sudo apt-get install arduino It will download and install all the needed packages. I've have a couple photos of the Arduino IDE in ...


11

Arduino: is a microcontroller based physical computing platform,programmed using a Wiring-based language (syntax and libraries), similar to C++ with some slight simplifications and modifications, and a Processing-based integrated development environment. With the Arduino Uno you would need to create a sketch in the Arduino language. This is not hard - it ...


11

I actually fixed this error going step by step, apt seems to have a bug in the way it handles ca-certificates-java and openjdk-8-jre-headless on raspbian. So I did : sudo apt-get remove openjdk-8-jre-headless openjdk-8-jre sudo apt-get install ca-certificates-java sudo apt-get install openjdk-8-jre-headless sudo apt-get install openjdk-8-jre # Optional, ...


10

The short answer to your question, how to safely connect the RPi to an Arduino, is indeed given at the first link you posted: http://blog.oscarliang.net/raspberry-pi-arduino-connected-i2c/. I have used the method given there with great success, and without damaging any components. But your question suggests that you don't trust that method, and I think the ...


8

I few differences I have noticed. Raspberry Pi: Doesn't support Analog IO Not as many pins for IO as the Arduino Much more difficult to access IO pins (imo) Writing to the pins for time essential applications in Python can lead to inaccuracies Runs a full fledged Linux OS Features Ethernet (and WiFi and Bluetooth on newer models) Two USB 2.0 Can display to ...


8

One can opt to connect the rpi to the arduino using a usb port or by using the GPIO pins. One can use Wiringpi to do the communication between the boards. Currently there is also a bridge being developed called Ponte. A basic hello world can be found here.


8

I²C protocol is very simple. It does not really define data structures that are sent over the wire. The frame consist of a slave address (with direction bit indicating if master wants to read or write) and (in case of writing) some bytes of data. Since it doesn't make sense to initiate write with 0 bytes of data, first byte is mandatory. This first byte is ...


8

There are a few factors to consider here: The power input to your Pi is probably through a wall adapter or PSU. You should check the rating of the adapter/PSU. If it is in the range of 1.5A to 2A, then your problem is partially solved. Next in play, is the polyfuse and regulator on board the Pi. As per specifications on Adafruit, the B+ can handle upto 2A ...


8

@LiWi's answer will work temporarily, but the permission change will be lost once the device is removed or the server rebooted. A permanent solution is to add your user to the dialout group, which will allow it to access serial devices. sudo usermod -a -G dialout youruser


8

The answer to your question title has been hard to word better than gregeric explained: dwc_otg is the driver that has been heavily patched to squeeze most performance & function in host mode on the Pi: the fiq stuff etc. So heavily patched that, despite the name, it only does host mode & not OTG. dwc2 is an upstream driver which can do the ...


7

Look at the lesson Baking Pi – Operating Systems Development. It's an ARM-only lesson, but it uses pieces of C for the USB driver.


7

The à la mode Billed as The proper way to put an Arduino in a Raspberry Pi by Hack A Day, the à la mode is a stackable Arduino clone designed by Anool Mahidharia, Justin Shaw and Kevin Osborn from the Wyolum.com OSHW collaborative. Hack A Day described it as follows Right off the bat, the AlaMode plugs directly into the GPIO pins of the Raspberry Pi. ...


7

If you don't want to spare your USB port of your Rpi, you can use GPIO Serial to communicate with your Arduino. There is a great tutorial of Conor O'Neill for connecting Rpi with a Arduino Pro Mini. The procedure is the same with your Arduino Uno. All you need is a LLC (Logic Level Converter) to be able to connect these two devices. As you've already ...


7

There is an Open Source project underway at: https://github.com/me-no-dev/RasPiArduino This basically allows one to use the Arduino IDE in conjunction with a cross compiler that generates executable code that will compile arbitrary Arduino sketches and allow them to fully run on the Pi. This project is still in a very early phase but so far I have been ...


6

If you just want to make a keyboard, without using your Makey Makey, you can do that using the GPIO functionality of the Raspberry Pi. But like commented before, the Raspberry Pi does not have sufficient pins available to make a keyboard that is actually useful. However, if you are willing to add 2 IC's you can make yourself a keyboard with so much keys ...


6

"Arduino devices" are really just general purpose devices that operate on 5V logic and can be connected to a bus style supported on an Arduino, such as UART, SPI, or I2C, none of which originated with or are unique to it. This means you can use such devices with anything supporting the communication (busing) methodology and a compatible, 5V logic level.1 "...


6

You can connect the Arduino to the Raspberry Pi with an USB cable. That gives you a serial connection. On the Raspberry side, you can use a library like pyserial. On the Arduino side, you can read bytes with char x = Serial.read(); There's a tutorial at https://www.instructables.com/id/Interface-Python-and-Arduino-with-pySerial/


5

To update Krzysztof's great answer, Broadcom finally publicly released some code, licensed as 3-Clause BSD, to aid the making of an open source GPU driver. The "rpi-open-firmware" effort to replace the Raspberry Pi VPU firmware blob started in 2016: https://github.com/christinaa/rpi-open-firmware. See more at https://news.ycombinator.com/item?id=11703842 ...


5

The GPIO of the Raspberry Pi are 3.3 V and they are not 5 V tolerant; this means if you drive 5 V to them, you may break the input. http://elinux.org/RPi_Low-level_peripherals has the information about the pins. You can use one of these boards: http://store.nkcelectronics.com/5v-to-33v-logic-level-shifter-bo.html Or just buy a 74LS245 from ...


5

My opinion is that, yes you should. Especially since you are powering an Arduino and a WiFi dongle. The reason why some often you need a power USB hub is because the RPi itself doesn't have enough juice to power a lot of high amp devices. I have a webcam attached to mine with a Bluetooth dongle and without my hub, the dongle doesn't allow devices to connect ...


5

The link you give is to the soil sensor which is not an Arduino. Did you mean to ask whether you could use the soil sensor with the Pi? Yes you can but to get analogue results you'd need to add an ADC (I2C or SPI based ADCs are commonly available and will work with the Pi.) If you did mean to link to an Arduino then yes you can use an Arduino with the Pi. ...


5

ALL the Pi GPIO are 3V3. NONE of them are tolerant of voltages outside the range 0 to 3.3V. EDITED TO ADD: The only pin which feeds into the Pi will be that connected to MISO (Master In Slave Out). The simplest thing to do is use a voltage divider on that line to cut the ADC 5V output to a Pi safe 3V3. A voltage divider is typically a pair of resistors. ...


4

You might consider the Gert Board which is now Arduino based if you want a general purpose hardware interfacing platform. One advantage is that there is extensive documentation on interacting with the RPi. Available to pre-order from Element14 as of 8/8/12.


4

WOL is an easier option and does not involve hardware manipulations. AFAIK, WOL is supported by most of common PC hardware.


4

You'll have difficulty getting I2C or SPI to work over 15 metres. Ethernet is your best bet. You don't need a router, just a cheap switch. A 16 port switch shouldn't cost you more than a Raspberry Pi.


4

Single master (Pi) multiple slaves (Arduinos) communication can easily be done with RS485 and MODBUS. There are many open source MODBUS protocol implementations for both Pi and Arduino. With 115200 bps and 2 slaves for example, you can exchange up to few hundred short messages per second.


4

Absolute safest would be Bluetooth serial. With a supported USB dongle on the Raspberry Pi and something like a Bluefruit EZ-Link on the Arduino, you could program and control the Arduino from the Raspberry Pi with no physical connection. Next best would likely be through USB. There is a “standard” protocol (Firmata) for interacting with Arduino and sensors,...


4

The Raspberry Pi and all microcontrollers used in the Arduinos natively support a number of standard protocols, e.g. RS-232 (often called "UART" on embedded platforms), SPI and I²C/TWI, for each of which you will find plenty of tutorials. RS-232 is probably the most robust of them when it comes to long transmission distances, but at the 10 to 15 meters you'...


Only top voted, non community-wiki answers of a minimum length are eligible