Recently, Sparkfun offered an Arduino OPTA unit for sale.
(https://www.sparkfun.com/products/21279)
As I work on industrial systems for a living, I purchased one of the OPTA RS485 units to test it out. Basically, the unit provides eight analog (or digital) inputs and four relay outputs (along with five LEDs you can control). My original thought is that I could use the unit to digitize data and control components in various research reactors I work on.
Unfortunately, I did not read and understand the specifications that well before purchasing this unit. Although Arduino advertises this a a "professional" unit intended for "industrial applications" it is not really suited for such tasks. The problem is the ADCs (analog to digital converters). While they are quite fast (I was able to read all eight channels in less than 50 usecs), they are not very accurate. The specifications claim 5% accuracy for a 0-10V input range (so an input voltage of 10V should produce a 16-bit result in the range 58,981 to 65,535 (I'm assuming it can't go over scale at the maximum voltage). In other words, it should report a voltage in the range 9.5V to 10.0V. For professional applications, this is terrible accuracy (mediocre devices have an accuracy of 1% and good devices are probably down around 0.1%). Alas, I didn't read the documentation close enough to discover this issue; I figured a "professional/industrial" quality device would have professional specs.
I gets worse, though. The particular unit I purchased seems to be nearly 10% off. I feed it 9.8V and it comes back reporting about 9.01V. Who knows? Maybe I have a bad unit. But even if it were up to spec, it wouldn't be sufficient for controlling a nuclear reactor.
Oh well, back to my own designs...
Cheers,
Randy Hyde
Arduino OPTA
Re: Arduino OPTA
Although I determined that the Arduino OPTA isn't accurate enough for my use, I did write a bit of code that makes the ADC readings available on the Ethernet bus (and allows you to control the relays using Ethernet commands). The (attached) code responds to the following commands at 192.168.2.100:45232 (note that you can set the IP address and port in the source code).
ain\n
Returns a string of the form "AIN xxxx xxxx xxxx ... xxxx" where the eight xxxx values are hexadecimal numbers in the range 0x0000 to 0xFFFF representing the eight ADC readings
ave\n
Returns a string of the form "AVE xxxx xxxx xxxx ... xxxx" where the eight xxxx values are hexadecimal numbers in the range 0x0000 to 0xFFFF representing the eight ADC readings (averaged). The filter applied is the following:
1) Take the median of the last nine readings (this throws out any outlier values) for each channel.
2) Take the average (mean) of the last eight median values for a give channel.
dout x y z t
Returns a string of the form "DOUT XXX YYY ZZZ TTT" and writes the four values (0 or 1) to the OPTA relays. The x, y, z, and t input parameters are either zero or not zero (typically 1 for not zero).
Cheers,
Randy Hyde
ain\n
Returns a string of the form "AIN xxxx xxxx xxxx ... xxxx" where the eight xxxx values are hexadecimal numbers in the range 0x0000 to 0xFFFF representing the eight ADC readings
ave\n
Returns a string of the form "AVE xxxx xxxx xxxx ... xxxx" where the eight xxxx values are hexadecimal numbers in the range 0x0000 to 0xFFFF representing the eight ADC readings (averaged). The filter applied is the following:
1) Take the median of the last nine readings (this throws out any outlier values) for each channel.
2) Take the average (mean) of the last eight median values for a give channel.
dout x y z t
Returns a string of the form "DOUT XXX YYY ZZZ TTT" and writes the four values (0 or 1) to the OPTA relays. The x, y, z, and t input parameters are either zero or not zero (typically 1 for not zero).
Cheers,
Randy Hyde
- Attachments
-
- opta.ino.zip
- (5.55 KiB) Downloaded 347 times