New!

www.youtube.com/thesupertechchannel is officially going away. I will be removing all videos pertaining to content that is hosted on this website, and re-upload them to my new channel at www.youtube.com/esological. They will be reinstated on this site as well.

The why here is irrelevant. This change will slow me down a bit a first – I know i’ll be losing 90% of my audience by this change. Over time however, this change is one that needed to happen. thesupertechchannel was created in a time where I really didn’t know what content I wanted to make. I was a kid in middle school with a laptop and a copy of Sony Vegas. My analytics show that >= 50% of my views are found via search engine anyways so as long as I market myself better or at least as consistently as I did in days past, it won’t take me long to get to the point where I get ~ 100 views per video again.

I will also be able to analyze where my traffic is coming from better with this change. Hopefully I’ve some audience from this website,  and now that i’ve implemented changes in the back end of the operation of this site to be able to see where views are coming  from, I’ll be able to tailor content style to whatever posts get me the most traffic – what viewers want.

Woo!

also: minecraft, www.esologic.com:25565

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Plane | Functioning Plane Output Simulator [Research]

So here are all 3 prongs of the plane code thus far. This sends data to the visual basic program, then to the visual basic program where it gets interpreted and then sent to the plane simulator Arduino. Where it is written to servos and and led.

Arduino Controller:

Arduino Vehicle:

Visual Basic:

http://192.168.1.37/source/plane/Round_1/vehicle_companion/

Just download those files and you should be able to open them in the vb studio.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Spitting incoming serial data arduino and visual basic

UPDATED CODE HERE


Hello! as you can probably tell, my last post was written in a fury of incoherency, but I needed to get the code out there so it is what it is.

The main focus of this post is to showcase the arduino program. The visual basic in the video is very simple, and there will be much more on that later.

This below program will take a string of characters fed to the arduino and split them into usable parts. This is a very valuable tool for working with serial and arduino. It’s pretty well commented, but if you have any questions, PLEASE leave a comment. I’d love to see some conversation here.

So for example if you inputted

[code]
123,456.
[/code]

it would output

[code]
123|separator|456
[/code]

to the lcd, or the serial monitor if you tweaked the code.

Now for the code in the video. The only different part about this is that it writes the two values to the servos.

const char EOPmarker = ‘.’; //This is the end of packet marker
char serialbuf[32]; //This gives the incoming serial some room. Change it if you want a longer incoming.

#include // we’ll need this for subString
#define MAX_STRING_LEN 20 // like 3 lines above, change as needed.

#include //we’ll need this for the lcd
LiquidCrystal lcd(7, 8, 9, 10, 11, 12); //pins for the lcd, I set it up using the ladyada tutorial.

#include
Servo left_servo;
Servo right_servo;

int left_servo_pos;
int right_servo_pos;
void setup(){
lcd.begin(16, 2);
left_servo.attach(2);
right_servo.attach(3);
Serial.begin(9600); //changing this to other speeds has not been tested using this meathod
}

void loop() {
if (Serial.available() > 0) { //makes sure something is ready to be read
lcd.clear(); //clears for incoming stuff, won’t clear if there isin’t data to be read
static int bufpos = 0; //starts the buffer back at the first position in the incoming serial.read
char inchar = Serial.read(); //assigns one byte (as serial.read()’s only input one byte at a time
if (inchar != EOPmarker) { //if the incoming character is not the byte that is the incoming package ender
serialbuf[bufpos] = inchar; //the buffer position in the array get assigned to the current read
bufpos++; //once that has happend the buffer advances, doing this over and over again until the end of package marker is read.
}
else { //once the end of package marker has been read
serialbuf[bufpos] = 0; //restart the buff
bufpos = 0; //restart the position of the buff

left_servo_pos = atoi(subStr(serialbuf, “,”, 1));
lcd.write(“Left Servo:”);
lcd.write(subStr(serialbuf, “,”, 1)); //witres the first bit of content before the first comma (or other seperator) to the lcd
left_servo.write(left_servo_pos);

lcd.setCursor(0, 1);

right_servo_pos = atoi(subStr(serialbuf, “,”, 2));
lcd.write(“Right Servo:”); //this signifies that the first seperation has occured
lcd.write(subStr(serialbuf, “,”, 2)); //same thing as 2 lines above, but with the second parts. this can be repeated
right_servo.write(right_servo_pos);
}
}
}

// below is just function logic, which I do not fully understand. but it works.
char* subStr (char* input_string, char *separator, int segment_number) {
char *act, *sub, *ptr;
static char copy[MAX_STRING_LEN];
int i;

strcpy(copy, input_string);

for (i = 1, act = copy; i <= segment_number; i++, act = NULL) { sub = strtok_r(act, separator, &ptr); if (sub == NULL) break; } return sub; } //www.esologic.com //Thanks to http://arduino.cc/forum/index.php?topic=119429

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Splitting Strings Arduino

UPDATED CODE HERE


 

Hello!

Today I ordered parts for the proto phase of the plane.

This is a bit of code i’ve found that’s usefully for splitting strings in the arduino C

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Plane | Project [Declaration]

Ever since I posted this back in January I’ve been collecting ideas and information on how to make something like the craft pictured in the video and related ones.

The tenative parts list can be found here, but there’s an analog accelerometer, an esc + brushless motor combo, and a battery array so far.

As for wireless, that’s the one area of this project that I’ve done no research on at all. I’m probably going to use a long range bluetooth serial connection, or an xbee serial connection. No matter what it’s going to be serial, as that’s what I’m most familiar with.

So far I’ve proto’d the controller and written the framework for the visual basic program and some of the controller arduino side of the program.

Here’s the video of what I’ve done so far, as you can see the trackbar visualizes reallly nicely. and i’m using the split function and my knowledge of arrays to separate x and y resistance values from the joystick:

 

As you can probably also tell, there’s no name for the project yet, if you think of something let me know!

 

Research Link Repo:

http://www.open-electronics.org/mma7455l-three-axis-digital-output-accelerometer/

http://hackaday.com/2012/02/10/using-a-cheap-accelerometer-with-arduino-comes-with-a-catch/

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1263756306 //Wii as accelerometer.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiScanner | Project Execution [Demonstration/Distribution]

I should preface this by saying that it is no where near as polished as it could be. But it works, and the objects taken by the camera are recognizable. Eventually, if I have the funding, I will upgrade the Camera.

There are many elements to this project. There really isn’t a great place to start with this project, so well start with the fritzing schematic and a list of materials needed.

You will need:

2 Attiny85’s
16 wires
a breadboard
a 100k ohm resistor
a 330 ohm resistor
a raspberry pi
PIR motion detector
the cables for interfacing with the raspberry pi
an isp programmer for the attiny’s

So let’s look at this schematic:

When motion is detected, the signal pin on the motion detector gets pulled low. at this point the 3.3v attiny pulls pin 1 high, sending a signal into the rpi (it’s 3.3v so it’s safe for the broadcomm) and illuminating an LED so the user can see that motion is being detected.

The raspberry pi then sends a signal to the 5v attiny indicating that motion has indeed been detected. Once this occurs, the 5v attiny pulls the 5v pin going to the webcam high. I had to integrate this step of turning the webcam on via the attiny because there is a hardware misconfiguration that causes the software i’m using to take the picture hang. Turning the camera off and on each time a picture needs to be taken gets rid of this problem, because the camera always takes the first picture after being turned on.

At this point a picture is taken and moved to a flash drive. They could be moved wherever, but a flashdrive works the best for now, as I will be deploying this system in a place where there isn’t internet (in my garage)

Now time for source codes!

Software wise you will need:

The Arduino IDE

Python (I’m using Geany on the raspberry pi)

fswebcam which you can obtain by running

On your raspberry pi.

This is the source for the 3.3v attiny85

This is the source for the 5v attiny85

This is the python source, you will need to install this to make it work though.

This is the Fritzing document.

Here’s a sample image from the camera. It is looking at the breadboard.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiScanner – GPIO output | Documentation [Research]

I will need to illuminate the “subjects” that I will be capturing. In order to do this, I will eventually need to set some pin high. Weather it be that it sets of a camera flash or turns on some lights for a second, it will need to happen down the line.

 

Like all of my “research” I mostly googled around / plugged in code until something worked. I came back with these links:

http://www.youtube.com/watch?v=q_NvDTZIaS4

https://docs.google.com/file/d/0B2-00drKdqF0V09YSHgxcTEtelk/edit

http://hackaday.com/2012/06/17/using-the-gpio-pins-on-a-raspberry-pi/

 

Basically you need to install the Raspberry Pi GPIO, Import and use the RPi GPIO

1. Download the library:

$ wget http://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.2.0.tar.gz#md5=0fc4bfa6aabc856b0b75252a40ac75cc

2. unzip the file:

$ sudo tar -zxvf RPi.GPIO-0.2.0.tar.gz

you can remove the .tar.gz at that point

3. get into the directory you just created:

$ cd  RPi.GPIO-0.2.0

4. The devs included a great install script with this package, run it to install with:

$ sudo python setup.py install

Now you should see a bunch of text in the command line. I have no idea why, but my first run of this command didn’t “take” but I ran it again and now it works great.

 

To use this, you need to know what pins correspond to pins on the RPi. You can google this yourself.

 

Now we get writing code. I’m using a graphical python editor called geaney which comes pre-loaded with squeeze.

 

To blink pins 11 and 13, use and run this python script.

You can see the plaintext version of that script here.

 

Essentially i’m trying to mimic things I’ve done with an Arduino for some time.

Maybe later today (if I can somehow find a 100ohm resistor) I’ll work on using inputs. I have a PIR motion sensor with me, but I neglected to bring the proper resistor to use it. I do have tack switches and resistors for those, which I could use to mimic the motion detector, but I don’t think that would be as cool.

 

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

PiScanner | Basics [Research]

So I’ve determined that there will be 2 parts to this project.

 

1. Be able to take a picture with a USB webcam via command line.

I’ve landed on a program called fswebcam. I found it via a few google searches. I installed it by using the command:

 

$ sudo apt-get install fswebcam 

 

I used the:

 

$ man fswebcam

 

command to “derive” how to use the program, but essentially I made a

 

config file

 

that the program can execute. You can run the program with the above configuration by typing:

 

fswebcam -c /home/user/Pictures/picture.conf //the location of the .conf file should be wherever you put it, so the code after the space after the -c will be different for you. 

 

This will produce an image from your webcam in the location you specified in the picture.conf file.

 

Other info can be found here: http://www.r3uk.com/index.php/home/38-software/100-webcam-capture-using-fswebcam

 

I installed all of this on my server and got the below image. This is what the laptop running this website sees!

 

 

2. Write a python (I’ve decided to go with python because I’ve never used python before, it will be good to learn something new. And because there is already a library for controlling the GPIO pins on the RPi baked into the language.) script that can sense weather or not this sensor‘s alarm pin is pulled low. At that point, the script should then execute the above bash command and take a picture. After that, that photo should be moved somewhere to do something, but I don’t know what that will be yet. It will probably be uploaded to a secure location on my server and then I will have it email me if at the end of the night, something shows up.

http://pypi.python.org/pypi/RPi.GPIO

 

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

A comprehensive guide to controlling a lamp via the internet on any web enabled device.

Hello! sorry about my absence, I’ve been very busy with school/baseball over the past few weeks, but summer is soon, and I’ll be updating with a higher frequency once that happens.

So. you’ll need a few things in order to make sure this whole process works.

1. Multiple ethernet connections.

2. An Arduino and a compatible wiznet device (ethernet shield)

Yay Chinese knockoffs!

Here I’m using an arduino knockoff I got 2 years ago when I first got into hobby electronics, and an “ETHERNET 4 NANO” by gravitech. I didn’t want to permanently implement my arduino nano, but I still wanted to be able to do the project. It’s powered by 5v from my computer (well from a powered hub) and the brown striped wire goes to the + on the powerswitch tail II. The blue cable is ethernet.

3. A webserver with php installed on it. (Mine’s just LAMP’d)

This is the important part. The arduino is accessing a .php document on the server to tell weather or not the lamp should be on. The UI is also hosted out of the servo. That laptop is my old HP laptop that I’ve had for almost 6 years, it’s now got ubuntu 10.04 LTS on it and it’s been LAMP’d among other things.

4. Something that can SAFELY switch line voltage. (I’m using a powerswitch tail II, because I really don’t want to get killed, and it’s also very simple – if you’re using naked relays, please for the love of god, be careful with line voltages.)

This thing is a beast. I can drive it via 5v easily, and it switches line like a champ. It’s been in constant use since my last post about home automation.

START OF GUIDE

1. So first, we need to hook up the shield, the arduino and the PSTII. It’s really easy.

2. Get linux on the computer you want to run the server out of. I made a video a long time ago back when I was first getting into linux. The installation process is still the same, you can find that video here.

3. Install various programs your server. First things first, you have to install openssh by running the command:

sudo apt-get install openssh

This will make the server headless, and it will enable you to access the server via command line. Specifically through PuTTY for windows. You can then ssh to your server which is key. You then need to install LAMP by running the command:

sudo apt-get install LAMP

This will install PHP on your server as wells apache and mysql. The two ladder objects are not essential for this project, but if you are going to use the server for other things, I strongly recommend you get them as well. The install process is very easy, just make sure you WRITE EVERY USERNAME AND PASSWORD YOU USE DOWN. I’ve had to reinstall several times before I learned my lesson on this.

After you are done with that, install vim by running the command:

sudo apt-get install vim

Vim is a text editing program for linux. You also need to get pure ftp to upload and download files from your server. Get it by running the command:

sudo apt-get install pure-ftpd

Congrats! you are now an owner of a very powerful linux server. Wasn’t that easy?

4. Upload the call.php, res.php documents to your server.

This is the call.php text, you just need to make it into a .php document and upload it to the server. This document creates a form that the user accesses to turn the lamp on and off.

This is the res.php. It is what the user is taken to once they have entered the information in the call.php.

If you walk though the code. You will see that once the correct password gets entered, the res.php document creates a functioning document stat.php. This is the same document that the arduino reads, and compares to.

5. You need to upload the arduino code.

Here it is, upload it to your board with the shield attached, and everything should work. Access the call.php via your server, and go through the process.

At this point everything should work, please let me know if it doesn’t in the comments.

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.

Me

This is my desk.probably what my mind looks like right now as well

Look how messy it is! That’s what happens when someone with minimal experience tries to make a website. Making this server / website was pretty easy actually. The hardest part was obtaining a computer to run in all on.

This website is going to be where I post things that I make / show you how to make / things I find awesome. It is also going to be a companion to my youtube channel: www.youtube.com/user/thesupertechchannel

Coolcoolcool

Hey! This post was written a long time ago, but I'm leaving it up on the off-chance it may help someone. Proceed with caution. It may not be a good idea to blindly integrate this code or work into your project, but instead use it as a starting point.