Arduinoひまわり:電子サンダンサー
コンポーネントと消耗品
> ![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 |
アプリとオンラインサービス
> ![]() |
|
このプロジェクトについて
メーカーは常に新しくて面白いものに敏感です。ある日、ひまわりが太陽と一緒に動く動画を見ました。その時、私は突然の洞察を得ました。この生体力学を模倣した電子機器を作れないのはなぜですか。
翌日、私はソーラートラッカープロジェクトを実行し始めました。マイクロコントローラーボードとしてクロウテールを選び、倉庫で部品や付属品を受け取りました。次に、これらの部品を組み立てました。最後に、携帯電話のLEDを使用してテストしました。あなたは何を知っていますか、それは完璧に機能しました。
私はとても興奮して、ソーシャルメディアにデモビデオを投稿しました。多くの人がこの動画を気に入って共有してくれたことに驚きました。また、このプロジェクトを作りたいというメッセージを送ってくれた人もいました。
そこで、このプロジェクトをやり直して、より多くの人がプロジェクトを作成できるように特定のチュートリアルを作成しました。どうぞ。
ステップ1:準備 <図>

必要な資料は以下のとおりです。
- 段ボール×2
- 発泡スチロールボードx1
- スティックx1
- 3ピンクロウテールケーブルx6
- クロウテール-線形ポテンショメータx2
- クロウテール-光センサーx4
- Crowtail- Pan- Tilt x 1
- CrowduinoとATMega328 V1.1 x 1
- Crowtail-Arduino x1用のベースシールド
ステップ2:デバイスのヘッドを作成する <図>




まず、写真のように2枚の段ボールを、2枚の段ボールにカットする必要があります。次に、段ボールを十字形に組み立てることができます。最後に、十字架でスティックを貼り付けます。これは「頭」としての役割を果たし、常に太陽を指します。一方、デバイスを美しく安定させることができます。
ステップ3:4つの光センサーをインストールする <図>



発泡スチロールに4つの適切な穴を開けて、4つのセンサーを取り付けてから、1つの中央の穴を掘ってスティックに通します。さまざまな配置を区別できるように、これらのセンサーに番号を付けました。
ステップ4:センサーをケーブルで接続する <図>




グルーガンを使用してスティックをフォームに固定し、ケーブルをセンサーに接続します。
ステップ5:スティックをパンチルトに固定する <図>





スティックをパンチルトに固定します。センサーのシートは、画像と一致している必要があります。サイトの下にあるセンサー「1」とセンサー「2」。
パンチルトは、9Gサーボを備えた組み立て済みのデバイスです。 180度の上下左右回転を制御できます。
最後に、ソーラーパネルをフォームに固定します。 (注意:2枚のソーラーパネルは装飾用であり、電源機能はありません。)
ステップ6:コードをアップロードする <図>



CrowduinoとCrowtail-Base Shieldを取り出し、積み重ねます。ケーブルをベースボードに接続する前に、プログラムコードをCrowduinoにアップロードする必要があります。マイクロUSBケーブルが必要です。 Crowduinoをコンピューターに接続し、ArduinoIDEを開きます。
ステップ7:4つのセンサーをシールドに接続する <図>


これで接続を開始できます。まず、センサーのケーブルをシールドに接続します。上の写真に示すように、番号は1対1で対応しています。
1-4ケーブル:
- ケーブル「1」からA0
- ケーブル「2」からA1へ
- ケーブル「4」からA2へ
- ケーブル「3」からA3
ステップ8:ポテンショメータをシールドに接続します <図>



2つのポテンショメータをシールドのA4およびA5ソケットに接続します。
2つのポテンショメータに違いはありませんが、A4ポートを介して接続されている方が、反応時間の遅延を制御する役割を果たし、A5はサーボ回転速度を制御する役割を果たします。
ステップ9:パンチルトをシールドに接続します <図>

下サーボ(水平移動)はD9に接続し、上サーボ(垂直移動)はD10に接続します。
ステップ10:電源を入れる方法 <図>


Crowduinoは、このプロジェクトのメインコントローラーボードです。このボードには、USB電源バンクまたはDCアダプターを使用して電力を供給できます。これは、モバイルデバイスか固定デバイスかによって異なります。
ステップ11:試してみてください! <図>

次に、ボックスを閉じます。日光を追いかけるのが待ちきれないようです。 OK、気楽に、ベイビー、今すぐテストしてみましょう。
私はそれを暗い部屋に持って行き、それから電話の懐中電灯を開けて、そしてすごい!このかわいい男を見てください!
見た目は難しいですが、実はとてもシンプルなので、やってみてください!そして、あなたはそれをより強力でクールに見せることを助けることができます!
コード
- ARDUINOSUNFLOWERのコード
ARDUINO SUNFLOWER Arduino のコード
#include//サーボライブラリを含めるServohorizontal; //水平servointサーボ=90; //水平servoServo垂直に立ちます; //垂直サーボintservov =90; //垂直サーボを立てます// LDRピン接続// name =analogpin; int ldrrd =0; int ldrld =1; int ldrlt =2; int ldrrt =3; void setup(){Serial.begin(9600); //サーボ接続//name.attacht(pin); horizontal.attach(9); vertical.attach(10);} void loop(){int lt =analogRead(ldrlt); //左上のintrt =analogRead(ldrrt); //右上intld =analogRead(ldrld); //左下intrd =analogRead(ldrrd); //ダウンリグintdtime =analogRead(4)/ 20; //ポテンショメータを読み取りますinttol =analogRead(5)/ 4; int avt =(lt + rt)/ 2; //平均値topintavd =(ld + rd)/ 2; //平均値downintavl =(lt + ld)/ 2; //平均値leftintavr =(rt + rd)/ 2; //平均値rightintdvert =avt --avd; //上下の差をチェックしますdhoriz =avl --avr; //左とリグの差をチェックします(-1 * tol> dvert || dvert> tol)//差が許容範囲内にあるかどうかをチェックします。そうでない場合は垂直方向に変更しますangle {if(avt> avd){servov =++ servov; if(servov> 180){servov =180;}} else if(avt dhoriz || dhoriz> tol)//差が許容範囲内にあるかどうかを確認しますそれ以外の場合は水平角を変更します{if(avl> avr){servoh =--servoh; if(servoh <0){servoh =0;}} else if(avl 180){servoh =180;}} else if(avl ==avr){//何も} horizontal.write(servoh);} delay(dtime);}
カスタムパーツとエンクロージャー

回路図

製造プロセス