A FunShield with Arduino with EPICS

A few years ago, I have written an instruction for using a SparkFun ProtoSnap board. Unfortunately, since then, SparkFun discontinued the ProtoSnap boards. That was not a problem, as we had a few of those ProtoSnap boards, until this year (2017), when we had to move the laboratory room from one floor to another, as a result, we managed to lose them somehow (or at least we have not re-discovered them, yet).

Meanwhile, I acquired a new student to learn EPICS, so I had to come up with something. This was my simpler attempt to make sure at least some simple IOC could be written without any need for a special hardware beyond an Arduino board.

Of course, since I wanted something more for students to do. Therefore, concurrently, I started to look for an alternative. That's when I stumbled across this. This shield has a tri-color LED, a buzzer, a light sensor, and a push button just as a ProtoSnap, but also has a temperature sensor and a variable resister. So, I bought one to be evaluated.

After receiving it, I realized that to use the shield easily, I needed to install the library. Unfortunately, as the FunShield page suggests, the library "only works with the Arduino 1.0 version, not the 1.5+"... Well, turns out, after spending a bit of time, I got it working just fine with Arduino IDE version 1.8.2 (current as I write this). My modified library can be downloaded here. This version can be imported into Arduino as a zip file (see here for more info on that).

The FunShield is particularly good, as it is an open source hardware. The library has the PCB board design on it. So, it can be reproduced, if needed. This works very nicely, as previously, I ran into the problem where I could no longer buy a ProtoSnap... Of course, ordering a PCB board is not all that inexpensive, but at least this board can be reproduced if needed... The components on the board is also reasonably large that it should be easy to soldered on, too.

I have written a sketch for a FunShield. It is aware of the following serial commands:

Analog input:
trimmerTrimmer Control; this will display some value
lightLight Sensor reading; this will display value from the sensor
tempTemperature Sensor reading; this will display value from the sensor
Analog output:
speakerThe speaker will make some sounds
Binary input:
leftShows the status of the left button (0 or 1)
rightShows the status of the left button (0 or 1)
Binary output:
ronoff[0 or 1]ronoff1 to turn on the Red LED, ronoff0 to turn off the LED
bonoff[0 or 1]bonoff1 to turn on the Blue LED, bonoff0 to turn off the LED
gonoff[0 or 1]gonoff1 to turn on the Green LED, gonoff0 to turn off the LED

The serial port should be set as 9600,8,n,1 (standard configuration). Use \r (or CR) for the line end termination.

It is probably recommended to try connecting to the Arduino with a FunShield, once the sketch is loaded via CoolTerm or minicom or any other choices of Serial Terminal program, so that you know how to this works before. Of course, since the sketch is available, you are welcome to make any changes to fit your need. There are some visual feedbacks using the LED array on-board.

Anyway, here is the actual exercise.