Showing posts from March, 2015

More fun with the Pimoroni Explorer HAT

I've been playing a bit more with the new Pimoroni Explorer HAT . One of the most exciting features of the Pro version is the analogue interface. Once you've installed the ExplorerHAT package using pip, you can try typing in the examples in the README on github. If you want some more examples, you can clone the github repository into a directory of your choice. Then you'll be able to run the code from the examples directory. Type git clone cd explorer-hat sudo python examples/ You'll see a series of rapidly varying numbers displayed in the console. These show the current voltage as seen on analogue input 1. Since you (presumably) haven't connected that to anything, the output will be fluctuating random values. To see something more sensible, use a jump wire to connect analogue input 1 to the Hat's 3.3 volt output, and you should see the display stabilize showing a value of about 3.3

Pimoroni Explorer Pro Hat - first impressions

This morning my new Explorer Hat from Pimoroni arrived, and the tempation to play has proved to much to resist. There are two versions of the Explorer Hat, standard and Pro. I greedily ordered one of each; the standard version is great for experimenting, but the Pro version offers several extra useful features. I started with the Pro. I love it. Here's what the Explorer hats provide: Four buffered 5V tolerant inputs Four powered 5V outputs (up to 500mA!) Four capacitive touch pads Four capacitive crocodile clip pads Four coloured LEDs PRO ONLY  Four analog inputs PRO ONLY  Two H-bridge motor drivers PRO ONLY  A heap of useful (unprotected) 3v3 goodies from the GPIO A mini breadboard on top! It took me a couple of minutes to get the environment set up The Readme on the github site tells you how prepare your Pi, and then walks you though some fun experiments. One thing to watch: the setup instructions suggest that you install pip by typing sudo apt-get

Using the Raspberry Pi SPI as an AVR ISP (In-system programmer)

A few days ago I blogged about using the Arduino IDE on the Raspberry Pi . It works fine, but of course the Arduino or clone needs to have a boot-loader installed in order for the IDE to work its magic. I wondered if you could also use a Pi to install the boot-loader in the first place. There are lots of ways to install a boot-loader, but most of them require that you start out with at least one working Arduino or clone. What if you don't have one? Could you use a Pi as a programmer? (c) Jason Mann I'd recently seen a rather cool project which uses a custom board with an ATTiny AVR chip and an LED display to show the Pi's IP address. Jason Mann, the author, explained how he used the Pi to program the ATTiny. It looked to me as if his technique should work just as well on an ATMega 328p. (That's the chip that forms the heart of the Arduino Uno and the Shrimp). It does. I hit some minor complications while getting things to work and thought I should shar

Arduino e-Book - reviewers wanted. Might you be one?

. I’m about to publish an e-Book for Arduino Experimenters It’s called Life after Blink! I’m looking for a small team of reviewers who can check it over for bugs and suggest improvements. Might you be interested? The book describes 5 experiments: Fortune Cookie server Morse flasher Counter/LED ripple display Button and Buzzer LDR (photocell)  and bar level indicator The experiments use readily available components, but there is a kit of parts available for those who prefer. If you are selected as a reviewer you will get a free copy of the kit , and you will get a free copy of the e-book with updates throughout its lifetime. If you think you might enjoy reviewing Life after Blink, click here to register your interest . I’ll send you a link to a short online survey. There’s no obligation, I won’t spam you, and you’ll get 75% off the price of the book even if you don’t review it. Register your interest now !

neo4j and Social Media Scraping for twitter, Stack Exchange and Github

I've been experimenting for the last couple of days with tools to help me identify experts and their comments in particular technical areas. I'm hoping to combine data from twitter, stack exchange and git-hub in a way that allows me to look for people who have tweeted about a topic posted answers on StackExchange or published relevant code on GitHub I'm also interested in how they interact. There's a relevant demonstration using clojure and Ruby described on the neo4j blog , and I am using that as a basis for my Python development. If you're not familiar with neo4j, it's a graph datase. Visit their site to find out what that term means if it's new to you. What matters is that it's a great way to store and quesry social replationships and social meida activity. I'll report on progress, but one of my jobs for tomorrow will be to see how usable my code is on the Raspberry Pi 2.

What would you like to know about Pi + Arduino?

C3Pi Regular readers will know how much I like the combination of the Raspberry Pi and Arduino. C3Pi is a prime example of that approach. There's lots to say about using the two platforms together. I just started a poll on G+ asking which aspects people are most curious about. Have your say here !

Scheduling on the Arduino

I'm currently working on a project that requires an Arduino to monitor the positionof two rotary encoders monitor the state of set five push buttons and send the state of everything over a Serial link whenever something changes This is not as simple as it seems. All of the components are mechanical and are subject to contact bounce , and many of the Arduino libraries are blocking. I need the code to be performant and responsive. A promising Task framework Fortunately I found a promising blog post from Alan Burlison; the task framework that he describes looks as if it will help me to solve the problem. One minor problem: the sourceforge project appears to contain no code, and the archive file referred to in the blog was written prior to the release of Arduino version 1.0. As a result the code in the archive needs minor tweaks to work. I like the look of the Task framework. It's lightweight and tries to do much less than FreeRTOS, but it seems powerful enough to d

Covent Garden Workshop

The date for the next Covent Garden Jam has been confirmed - it's on  25 April 2015 from 14:00 to 17:00 (BST) and tickets will be released soon. You can see more details here , though you can't book tickets yet. There will be lots of fun things to do. I'll be running two workshops - Making the Shrimp and tworse . Making the Shrimp Build your own Arduino Clone! You'll need to pay for your kit (£10) and then follow the step-by-step instructions in the workshop guide. It's fun, it's easy (no soldering) and it's fast. The workshop takes 90 minutes or less. You'll need a laptop with a spare USB port and version 1.0.x of the Arduino IDE installed - or you can use a Raspberry Pi! You can read about past workshops here and here . Tworse Link up a Raspberry Pi to An Arduino (or Shrimp), and program them to flash out Tweets in Morse Code! It's a chance to polish your Python and sketch-writing skills! You can read a bit about the tworse

Making Shrimp (Arduino) projects permanent with Stripboard

Making the Shrimp is a great way to get started with Arduino technology. The Shrimp is a low-cost Arduino clone on a breadboard. Once you've prototyped a Shrimp-based project you'll probably want to make a more permanent version, and stripboard is a great way to do that. The Shrimping It! website offers a low-cost stripboard kit and has a few pictures to get you started, but I suspect some beginners would like some more detail. I'm about to make a simple prototype for a new project I'm working on and I thought it would be worth while documenting the process. This is not a soldering guide: if you need one, the Shrimping site recommends this . Kit contents The stripboard kit contains three items: a generously sized stripboard, a strip of headers, and a DIL socket. You'll need the contents of a standard Shrimp kit as well. You'll also need some tools. I used a soldering iron a small fume filter a pair of wire cutters a polisher to clean the

Arduino IDE on the Rapsberry Pi

As part of my experiments with tworse (the Twitter to Morse project) I needed to install the Arduino IDE on a Raspberry Pi and use it to upload a sketch to a Shrimp. The Shrimp is a low-cost Arduino clone which uses a CP2102 as its programmer. To my surprise and delight everything just worked out of the box. A couple of people have asked me what I did. Here's what: Installing the IDE sudo apt-get update sudo apt-get upgrade sudo apt-get install arduino Since I normally work at the command line, I needed to fire up X-windows startx The menu included a category electronics, and the Arduino IDE was located there. Uploading a sketch Shrimp and Pi I started up the IDE with the Shrimp plugged into a USB port. I configured the IDE to use the appropriate board type (normally Arduino UNO for a Shrimp) and selected /dev/ttyUSB0 as the port. I opened and uploaded the examples/blink sketch. The IDE compiled it (which took about a minute) and uploaded it successfully

Shrimp and Raspberry Pi run the Morse Twitter Display

Yesterday I outlined my plans for a Morse Twitter display . Tworse (the Twitter Morse Code display) is now running on the Shrimp + Pi as well as on an Arduino + Pi. The Raspberry Pi monitors a twitter stream - in this case, it's looking for  tweets with the hashtag #morsetweeter. It converts each tweet to upper case, removes any non-ascii characters, and sends it over a serial link to the Arduino or Shrimp. The Shrimp reads lines using the Serial interface and flashes them in Morse Code. It then sends a text version of the Morse-coded line back to the Pi which displays it on the console. Running the app on the Pi The sketch for the Shrimp and the Python Script for the Pi are now on github . The sketch is  a bit long for a blog post, but here is the Python code on the Pi. import time from twython import Twython import serial def parse(filename, comment_char= '#' , separator= '=' ): options = {} with open (filename) as f: for