Raspberry Pi Anti-sleep Sensor

버전 1.2 (40.9 KB) 작성자: Omar Hadeed
The RPi can be used in a situation where a truck driver is worried about dozing off behind the wheel. Use RPi to alert the driver.
다운로드 수: 111
업데이트 날짜: 2019/9/25

라이선스 보기

You will need :

1) Raspberry Pi Hardware preloaded with MATLAB/Simulink support package.

2) SenseHAT shield.

3) Elastic headband (bandana)

Part I. Accelerometer test:

-The senseHAT shield is equipped with an IMU that has a very accurate accelerometer. We can use this sensor to detect tilt.

-MATLAB function "sleepyDriver2.m" is used in a "for" loop:

for i=1:1000
sleepyDriver2(Raspberrypi_obj)
end

The truck driver straps the Raspberry Pi to their head by wearing the headband.

After running the MATLAB code in the command window, the LED display will change according to the head position of the driver.
Please check out the initial test here:
https://youtu.be/PF_tzBl8VXk

Outcomes of part I. :
-The user is able to see the LED display change with head tilt.
-The threshold value for tilt is fine-tuned by the user to fit their need.

Part II.
-This part satisfies the goal of alerting the driver every time the word "slp", short for sleep, shows up on the LED display.

-Fortunately, Simulink has excellent Raspberry Pi blocks that will help us reconstruct the previous MATLAB code and add a virtual buzzer to the final prototype.

-Upon opening the Simulink model, the user will choose to run the block diagram externally on the Raspberry Pi.

The prototype is then taken on a test drive which can be found here: https://youtu.be/Cv94Az-yxQw

Outcomes of part II. :
-The user is able to hear the sound of the buzzer by hooking up an FM transmitter to the 3.5mm jack socket on the Rasberry Pi and broadcast the alarm to a station that can be tuned into on the car's radio.
-Finally, for truck drivers, Raspberry Pi can be configured to run the Simulink model every time it is switched on. To do that, follow the steps in the following tutorial:
https://www.mathworks.com/help/supportpkg/raspberrypi/ug/run-simulink-model-on-reboot.html

인용 양식

Omar Hadeed (2024). Raspberry Pi Anti-sleep Sensor (https://www.mathworks.com/matlabcentral/fileexchange/71842-raspberry-pi-anti-sleep-sensor), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2017b
R2017b에서 R2019a까지의 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Embedded Coder에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

upload (2) (2)/upload

upload (2) (2)/upload

버전 게시됨 릴리스 정보
1.2

added the pixel images

1.1.5

Changed file name

1.1.0

missing words

1.0.0