create every day - 福野泰介の一日一創

椅子IoT リアルタイム座席オープンデータ向け新システム / Chair IoT for Real Time Seat Open Data

2017/05/04 23:55:00
#IchigoJam #maker #IoT #english 

椅子をネットにつないでみました。
I connected the chair to web.

今回は1コあたり400円のWiFiモジュール ESP-WROOM-02 を書き換えなしで使います。 光センサーの代わりに、お菓子IoTで使った圧力センサーを WiFi Shield を使ってIchigoJamに接続。
IchigoJam with $4 WiFi module "ESP8266" and pressure sensor via WiFi Shield.

抵抗を変えると感度が変えられます。
You can modify registors.


ディスプレイでチェックしながら、100Ωをセレクト
I selected 100Ω resistor after checking on the monitor

10 VIDEO3 20 ?ANA(2):WAIT30:CONT

WiFiのアクセスポイントの設定をしておきます。
Set ID/password to the WiFi access point

OK0 UART3,0:OUT5,1:OUT6,1:WAIT300:UART3,2 ?"AT+CWJAP=";CHR$(34);"**SSID**";CHR$(34);",";CHR$(34);"**password**";CHR$(34)


牛乳を乗っけてチェック!3秒置きにスリープから復帰し、値が100変化していたらWiFiを通じてwebサーバーへデータを送ります。
Check with milks! Send a data to web if change the number via WiFi.

100 VIDEO0:B=0 110 N=ANA(2):?N 120 IF ABS(N-B)>100 LED1:WAIT10:LED0:GOSUB@SENDN:B=N 130 WAIT 3*60,0 140 GOTO110 200 @SENDN 210 UART0,0:OUT5,1:OUT6,0:OUT6,1:WAIT300:UART3,0 220 ?"AT+CIPSTART=";CHR$(34);"TCP";CHR$(34);",";CHR$(34);"sabae.club";CHR$(34);",80":WAIT3*60 230 M=1+(N>9)+(N>99)+(N>999)+(N>9999) 240 ?"AT+CIPSEND=";82+M:WAIT30 250 ?"GET /siot/4/?key=********&v="N;" HTTP/1.0" 260 ?"Host: sabae.club 270 ?"User-Agent: IchigoJam 280 ? 290 WAIT180:OUT5,0 300 RTN

*for IchigoJam 1.2b47 / ******** is secret key to write


乾電池で動く省エネ仕様なので、貼り付け設置、簡単!
Easy to deploy because it works by cheap batteries!

合計原価で1500円くらい、通信料なし!でも、WiFi設定が手間。
Total cost about ¥1,500 without monthly fees. But It takes time and effort to set up the WiFi.

お菓子IoT 重量センサーと32x16ドットマトリクスで食べ過ぎ防止 / Diet IoT with pressure sensor and 32x16 matrix LED by IchigoJam x sakura.io

2017/05/03 23:55:00
#IchigoJam #maker #IoT #english 

食べ過ぎて困る!?圧力センサーで測った重さを大きく表示しつつ、重量の変化をサーバーに送る「お菓子IoT」をつくってみました。
Use pressure sensor to diet!


お菓子の量を重さで監視して、変化があったら sakura.io で送信!
Send the number if the weight change.


肝はこの圧力センサーFSR402(500円@秋月電子)
Pressure sensor!


圧力センサーの片方に1kΩの抵抗を介してVCCとアナログ入力へのワイヤー、もう片方をGNDに接続。
Pressure sensor (terminal A, B)
A: --+-- 1kΩ -- VCC
      +-- BTN(ANA)
B: -- GND


32x16ドットマトリクス(500円@共立デジット)はダイナミック点灯が必要。BASICでは速度がでないのでマシン語化!
Machine language is so fast!

32x16 dot matrix LED
VCC - VCC(IchigoJam)
SIN_1 - OUT1
SIN_2 - OUT2
SIN_3 - OUT3
CLOCK - OUT4
LATCH - OUT5
/ENABLE - OUT6
VLED - 5V
GND - GND

こちらお菓子IoTのプログラム (source of Diet IoT) *for IchigoJam 1.2b46

1 '32x16 MATLED driver 100 POKE#700,240,181,10,38,5,0,31,0,0,36,137,176,0,146,118,66,40,0,10,33,184,71,51,0,67,67,93,25,237,0,0,155,129,53,255,53,93,25,4,171,229,80,4,52,5,0,16,44 110 POKE#730,238,209,100,32,5,155,0,147,4,155,1,147,7,155,2,147,6,155,3,147,4,34,82,66,1,33,19,29,153,64,0,37,140,70,128,35,97,70,35,76,27,2,25,64,35,0,0,41 120 POKE#760,0,209,11,0,32,73,33,79,11,128,7,42,52,216,0,155,128,33,155,92,9,2,27,2,30,0,1,155,41,65,155,92,30,67,51,0,11,64,0,208,22,75,59,128,2,155,3,159 130 POKE#790,155,92,191,92,27,2,59,67,11,64,0,208,17,75,20,73,11,128,0,33,19,75,1,53,25,128,28,128,99,70,91,0,156,70,16,45,205,209,0,37,15,73,16,75,1,50,28,128 140 POKE#7C0,12,128,13,128,0,33,25,128,12,42,189,209,1,56,0,40,184,209,28,128,9,176,240,189,0,35,0,33,59,128,4,75,25,128,222,231,255,15,0,0,4,0,1,80,8,0,1,80 150 POKE#7F0,16,0,1,80,32,0,1,80,0,8,1,80,0,4,1,80 RUN:SAVE0 NEW:'Main program 200 N=0:C=100 210 A=1023-ANA() 220 U=USR(#700,A) 230 C=C-1:IF C=0 C=100:IF ABS(N-A)>2 N=A:GSB@SEND:?"SEND";N 240 GOTO210 300 @SEND:POKE#800,32,10,1,76,N,N>>8,0,0,0,0,0,0,103^(N&#FF)^(N>>8),36,0,36:R=I2CR(79,#800,13,#820,3):R=I2CR(79,#80D,3,#820,3):RTN SAVE1 LRUN0

links
- 【共立エレショップ】>> 32×16ドットマトリクスLEDモジュール■限定特価品■
- IchigoJamで32x16ドットマトリクスLEDを制御する - ※個人の感想です (マシン語編)
- さくらインターネットが提供するIoTプラットフォームサービス、sakura.io

IZAKAYA style ideathon to make things using Open Data by Open Data Asia

2017/04/27 23:55:00
#OPDA #opendata #IoT #english 

Open Data Asia the first event at Shinjuku NHN Techorus.


Part 1: The first step of IoT and programming with IchigoJam x sakura.io

Challenge the first step of IoT with IchigoJam x sakura.io.



Heart LED board with IoT!
This is library for IchigoJam x sakura.io

20600 'IoT lib 20610 END 20700 @PWR:POKE#700,2,0:N=3:GSB@I2C:?PEEK(#782):RTN 20710 @ACT:POKE#700,1,0:N=3:GSB@I2C:N=PEEK(#782):RTN 20720 @GET:POKE#700,#30,0:N=#14:GSB@I2C:N=PEEK(#784):RTN 20730 @CHK:POKE#700,#32,0:N=4:GSB@I2C:N=PEEK(#783):RTN 20800 @WOUT:POKE#700,#20,10,1,76,W,W>>8,0,0,0,0,0,0:N=2:GSB@I2C:POKE#700,#24,0:N=2:GSB@I2C:RTN 20810 @WIN:W=0:GSB@CHK:IF!NRTNELSEGSB@GET:W=PEEK(#784)|PEEK(#785)<<8:RTN 20910 @I2C:M=PEEK(#701)+2 20920 C=0:FOR I=0 TO M-1:C=C^PEEK(#700+I):NEXT:POKE#700+M,C 20930 IFI2CR(79,#700,M+1,#780,N+1)'STOP 20940 C=0:FORI=0TON-1:M=PEEK(#780+I):C=C^M:NEXT 20950 IFC!=PEEK(#780+N)ORPEEK(#780)!=1'STOP 20960 RTN

Part 2: IoT and Open Data ideathon!

Past day there are no standards to connect the power, so the vacume machine connected to the light socket!


We will aim the 5 star open data.


This is load map of IMI.go.jp (vocaburary for 5 star open data from Japan).


Let's enjoy our ideathon with ISAKAYA STYLE.


The slide with 7 ideas!


The prize "Let's create!" to the stress communicater team!


The wearable girl with neoplug x VUFINE+!


Thank you to participate! See you next time!


Thank you NHN Techorus!

links
- また新宿区内でオープンデータ×IoTイベントやります! | 新宿区議会議員最年少の伊藤陽平
- オープンデータ、IoTも活用し、データシティ新宿の実現へ | 新宿区議会議員最年少の伊藤陽平

Utilize Data by Everyone! sakura.io board for IchigoJam will release also

2017/04/18 23:55:00
#IchigoJam #IoT #english 

Sakura's IoT Platform beta service became sakura.io released by Sakura Internet.

Utilize Data by Everyone! (from Sakura's slide)
The sakura.io module price is ¥8,000 + ¥60/month!! (with out tax)
LoRa version targets ¥5,000 + ¥20/month or less!!!


3 IchigoJam examples on Sakura's slide
1. capturing and notice system by IchigoJam x sakura.io
2. Real time bus passengers open data system at Sabae
3. Online typing battle system on Kids Venture

We're preparing the board to connect sakura.io and IchigoJam.
I'm looking forward to release!
"さくらインターネット、月額60円から利用できるIoTプラットフォーム「sakura.io」正式提供開始 - クラウド Watch"
IchigoSAKURA IoT car (IoTカー@ja)!?

27 April, you can touch and try sakura.io x IchigoJam in Shinjuku.
"IoTとオープンデータはじめのいっぽ&課題解決型アイデアソン - connpass"

These are new "IchigoJam goods" on SUZURI. (using open data of IchigoJam)

see also
"リスク0から始める商売!5分でできるオリジナルグッズショップ - 欲しいものは、作ればいい「SUZURI」"

Let's Be Smart Home Creator! Cat IoT with WiFi module "MixJuice" for IchigoJam

2017/04/10 23:55:00
#ichigojam #IoT #maker #neko #english 

If you have own WiFi in the home, using WiFi is one of easy way to create own IoT device. Cheking cat's toilet is first step to look a cat's health! Today I updated its communication device to WiFi.


NekoIoT notices me that a cat go to a toilet.


It's a 450 yen distance sensor same as paprika's eye!
* シャープ測距モジュール GP2Y0A21YK: センサ一般 秋月電子通商 電子部品 ネット通販


MixJuice is the WiFi module for IchigoJam.
Just stack your IchigoJam and set up.

?"MJ APC *ssid* *password* MJ APC *ssid* *password* '................. 'WiFi connected: ***.***.***.*** 'OK

It succeeded to connect the net! And program as below.

1 'NekoIoT ver 1.3 10 W=60*20:D=0:L=200:LED1:?"Connecting..." 15 UART0,0:WAIT W:LED0:?"OK":UART1,1 20 GSB@GET:?A:IF A<=L WAIT10:CONT 32 LED1 36 ?"SEND!":GSB@SEND 40 WAIT 60*10 45 LED0 50 GOTO 20 200 @GET:M=0:S=0:FOR I=0 TO 4:A=ANA(2):S=S+A:IF A>M M=A 210 WAIT5:NEXT 220 A=(S-M)/4:RTN 300 @SEND:?"MJ GET ***.***/***/?v=";A:RTN

* set a URL of your web app! I set up to notice my phone via IFTTT.

Sakura's IoT Platform is easy way to create IoT also and the easiest way to set up! Just be power it on!
"How to blink a LED via web on IchigoJam using Sakura IoT Platform beta"
This is a tutorial to use it.

In 27 April at Tokyo, we will hold an IoT event!
"Ideathon with the first step of IoT and Open Data / IoTとオープンデータはじめのいっぽ&課題解決型アイデアソン"

Enjoy IoT Hackathon Kit using Sakura's IoT Platform x IchigoJam

2017/04/03 23:55:00
#IchigoJam #IoT #english 

IchigoJam is one of primary partners of Sakura's IoT Platform (さくらのIoT Platform@ja → sakura.io). We lend 20 Sakura's IoT Platform sets for Hackathon! Yessterday for kids, today for adults!


I prepared 20 Sakura's IoT Platform sets with voltage chaenger for I2C. (see how to make)


Show how to use the bright sensor ad the breadboard.


Connecting the sensor and Sakura's IoT Platform to IchigoJam.


You can get the data and send the data with net on the screen or your smartphone.

I prepared an easy library to use Sakura's IoT Platform.

W=15:GSB@WOUT

Just type this to send a value

GSB@WIN:?W

Just type this to receive a value

10 GSB@WIN:IF W BEEP W,60 20 WAIT 10:GOTO 10

This is the easy pager (ポケベル@ja)!
If IchigoJam get the number just beep a sound.

Write a latest firmware and this program to IchigoJam before hackathon.

699 END:'IoT lib 700 @PWR:POKE#700,2,0:N=3:GSB@I2C:?PEEK(#782):RTN 710 @ACT:POKE#700,1,0:N=3:GSB@I2C:N=PEEK(#782):RTN 720 @GET:POKE#700,#30,0:N=#14:GSB@I2C:N=PEEK(#784):RTN 730 @CHK:POKE#700,#32,0:N=4:GSB@I2C:N=PEEK(#783):RTN 800 @WOUT:POKE#700,#20,10,1,76,W,W>>8,0,0,0,0,0,0:N=2:GSB@I2C:POKE#700,#24,0:N=2:GSB@I2C:RTN 810 @WIN:W=0:GSB@CHK:IF!NRTNELSEGSB@GET:W=PEEK(#784)|PEEK(#785)<<8:RTN 910 @I2C:M=PEEK(#701)+2 920 C=0:FOR I=0 TO M-1:C=C^PEEK(#700+I):NEXT:POKE#700+M,C 930 IFI2CR(79,#700,M+1,#780,N+1)'STOP 940 C=0:FORI=0TON-1:M=PEEK(#780+I):C=C^M:NEXT 950 IFC!=PEEK(#780+N)ORPEEK(#780)!=1'STOP 960 RTN

Let's hack with IoT!

IchigoJam Zero the World's Lightest PC 0g 150yen for IchigoJam Things!

2017/04/01 00:00:00
#IchigoJam #IoT #maker #english 

重さ0g、150円の世界最軽量、最安値のパソコン「IchigoJam Zero」と「IchigoJam Things」をリリース!
I released the world's lightest 0g/150yen PC "IchigoJam Zero" and "IchigoJam Things"!

Finger Size! 指の上サイズ! (photo human ver.)


Weight: 0g (IchigoJam Zero) / 9g (Raspberry Pi Zero)


IchigoJam ZeroRaspberry Pi Zero
CPUNXP LPC1114 @ 48MHzARM1176JZF-S @ 1GHz
RAM4KB512MB
UART115,200bps (default)115,200bps (default)
I2Cx1x2
GPIOx11x22
Video outputNTSC composit
(needs 2 registers 470/100)
HDMI / NTSC composit
(needs 2 wires)
KeyboardPS/2 keyboard
(needs 2 wires)
USB keyboard
Storageinternal Flashneeds a SD card
OSIchigoJam BASIC
IchigoLatte JavaScript
(needs download & install)
Raspbian etc...
(needs download & install)
Price$1.5$5
Weight0g9g
Size11.8mm x 7.2mm67.6mm × 30mm
Power Consumption0.05W0.5W-0.7W


IchigoJam Things is a break out board for IchigoJam Zero!


Now available on Upverter! "IchigoJam Things / RPi by taisukef f9de7f39761699b0 - Upverter"
IchigoJam Zero を使うブレイクアウトボード「IchigoJam Things」のガーバーデータがダウンロード可能です!


IchigoJam Zero on IchigoDake & IchigoIgai by PCN


IchigoDake makes IchigoJam everywhere!


Enjoy making everythings! ものづくりをたのしもう!

links
- 「若年層に対するプログラミング教育の普及推進」事業にIchigoJam採用!
- 2017.4.1 IchigoDake / IchigoIgai | PCN プログラミング クラブ ネットワーク
- 2016.4.1 MSXになりたい「こどもパソコンIchigoJam」あの起動ロゴを搭載!(boot logo)
- 2015.4.1 創る人を創ろう! Pepper より安価な こどもロボットPaprika 発表!(Kids Robot paprika)
- 2014.4.1 目指すはMSX! Raspberry Pi より安価な IchigoJam 発表!(Kids PC IchigoJam)
- 2013.4.1 jig megane-0 かけられる大容量バッテリー(glasses)

Deploy to the Bus, "Bus Passengers Realtime Opendata System" will start at Sabae!

2017/03/30 23:55:00
#IchigoJam #IoT #maker #english 

Sabae city was worried about taking times to make the report of count of passengers everyday. "Sakura's IoT Platform(さくらのIoT Platform@ja → sakura.io)" the lowest 4G network device and IchigoJam will solve it!


Mr. Makita CIO of Sabae city built devices.


Find the place to deploy it!


Connect the power cable from the cigar socket of the bus to this system!


Tada! It's works!


The zero days (day 10, 20 and 30) are free for elderly people (over 75).
Let's promote with Sabae city!


Looking forward to launch in this April 1!

- Features
Pysical Buttons are easier than touch interfaces and hand writings.
IchigoJam is stronger than other PCs cause no external strages (SD/SSD/HDD).
IchigoJam boots quicker than other PCs, just a second.
IchigoJam is safer than other PCs cause OS is very thin IchigoJam BASIC OS.
Sakura's IoT Platform is safer than other systems cause this is protected by the device and the safe connection.

links
- 鯖江市のバス乗客リアルタイムオープンデータシステムを支える「IchigoJam」 - IchigoJamとさくらのIoT Platform | マイナビニュース
- Sakura's IoT Platform(さくらのIoT Platform@ja → sakura.io) (IchigoJam is one of the priority partners)

How to connect Physical Push Buttons to IchigoJam and web

2017/03/29 23:55:00
#IchigoJam #IoT #maker #english 

The physical push button is easy to user for everyone!
Let's connect and use on your IchigoJam.

It's very easy that you can connect 1 push button via 2 wires (GND-IN1).

FORI=0TO100:?IN(1):NEXT

IN1,IN2,IN4 of IchigoJam are pull-uped port, so you can directly connect the wire.
IN3 and OUT1-6 are not pull-uped, so you have to pull-up using about the 10kΩ register each.

This system is for the Sabae Bus.

In this April, bus drivers will manipulate this!
"Bus Realtime OPENDATA System Project with Corprate Fellowship (Code for Japan) at Sabae"

10 FOR I=1 TO 5:OUT I,-1:NEXT 20 C=IN()&`11111011:A=~C&B:B=C 40 ?A 50 GOTO 20

This code is to get timings of pressing.

Let's connect physical to web!

links
- 福井県鯖江市、jig.jp、さくらインターネットが共同開発した「バス乗客リアルタイムオープンデータシステム」を鯖江市の公共バスで運用開始

How to blink a LED via web on IchigoJam using Sakura IoT Platform beta

2017/03/14 23:55:00
#IchigoJam #IoT #maker #english 

Let's make WoT!
The first step of Web of Things is also blinking a LED (エルチカ@ja).

4GエルチカWoT on IchigoJam

Taisuke Fukunoさんの投稿 2017年3月14日

1. Prepare hardwares
- Sakura's IoT module beta - Sakura's IoT Platform
- Break out board - Sakura's IoT Platform
- IchigoJam T - IchigoJam - with 1.2b42 firmware (beta download from Facebook Group)
- I2C level converter - PCA9306 - Akizuki Denshi
- some jumper wires

2. Regist the Sakura's IoT module
Make a project and a WebSocket service.

* Orange is module ID

3. Connect them
The signal voltage of Sakura's IoT module is 1.8V but IchigoJam is 3.3V.
So you have to change the voltage by PCA9306.
Cut a VCCB(right-top) pin and connect yellow wire (1.8V LOD_OUT of Sakura's IoT module) above.

Put the PCA9306 on the right of the Sakura's IoT Module.
Yellow : VCCA(left-top) - 3.3V on IchigoJam
Blue: SDA(left-middle) - SDA on IchigoJam
Green: SCL(left-middle) - SCL on IchigoJam
Orange: right-top of the Sakura's IoT Modlue - 5V on IchigoJam

VCCB(1.8V) - LOD_OUT(left of the Sakura's IoT Module) (Yellow)
GND(left of the Sakura's IoT Module) - GND on IchigoJam

* Connect WAKE_IN to 1.8V or 3.3V as pull up for the v1.2 firmware (added 2017.6.22)
こちらがブレイクアウトボードのピン配置。IchigoJamとつないでの実験、楽しみです!

And turn your IchigoJam on!
Wait a moment until single blinking the LED on the Sakura's IoT Module.

4. Send from the IchigoJam
Open the WebSocket service.

* Yellow is Token to access

Write this program to access Sakura's IoT Module. (beta needs checksum, so a little long code)

900 @I2C 910 M=PEEK(#701)+2 920 C=0:FOR I=0 TO M-1:C=C^PEEK(#700+I):NEXT:POKE#700+M,C 930 IF I2CR(79,#700,M+1,#780,N+1) STOP 940 C=0:FOR I=0 TO N-1:M=PEEK(#780+I):C=C^M:?M;" ";:NEXT:? 950 IF C!=PEEK(#780+N) OR PEEK(#780)!=1 STOP 960 RTN

And try this code to test! If you'll get "1 1 0" or "1 1 128" it's success!

POKE#700,1,0:N=3:GSB@I2C 1 1 0 OK

Wait until you will get "1 1 128". (0:4G no connections, 128:4G connected)
To put a data into the queue

C=1:A=123 POKE#700,#20,10,C,73,A,A>>8,0,0,0,0,0,0:N=2:GSB@I2C

To send data

POKE#700,#24,0:N=2:GSB@I2C


You will get your data on the control panel.

5. Recieve from the web
Download the program in JavaScript from lchika@GitHub.
Rename the "sakura-setting-rename.js" to "sakura-setting.js".
Edit a name of module and a token on the "sakura-setting.js". (Abobe Orange and Yellow on your Sakura control panel)
This is a code to get the count of the receive queue.

POKE#700,#32,0:N=4:GSB@I2C:?PEEK(#783)

Open "index.html" on your browser and touch the "ON" button.

You get "1" as receive queue count.

POKE#700,#32,0:N=4:GSB@I2C:?PEEK(#783)

And you get a data!

POKE#700,#30,0:N=#14:GSB@I2C:?PEEK(#784)

6. Program WoT blinking a LED in BASIC!

1 'SAKURA's IoT beta recv test 100 @LOOP 110 GSB @CHK:IF N=0 WAIT 30:CONT 120 GSB @GET:?"RECV:";N:LED N 130 GOTO @LOOP 800 'IoT Lib 810 @CHK:POKE#700,#32,0:N=4:GSB@I2C:N=PEEK(#783):RTN 820 @GET:POKE#700,#30,0:N=#14:GSB@I2C:N=PEEK(#784):RTN 900 @I2C:'use M,C,I 910 M=PEEK(#701)+2 920 C=0:FOR I=0 TO M-1:C=C^PEEK(#700+I):NEXT:POKE#700+M,C 930 IF I2CR(79,#700,M+1,#780,N+1) STOP 940 C=0:FOR I=0 TO N-1:M=PEEK(#780+I):C=C^M:?M;" ";:NEXT:? 950 IF C!=PEEK(#780+N) OR PEEK(#780)!=1 STOP 960 RTN

Try to make your original WoT!

Tweet
クリエイティブ・コモンズ・ライセンス
この作品は「Creative Commons — CC BY 4.0」の下に提供されています。
CC BY 福野泰介 - Taisuke Fukuno / @taisukef / high-res profile image