Categories
Raspberry Pi Touchscreen Kiosk 
Saturday, July 16, 2016, 04:21 PM - Tutorials
Posted by Administrator

Raspberry Pi Browser Kiosk


Purpose:


So you've got a Raspberry Pi and a touchscreen, and you want to make it boot straight into a fullscreen web browser in kiosk mode. You also might want it to display a screen with some buttons that do things like reboot or shut down.

Example:




Requirements:


- A Raspberry Pi. This has been used on an original Pi B, and a Pi 3, so I figure it will work on pretty much anything in between.
- A touchscreen. This has been used with a couple of different touch screens. Getting your touchscreen to work is a whole nuther project. Here are the two I have used:
-- a very cheap HDMI+hat touchscreen, mounted to my Pi 3: https://www.amazon.com/gp/product/B00YE1E1UQ
-- a very cheap hat-only touchscreen, mounted to my original Pi:
https://www.amazon.com/Adafruit-PiTFT-480x320-Touchscreen-Raspberry/dp/B01F80RRN4/

Instructions



1. start with a working raspbian, and working touch screen



2. install the matchbox window manager and surf


sudo apt-get install matchbox-window-manager surf


3. create ~/.xsession file with the following:


#!/bin/bash
surf http://www.google.com &
exec matchbox-window-manager -use_titlebar no


4. reboot and observe that the pi boots to a kiosk screen



5. install the packages needed to get a webpage doing things like reboot or halt


sudo apt-get install suckless-tools lighttpd php5 php5-cgi
sudo lighty-enable-mod fastcgi-php
sudo /etc/init.d/lighttpd force-reload


6. give the www-data user access to shutdown/reboot.


add the following via visudo:
www-data ALL=NOPASSWD: /sbin/shutdown, /sbin/halt, /sbin/reboot, /sbin/poweroff


7. create /var/www/html/kiosk.php, with the following:


<?php

if (isset($_POST['submit'])){
if ($_POST['submit']=='reboot'){
$cmd='sudo reboot';
$ret=exec($cmd, $out);
}
if ($_POST['submit']=='shutdown'){
$cmd='sudo shutdown -h now';
$ret=exec($cmd, $out);
}
}

// get ip address
$cmd='hostname -I';
$ret=exec($cmd, $out);
$http_host=$out[0];

echo <<<eohtml
<html>
<head>
<style>
.formbutton {
width: 100px;
height: 50px;
}
</style>a
</head>
<body>
Raspberry Pi Menu:<br>
IP: {$http_host}<br>
<form name="frm" id="frm" method="post" action="">
<input class="formbutton" style="background-color: #F30;" name="submit" type="submit" value="reboot"><br>
<input class="formbutton" style="background-color: #F30;" name="submit" type="submit" value="shutdown"><br>
<input class="formbutton" name="submit" type="submit" value="reload"><br>
</form>
</body>
</html>
eohtml;
?>


8. modify ~/.xsession URL


Edit and point to http://localhost/kiosk.php and reboot
add comment ( 618 views )   |  permalink
Nerf Gun Robot 
Thursday, June 9, 2016, 03:41 PM - Robots, Programs
Posted by Administrator

Purpose:


This 4 wheel drive robot supports RC remote control, a headlight, a 2DOF arm with a gripper, remote Nerf gun firing, 5.8ghz video transmission, and automation via Raspberry Pi (not yet implemented).




Parts List:


4 x Pololu brushed DC gearmotors (2 with encodersj, 2 without)
https://www.pololu.com/product/3241

4 x Pololu wheels
https://www.pololu.com/product/1555

2 x Pololu motor mounting brackets (1 pair/pkg)
https://www.pololu.com/product/2676

1 x Ion Motion 2x15A Roboclaw motor controller
https://www.pololu.com/product/2395

Aluminum angles from Lowes - as needed to build frame.

2 x misc. servos for arm
https://www.amazon.com/gp/product/B0006O3XEA/

1 x misc. servo for Nerf gun trigger
https://www.amazon.com/gp/product/B0006O3XEA/

2 x misc. aluminum servo brackets (with bearing)
I can't find the ones that I usually get. I was getting them on ebay for around $4 each.

1 x ~5v headlight that can be turned on and off by simply removing or restoring power. Don't get one that uses a soft switch, because when you apply DC to those, they don't turn on until the button is pressed.

1 x Makeblock gripper
https://www.amazon.com/Makeblock-Robot-Gripper/dp/B00WG3KTL4/

1 x Arduino Nano
https://www.amazon.com/gp/product/B015MGHH6Q/

1 x Arduino Nano breakout board
https://www.amazon.com/gp/product/B011U8G1JO/

1 x Keystudio I2C PWM driver
https://www.amazon.com/gp/product/B0179AXJUQ/

1 x 5.8ghz video transmitter
https://www.amazon.com/gp/product/B00MLS0NOW/

1 x 12v camera
https://www.amazon.com/gp/product/B00RCZYIR2/

1 x Misc dual H Bridge, for controlling headlight and gripper
https://www.amazon.com/DROK-Controller-H-Bridge-Mega2560-Duemilanove/dp/B00CAG6GX2/

1 x electric Nerf gun. I used N Strike Elite
https://www.amazon.com/Nerf-N-Strike-Elite-Stryfe-Blaster/dp/B009T45XNM/

1 x 5v BEC for servo power and Arduino
https://www.amazon.com/Ship-Hobbywing-Switch-mode-UBEC-Lowest/dp/B008ZNWOYY/

1 x Misc 12v battery for video transmitter, camera, motor controller, and drive motors


Programs:


Arduino Nano code is on my github:
https://github.com/nshaver/nerfgun_rc_robot/

add comment ( 561 views )   |  permalink
Remote Control and Thermometer for Cappuccino Machine 
Wednesday, November 18, 2015, 06:22 PM - Programs, Devices, IOT
Posted by Administrator

Purpose:


My cappuccino machine takes about five minutes to warm up, and I wanted to turn it on remotely over wifi when I wake up so that when I enter the kitchen in the morning I wouldn't have to wait for it to warm up. I also wanted to be able to tell whether or not it was warmed up, so I added a thermometer and a LED ring to display the temperature.





Parts List:


1 X ESP8266
http://www.amazon.com/HiLetgo-Version-N ... ds=esp8266

Dallas temperature sensor
http://www.amazon.com/DROK-Temperature- ... V2RPBDKQ77

Adafruit Neopixel LED ring
http://www.amazon.com/NeoPixel-LED-Ring ... pixel+ring

PWM servo, a Hitec perhaps
http://www.amazon.com/Hitec-31311S-HS-3 ... itec+servo

ESP8266 Code


The code is on my github:
https://github.com/nshaver/cappuccino-power
add comment ( 546 views )   |  permalink
Atticbot 
Sunday, June 14, 2015, 05:47 PM - Robots
Posted by Administrator

Purpose:


Atticbot is a remote control vehicle thing that I designed to remotely crawl around my attic and inspect the bats that had moved in. It's basically just a couple of continuous-rotation servos attached to a yardstick frame, a battery, an RC receiver, a video transmitter, and a camera.



Parts List:


2 x continuous rotation servos
https://www.amazon.com/Futaba-FUTM0031-S3003-Standard-Servo/dp/B0015H2V72/

2 x yardsticks for frame

1 x RC receiver - FrSky somethingorother
1 x RC transmitter - Turnigy 9XR-Pro perhaps
1 x 5.8ghz Video transmitter+camera
1 x 5.8ghz Video receiver/display
https://www.amazon.com/Eachine-LCD5802S-Receiver-Monitor-Antenna/dp/B014IVSKGW/

I've really skimped on details on this parts list. Email me if you have questions.

add comment ( 529 views )   |  permalink
Object Avoiding Robot 
Monday, June 1, 2015, 09:28 PM - Robots, Programs
Posted by Administrator

Object Avoiding Robot





Purpose:


This 4wd robot navigates about using two SR04 ultrasonic distance sensors. One sensor points down to detect stairs/cliffs, and the other points forward and rotates left/center/right using a micro servo.

Parts:


4 x continuous rotation servos (for drive wheels)
https://www.amazon.com/gp/product/B01GYE5XZM/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

4 x wheels - must misc wheels I rounded up from toys, screwed onto the servo horns.

1 x micro servo to rotate forward-facing SR04
https://www.amazon.com/gp/product/B019H9BNTQ/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

2 x SR04 ultrasonic sensors\
https://www.amazon.com/Elegoo-HC-SR04-Ultrasonic-Distance-MEGA2560/dp/B01COSN7O6/ref=sr_1_1?s=electronics&ie=UTF8&qid=1494889316&sr=1-1&keywords=sr04

1 x Arduino
https://www.amazon.com/gp/product/B01N7I0W77/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

misc wood, hot glue gun, machine screws

Programs:


The Arduino code for this robot can be found here:
https://github.com/nshaver/4wd_sr04_robot/tree/master
add comment ( 538 views )   |  permalink

<<First <Back | 1 | 2 | 3 | Next> Last>>