Reading Arduino data directly into R

I have experimented with reading an Arduino signal into R in the past, using Rserve and Processing. Actually, it is much easier. I can read the output of my Arduino directly into R with the scan function. Here is my temperature sensor example again:

And all it needs to read the signal into the R console with my computer is: > f <- file(“/dev/cu.usbmodem3a21”, open=“r”) > scan(f, n=1) Read 1 item

Measuring temperature with my Arduino

It is really getting colder in London - it is now about 5°C outside. The heating is on and I have got better at measuring the temperature at home as well. Or, so I believe. Last week’s approach of me guessing/feeling the temperature combined with an old thermometer was perhaps too simplistic and too unreliable. This week’s attempt to measure the temperature with my Arduino might be a little OTT (over the top), but at least I am using the micro-controller again.

How cold is it? A Bayesian attempt to measure temperature

It is getting colder in London, yet it is still quite mild considering that it is late November. Well, indoors it still feels like 20°C (68°F) to me, but I have been told last week that I should switch on the heating. Luckily I found an old thermometer to check. The thermometer showed 18°C. Is it really below 20°C? The thermometer is quite old and I’m not sure that is works properly anymore.

Control an LED with the Raspberry Pi and via the web

What a great little device the Raspberry Pi is! After my initial setup it is time to play around with the input and output pins. The first example has to be to switch on an LED. This can also be done remotely via a web interface and better, I cannot only switch the LED off, but the whole Raspberry Pi as well. Thanks to the work of many others, it is straightforward to control the GPIO (General-purpose input/output) pins.

Fun with the Raspberry Pi

Since Christmas I have been playing around with a Raspberry Pi. It is certainly not the fastest computer, but what a great little toy! Here are a few experiences and online resources that I found helpful. SetupInitially I connected the Raspberry Pi via HDMI to a TV; together with keyboard, mouse and an old USB Wifi adapter. Everything worked out of the box and I could install Raspbian and set up the network.

Installing a SSD drive into a mid-2007 iMac

I have a mid-2007 iMac with a 2.4 GHz Core2Duo processor and despite the fact that it is already six years old, it still does a good job. However, compared to a friend’s recent MacBook Air with a solid state disk (SSD) it felt sluggish when opening programmes and loading larger documents. So, I thought it would be worthwhile to replace the old spinning hard disk drive with an SSD, instead of buying a new computer.

Connecting the real world to R with an Arduino

If connecting data to the real world is the next sexy job, then how do I do this? And how do I connect the real world to R? It can be done as Matt Shottwell showed with his home made ECG and a patched version of R at useR! 2011. However, there are other options as well and here I will use an Arduino. The Arduino is an open-source electronics prototyping platform.