I wanted to demonstrate that I could control an Arduino using EPICS installed on an attached Raspberry Pi. That is, to install an EPICS IOC on a Raspberry Pi and to use Channel Access from another machine (on the same network) to control an Arduino. This is part of a larger plan to build a small collection of environment monitoring stations (temperature, dust, humidity, light, etc.) to place around my house, and have the data viewable online, archived for future analysis, etc.
To get the system working the way I wanted, I had three things to do:
- Build a controllable Arduino system. This could be anything, and should be as simple as possible. There are only really three requirements for this:
- Has a settable value, e.g. the duty cycle of a PWM signal sent to an LED.
- Has a readable value, e.g., the voltage drop across a photoresistor adjacent to an LED.
- These values can be set/read via a serial connection.
- Build an EPICS IOC on the Raspberry Pi that handles the connection with the Arduino. That is, serve up a couple of PV’s to the local network via Channel Access (CA), and perform the appropriate serial communications with the Arduino.
- Build an environment on another computer on the same network that will allow CA communication with the EPICS IOC, and development of a GUI control panel. Note that this part isn’t strictly necessary for this task, but since this is just a small part of a larger project, it will prove to be very useful in the future.
After some exploring around, and after a huge amount of help from Volker Ziemann of Uppsala University, I got this system working as desired. It turned out that the details of getting this working are relatively complex (at least they are to a beginner), and so I have broken this out into a bunch of different posts. That is, each of the three steps outlined above will be detailed in upcoming posts.