Categories
Robo Roadie
Purpose
I've got this RockNRoller cart thing that's basically a dolly/cart with collapsible arms that can be extended, and is great for hauling speakers and heavy musical equipment around. It's very handy as is, but I don't really use it all that much. What would motivate me to use it more? If it were motorized and remote control from my cellphone, of course!
Parts
If you count the cost of the cart then this is a pretty expensive project. I've had the cart for years though. This could work with just about any wheeled cart you can round up, assuming you're willing to figure out how to mount the motors to it.
1 x Rock N Roller R10RT cart - $185
2 x Auto Power Seat Motors - $30
2 x 8" Pneumatic Tires+Wheels - $16
2 x Hobbywing Quicrun 1060 ESC - $40
1 x Arduino Nano - $4
1 x Arduino Nano I/O Shield (not required) - $8
1 x HC-06 Bluetooth Adapter - $8
1 x 5v BEC (not absolutely required) - $8
1 x 12v Battery (I used a 3S Lipo) - $15
1 x Android phone/tablet to control over bluetooth - ???
1 x Blueberry Android App - free
So, total cost not including the cart was about $130. With that particular cart, around $310 I guess.
Description
Here's what I wound up with:

Here's what I started with:

I'll upload a video as soon as I get a chance to video it in action.
So I took off the back wheels and mounted some fairly powerful motors onto it. I used two power seat motors for cars. They're great because:
1. they're cheap (around $15 on Amazon)
2. they're easily powered by 12vdc
3. the housing is not grounded (unlike most power wiper motors), so they're reversible without shorting out via the metal frame.
Here's a link to what I got, though I'd recommend looking for an "Amazon Prime" version if you can find it:

https://www.amazon.com/gp/product/B005IR1NBA/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
I used a couple of wheels+tires that I got from Freight Harbor. It's 8", supposedly non-marring, and is fairly easy to adapt to the motors I've got by using some hardware from Lowes. I used a 0.5" sleeve to get it to snug down pretty tight on the motor shaft.

An Arduino Nano and a I/O shield handle the logic, and a cheap bluetooth adapter (around $8 on amazon) handles the communications from the controller. I use my Android phone as the controller, and the app Blueberry does a great job of collecting speed/direction via screen presses.
Inexpensive Arduino Nano on Amazon:

https://www.amazon.com/gp/product/B015MGHH6Q/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
The Nano I/O shield:

https://www.amazon.com/gp/product/B011U8G1JO/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
The bluetooth adapter:

https://www.amazon.com/JBtek-Bluetooth-Converter-Serial-Communication/dp/B00L08GA4Q/ref=sr_1_1?s=pc&ie=UTF8&qid=1471211629&sr=1-1&keywords=bluetooth+hc06
The Blueberry app:
https://play.google.com/store/apps/details?id=com.bluetooth&hl=en#details-reviews
That app "Blueberry" is really cool. It won't work by just installing and pairing it, you have to code for its heartbeat signals. That's a really good thing though. That way, if the Arduino quits responding then the app almost immediately notices it, and it disconnects. Also, the Arduino will know very quickly if the app has disappeared. It helps to keep this Robo Roadie from going berserko and breaking ankles. It's definitely powerful enough to do great harm to an ankle should it get loose.
To drive the motors I used some inexpensive reversible brushed speed controllers. I've used these on several projects and they're reliable and fairly powerful. The Hobbywing Quicrun 1060 - around $20 per wheel.

https://www.amazon.com/gp/product/B00LXCM3Q8/ref=oh_aui_search_detailpage?ie=UTF8&psc=1
For power, I use whatever 3S Lipo battery I've got charged up. They can be had for $15 or so from HobbyKing. It runs for a long time on a 5000Mah 3S battery. I also used a separate BEC to get the ~12v down to 5v for the arduino+bluetooth adapter. I could probably use the BEC that's built into the ESCs, but I've pretty much decided to quit trusting ESCs for 5v. Separate BECs are so cheap (around $8), I'd rather just use one and know for certain that I'm going to get around 5v. I used a Dr. Mad Thrust 3A BEC that also has an on/off switch that you can use to turn on/off another device, like headlights.

http://www.hobbyking.com/hobbyking/stor ... ouse_.html
My Arduino code does the following:
- connects to the bluetooth adapter via software serial
- waits for a connection from an external device (Blueberry)
- watches for speed commands, remaps/mixes them, and sends them out to the speed controllers
The code is here:
https://github.com/nshaver/roboroadie

Saturday, July 16, 2016, 10:13 PM - Tutorials
Posted by Administrator
Posted by Administrator
Purpose:
Suppose you have your Pi perfectly configured on its 64GB SD card, and you want to back it up, and perhaps restore it onto a 16GB SD card. This introduces a problem -- even though your pi image may only be using 4GB or so, its backup img file will be 64GB. You can't restore a 64GB image onto a 16GB card.
AND... the backup image file is taking up more room than is needed.
AND... even if you do have a 64GB card to restore it onto, it takes forever.
This tutorial will walk you through resizing the img file down to the largest size that it really needs to be, perhaps 4GB or so.
Most of these steps were taken from:
http:softwarebakery.com/shrinking-images-on-linux
First - shutdown pi, remove sd card, insert into another linux machine that has sufficient free space to copy the entire SD card (64GB card requires at least 64GB of free space).
Instructions:
Do each step below as root or with sudo:
1. backup the card to an image file.
dd bs=1M if=/dev/mmcblk of=myimage.img
2. mount the image as a loopback device
modprobe loop
losetup -f
losetup /dev/loop0 myimage.img
partprobe /dev/loop0
3. use gparted to resize to barely hold data, leave the rest as unpartitioned space
gparted /dev/loop0
4. exit gparted after resize is applied.
losetup -d /dev/loop0
5. use fdisk to view partition table:
fdisk -l myimage.img
Disk myimage.img: 14.9 GiB, 16012804096 bytes, 31275008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xba2edfb9
Device Boot Start End Sectors Size Id Type
myimage.img1 8192 122879 114688 56M c W95 FAT32 (LBA)
myimage.img2 122880 8447999 8325120 4G 83 Linux
^^^^^^^
6. truncate everything after the "End" (+1 * 512) of the last partition:
truncate --size=$[(8447999+1)*512] myimage.img
7. restore image to sd card:
dd bs=1M if=myimage.img of=/dev/mmcblk
8. boot pi to image, use raspi-config to resize to fill card.

Saturday, July 16, 2016, 04:21 PM - Tutorials
Posted by Administrator
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
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

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
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:

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

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