ESP32でスケールを作って、お買い物忘れ防止!(1)

つくりたいもの

スーパーでの買い忘れがないように、スケールに乗っているものの重さをスマホで確認(通知?)できるようにしたい。
本当はネットスーパーのお買い物かごに入っていてくれたら最高。
スクリーンショット 2019-04-05 17.14.16.png

使うもの

下準備

設計図

スクリーンショット 2019-04-05 17.38.57.png

作る

ライブラリをゲット

cd ~/esp
git clone https://github.com/akshayvernekar/HX711_IDF

~/esp/HX711_IDF/main/main.cに書いている番号のピンに合わせてつなぐ

#define GPIO_DATA   GPIO_NUM_2
#define GPIO_SCLK   GPIO_NUM_16

ポートの設定

cd ~/esp/HX711_IDF
make menuconfig

スクリーンショット 2019-03-15 17.25.47.png
Serial flasher configDefault serial port/dev/tty.SLAB_USBtoUARTを入力

書き込み!

cd ~/esp/HX711_IDF
make flash

いろいろ聞かれる

教えてもらいながら適当に答えたので、後で必要に応じて変更する

*
* Restart config...
*
*
* Application manager
*
Use time/date stamp for app (APP_COMPILE_TIME_DATE) [Y/n/?] (NEW) y
Exclude PROJECT_VER from firmware image (APP_EXCLUDE_PROJECT_VER_VAR) [N/y/?] (NEW) y
Exclude PROJECT_NAME from firmware image (APP_EXCLUDE_PROJECT_NAME_VAR) [N/y/?] (NEW) y

...

Include ESP-IDF test registration/running helpers (UNITY_ENABLE_IDF_TEST_RUNNER) [Y/n/?] (NEW) n
Include Unity test fixture (UNITY_ENABLE_FIXTURE) [N/y/?] (NEW) n
*
* Virtual file system
*
Suppress select() related debug outputs (SUPPRESS_SELECT_DEBUG_OUTPUT) [Y/n/?] y
Add support for termios.h (SUPPORT_TERMIOS) [Y/n/?] (NEW) n

確認してみる

make monitorで確認してみる

make monitor

矢印の方向に押すとweight=xxxが大きくなるので、重さがとれてそう!
スクリーンショット 2019-04-05 17.14.16.png
スクリーンショット 2019-04-05 17.59.18.png

ひとまず(1)はここまで 💁

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account