Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

めちゃくちゃ安価なPLC Arduino OPTAを使ってみた!

12
Last updated at Posted at 2023-06-19

image.png

今回お客様より「安価なPLCを使ってプログラムを組めないか?」との要望を受け、
初めてArduino OPTAを使用することになった!

Arduino OPTAとは

Arduino社が産業用に開発したPLC製品です。
言語で開発できるので、今までラダープログラムが苦手だった複雑な演算処理も
簡単に組むことが出来ます!
しかも値段が3万もしません!!

安すぎる・・・
これが出回りだすと大手のPLC販売メーカーは困るでしょうね。
https://akizukidenshi.com/catalog/g/gM-17627/
↑購入先

環境構築

OPTAの+、-配線に12V-24Vの電源を供給する必要があります。
今回は安定化電源を使用して12Vを供給しました。
起動時の電流は45mA程度でした。
(ちなみに電源を接続しなくてもUSB接続をすればUSBから電源が供給されるようです。)
image.png

開発環境

開発環境は、ArduinoIDE 2.1.0を使用しました。
まずツール>ボード>ボードマネージャーを選択します。
image.png

検索のところで「Opta」を入力。
「Arduino Mbed OS Opta Boards」をインストールする。
image.png

インストールが完了すればツール>ボード>Arduino Mbed OS Opta Boards>Opta
を選択すれば開発環境はOKです!
image.png

Lチカしてみる

それでは手始めに入門で定番のLチカをしてみましょう。
書き込み設定は、以下の画像を参考にして下さい。
image.png

OPTAは始めからSTATUS LEDがあるので今回はそれを使用します!

void setup() {
  // put your setup code here, to run once:
  pinMode(LED_D0, OUTPUT);
  pinMode(LED_D1, OUTPUT);
  pinMode(LED_D2, OUTPUT);
  pinMode(LED_D3, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(LED_D0, HIGH);
  digitalWrite(LED_D1, HIGH);
  digitalWrite(LED_D2, HIGH);
  digitalWrite(LED_D3, HIGH);
  delay(1000);
  digitalWrite(LED_D0, LOW);
  digitalWrite(LED_D1, LOW);
  digitalWrite(LED_D2, LOW);
  digitalWrite(LED_D3, LOW);
  delay(1000);
}

なんのひねりもない1秒毎にLEDが点滅を繰り返すプログラムです。
image.png

アナログ入力してみる

以下のプログラムを書き込み
I1と-の端子に10Vを入力してみます

void setup() {
  // シリアル通信を設定
  Serial.begin(9600);

  // アナログ入力の分解能を16bitに設定
  analogReadResolution(16);
}

void loop() {
  // 1chの電圧取得
  int ValueA0 = analogRead(A0);
  float volA0 = ValueA0 * (3.0 / 65535.0)/ 0.3;
  Serial.print("I1 value: ");
  Serial.println(ValueA0);
  Serial.print("I1 Vol: ");
  Serial.print(volA0, 5); 
  Serial.println("V");

  delay(1000);
}

image.png

image.png
10V入力したのですが値は、9.12~9.13Vをパラパラしています。
端子間にコンデンサ or プログラムで平均処理が必要みたいです。
あと係数の調整も必要ですね。

感想

通常PLCは、ラダープログラムで作成しますが言語で作成できるのは、色々と使える幅が広がりそうです。
また他社のPLCと比べると非常に安価です。
まだどのくらいの耐久性があるのか分かりませんが、ちょっとしたところに使用するのは
非常に良い製品かもしれません。
Arduino社自体は、世界的に有名な企業なので信頼性は高いと思います。

安価でちょっとしたところに使用できる製品!
開発依頼をしたい方はお気軽にご相談下さい!

12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

@Kurogara's pickup articles

Kurogara

@Kurogara

九州でエンジニアをしています。 今までは、 Web系・組み込み系、業務系システム開発。 製品開発。 プラント・試験設備の計測、制御システム開発。 CCTVシステム、入退管理システム開発。 システム開発の講師なども行っておりました。 仕事受付中です! お気軽にご相談ください(^^)

Linked from these articles

Comments

No comments

Let's comment your feelings that are more than good

Being held Article posting campaign

【2026年上半期】AI活用を振り返ろう!

2026-06-01 ~ 2026-07-13

View details

はじめての記事投稿

2026-06-01 ~ 2026-07-13

View details
12
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Login to continue?

Login or Sign up with social account

Login or Sign up with your email address