레이블이 raspberry pi project인 게시물을 표시합니다. 모든 게시물 표시
레이블이 raspberry pi project인 게시물을 표시합니다. 모든 게시물 표시

2015. 1. 29.

[Casual hacking] GPIO app PROJECT 1 : Traffic lights

[Casual hacking] GPIO app PROJECT 1 : Traffic lights

What is GPIO app PROJECT?
GPIO app PROJECT is automation projects created with GPIO ports of Raspberry Pi and apps for PROTA. The result is simple. Programming is building a logical formulation that executes specific operation using computer language. The combination of the two elements, GPIO and PROTA apps, give users a chance to build for themselves logical, working products, that we believe is an user-defined programming, that they can experience in just a couple of steps.
(Users can simply program in a couple of steps using GPIO by choosing sensors on the top and actuators on the bottom.)

Projects may vary depends on the combination of the apps. To start off, you’ll be able to grasp the basic idea of the GPIO app by following the instructions below.


PROJECT 1 : Traffic lights


Have a look at the above two rules. By simply selecting and defining conditions that users desire, a formulation of traffic lights can be built in just three steps.

If you still have a hard time grasping the idea of Ambiency, please check out the link below.


[Quick & Dirty guide] Make an image file of Ambiency rule!

1. How to setup pins on the breadboard, LED, and webcam
Wire LED to GPIO pins 17 and 27.




2. Set up the GPIO app
Set the values of the above pins on the UI.
The saved values on this app becomes the source values when creating automation rules on Ambiency. Please click Remember & Save button to save.


3. Create automation rules!
Create two rules like the following by choosing the source values you've created in the above steps on the GPIO app.
  • 1st Rule
  • Sensor app - Webcam app
    Trigger - "Motion detected : Edge rising"
  • Actuator app - GPIO app
    Action - "Write value : GPIO $pin : Write=1" & "Write value : GPIO %pin : Write=0"
  • If motion detected is interrupted on Webcam -> write value 1 in the output of $pin on GPIO(app) to turn on a LED -> write value 0 in the output of %pin to turn off a LED.
  • As a result, the rule turns on the green and turns off the red traffic lights on motion detection for pedestrian signals.
  • 2nd Rule
  • Sensor app - Webcam app
    Trigger - "No motion : Edge falling"
  • Actuator app - GPIO app
    Action - "Write value : on GPIO $pin : Write=0" & "Write value : on GPIO %pin : Write=1"
  • If No motion on Webcam -> write value 0 in the output of $pin on GPIO to turn off a LED -> write value 1 in the output of %pin on GPIO to turn on a LED.
  • As a result, the rule turns off the green and turns on the red traffic lights on no motion for pedestrian signals.

4. Test and find out in History!


In this session, you’ve just created a working traffic lights by creating rules with GPIO. As shown in the first picture, there’re many combinations of rules that can be created with GPIO and other apps.

Please check out other projects you can try out in the coming sessions.

Thank you.

2015. 1. 27.

[Casual hacking] GPIO app PROJECT 1 : 신호등(Traffic lights)




[Casual hacking] GPIO app PROJECT 1 : 신호등(Traffic lights)


GPIO app PROJECT란?
GPIO app PROJECT 는 라즈베리파이를 이용한 창작물(프로젝트 결과)들을 PROTA Pi의 GPIO앱으로 구현함과 동시에~ smart hub PROTA Pi의 다른 앱들과 조합하여 자동화 룰을 만들어 보는 것입니다!
(GPIO app이 '센서(Sensor)'와 '액츄에이터(Actuator)'로 선택되어 다른 앱들과 연동이 가능합니다!)

한 가지의 프로젝트가 조합되는 앱이 무엇이냐에 따라 아주 다르게 사용될 수 있는거죠!!
아직 와닿지 않으실 수 있으니,
오늘은 아주 간단한 첫 번째 프로젝트를 소개하면서 GPIO 앱에 익숙해지는 시간을 갖겠습니다!



PROJECT 1 : Traffic lights



위에 두 개의 Rule이 있습니다.
기존에는 Programming 을 해야만 가능했던 신호등 만들기를
위의 세 개의 Rule로 만들 수 있습니다.

아직 엠비언시(ambiency) 룰 만들기를 모르신다면 아래의 링크를 확인하세요!

[Quick & Dirty guide] Automation solution, Ambiency tutorial. Why not make your own rule?

[Quick & Dirty guide] 엠비언시 룰(Ambiency rule) 이미지 만들기!


1. 보드 pin, LED, 웹캠(webcam) 셋팅하기
LED에는 GPIO17, GPIO27을 셋팅해줍니다.






2. GPIO 앱 셋팅하기
해당 pin을 GPIO 앱 UI에서 찾아서 하나씩 값을 설정해줍니다!
여기서의 설정이 엠비언시(ambiency) 앱에서 자동화 룰을 만들 때 소스(source)가 되니,
꼭 Remember & Save 를 해주셔야 됩니다!




3. 자동화 Rule 만들기!
이제 GPIO 앱에서 설정해준 소스들을 자동화 룰로 설정만 해주면 됩니다!
  • 1st Rule : 

    • Sensor app - Webcam app
      Trigger - "Motion detected
       : Edge rising"
    • Actuator app - GPIO app
      Action - "Write digital : GPIO $pin : Write=1" & "Write digital : GPIO %pin : Write=0"
    • Webcam 앱의 motion detected의 interrupted가 발생하면 -> GPIO 앱의 $pin에 output에 1을 입력하여 LED 불이 켜지고 -> %pin에 output에 0을 입력하여 LED 불이 꺼지게 한다.
    • Webcam에 물체를 감지하면 보행 신호를 켜게 하는 것입니다.

  • 2nd Rule 


    • Sensor app - Webcam app
      Trigger - "No motion : Edge falling"
    • Actuator app - GPIO app
      Action - "Write digital : GPIO $pin : Write=0" & "Write digital : GPIO %pin : Write=1"
    • Webcam 앱이 No motion이면 -> GPIO 앱의 $pin에 output에 0을 입력하여 LED 불이 꺼지게 하고 -> %pin에 output에 1을 입력하여 LED 불이 켜지게 한다.
    • Webcam에 물체가 감지되지 않으면 주행 신호를 켜게 하는 것입니다.

4. 테스트 그리고 History 확인!



'PROJECT 1 : Traffic lights' 에서는 GPIO앱과 GPIO앱 만의 자동화 규칙을 만들어 봤는데요,
위 이미지에서도 보셨듯이 GPIO앱과 연동할 수 있는 앱들은 정말 많습니다.

앞으로 유용한 PROJECT 시리즈를 소개해드릴 수 있도록 하겠습니다!

감사합니다 :)

2015. 1. 19.

[Quick & Dirty guide] GPIO app for Raspberry Pi

[Quick & Dirty guide] GPIO app for Raspberry Pi

(source : bitcraze.se)

(source : Adafruit)
(source : Davidhunt.ie)

There are already numerous creative projects out there as shown in the above, and the number of projects are on the rise.

For us, Raspberry Pi means a lot to us.

It’s a perfect low-cost hardware platform for PROTA that enables what it’s capable of now.

In return for its great hardware platform, we decided to release GPIO, the app that lets users make a full use of the possibility of Raspberry Pi with very little effort.

This’s the app.













Features
  • Change interface mode
  • Set specific 'pin'
    • Input : 'Read' value
    • Ouput : 'Write' input value
    • Serial communication : UART, SPI, I2C
    • PWM : 'Write' input value
    • Edge_Rising / Edge_Falling : detect edge status

Why need for the GPIO app?

No need to code to see it work

If you wanted to control GPIO, you had to code. However, now with the GPIO app, all you have to do is enter 1 in the OUPUT data and with just a few clicks, you can see it work instantly. It won’t take days or hours of your time to get it going.

"Automates pin & pin, pin & web services"

GPIO pins can be used as a sensor or an actuator to execute an rule automation. For instance, if PIR sensor detects a motion, turn on the LED connected to GPIO 17. If the weather in sunny in the afternoon, lower the PWM value to 10 connected to GPIO 18. Far more can be achieved and realize your imagination.

All this is possible because of the automation app, Ambiency.

From here on, you’ll be able to check out diverse PROTA Pi projects using GPIO from [Casual hacking].

2015. 1. 16.

[Quick & Dirty guide] GPIO app for 라즈베리파이(Raspberry Pi)

[Quick & Dirty guide] GPIO app for 라즈베리파이(Raspberry Pi)

(이미지 출처 : bitcraze.se)
(이미지 출처 : Adafruit)
(이미지 출처 : Davidhunt.ie)


위 사진들처럼 전세계적으로 정말 수많은 라즈베리파이(Raspberry Pi) 프로젝트들이 활성화 되어 있죠!

앞으로도 얼마나 많은 프로젝트들이 생겨날 지 모르겠습니다.

라즈베리파이는 NARAN에게도 큰 의미가 있는 제품입니다.

바로 PROTA Pi의 하드웨어 플랫폼이기 때문이죠.
오늘은 이 라즈베리파이를 통해 PROTA Pi가 출시된 것에 대한 고마움의 의미로
Raspberry Pi foundation, Raspberry Pi users 을 위해 만든
'GPIO 앱'을 소개하고자 합니다!





Features
  • Change interface mode
  • Set specific 'pin'
    • Input : 'Read' value
    • Ouput : 'Write' input value
    • Serial communication : UART, SPI, I2C
    • PWM : 'Write' input value
    • Edge_Rising / Edge_Falling : detect edge status
GPIO 앱을 사용하면 무엇이 좋을까요?

"Need not 'programming' "

개발자가 아니어도 GPIO 앱을 이용한다면 기존에 pin의 상태를 설정하기 위한 프로그래밍이 필요없습니다. 몇 번의 클릭만으로 PWM 값을 입력할 수 있고, LED 를 켜기 위해 해당 핀을 클릭하여 output 입력칸에 '1'이라는 숫자만 입력하면 됩니다.


"Automates pin & pin, pin & web services"

GPIO pin을 자동화 규칙을 만들기 위한 'sensor', 'actuator'로 사용할 수 있습니다.
"PIR 센서에 모션이 감지되면, GPIO 17의 LED의 불이 켜져라"

"오늘 오후 날씨가 '맑음'이면, GPIO18의 PWM value를 10으로 줄여라"
몇 가지 예를 들어봤는데요, 모두 쓸 수 없을만큼 많은 자동화 규칙을 만들 수 있습니다.
우리가 상상하기 나름이겠죠?
자동화가 가능한 이유는 소개드렸던 '엠비언시(Ambiency)'이기에 가능합니다.

앞으로 [Casual hakcing] 코너에서 GPIO를 이용하여 다양한 PROTA Pi 프로젝트를 소개해드리겠습니다.