Recent site activity

Projects

These are some of my projects.
I don't get much free time now days so don't expect much

PING!

posted Sep 21, 2011 8:35 PM by robert sturzbecher

I am still alive. Just been very busy so have not had time to add content.

Some of the things I have been working on include:
- Adding Bluetooth to MCUs (you can get the BT-TTL modules of ebay for about $5)
- Bitcoin mining machines. How to add 4 video cards to a PC for some hardcore GPU Mhash counts
- Facial recognition in processing. Good for helping your robots with there head shots ;)   

How to make a cheap USB RS232 Into a TTL serial Adapter

posted Feb 12, 2011 3:28 AM by robert sturzbecher   [ updated Feb 12, 2011 4:03 AM ]

Face with the problem of getting serial information out of my USnooBie I decided I needed a FTDI cable. But I didn't want to wait weeks for one or pay more then it was worth so I set out on a mission to make one.

As it turned out it was not that hard. I had some cheap USB-Serial adapters and I know that these cable inside have a USB to TTL serial chip then a second chip to step the voltages upto the RS232 standards. 



This is the adapter with the moldered casing removed. If you ever have to remove a moldered casing, remove the edges first and top can be peeled up without damaging any components.

Now that I can see that it has a PL-2303HX chip I can start looking for the datasheet to find the pins that I need.  

Now rather then solder directly to the chip I traced the pins until they were more exposed. I was in luck, they both connected to diodes which made a great spot to attach my wires.  


Completed

In total I attached 4 wires, RX, TX, GND and 5V. 

Connecting the RX/TX wires to the USnooBie TX/RX pins (D1,D0) I was able to create sketches that use Serial.println now for debugging. 


 
  

USnooBie_AVR_experience

posted Feb 10, 2011 4:30 AM by robert sturzbecher   [ updated Feb 12, 2011 4:06 AM ]

Wanting to cut costs a little with my Arduino projects and try something more customizable(and cheaper) I decided to try using some USnooBie the site gives some info on how to use with the Arduino environment and seemed straight forward.  

So I ordered the some kits from seeedstudio because they had other items I wanted and cheap.

The USnooBies arrived soon after in kit form like expected and did not take long to assemble.



but after assembling that is when all the fun starts. What I did not know is that the USnooBie requires a driver to be installed to use, but the catch is that I use Windows7 64bit and that you can not install unsigned drivers like the one I needed to install. Well there are hacks for this but some how in the process I was able to get the signing for all of the driver installed invalidated. Windows is not really that useful when it will not load any drivers (Like Network, USB or storage).

I few hours later I came up with a workaround to get my system up (kinda) and loaded up Arduino 22. The USnoobie is now detected as a USBasp device and Arduino configured to match. I loaded Blinky and changed the LED pin settings to match and uploaded. 
avrdude: error: usbasp_transmit: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning.

poop, Maybe a driver issue. Tried on a Windows7 32bit machine.
avrdude: error: usbasp_transmit: usb_control_msg: sending control message failed, win error: A device attached to the system is not functioning.

crap, maybe a Windows issue, Tried on a Mac
error:Pipe has stalled 
 
Hmmm where to now, I know, swap the the MPU, re-solder all points and triple check all bits. Still same errors. 
Right time for more Googling, forums and emails, still not working.

But I did find comments like "V-USB and Arduino's IDE just don't mix well."  and "you can't use the serial monitor without connecting a serial port or a serial port to USB converter."

All is not lost yet, I don't give up that easily 
But maybe I will stick to MPU's with better USB support like the Teensy and pay that little extra and wait that little longer for shipping.




All was not lost, Frank returned my email.
"That error is actually expected, what happens is that, after the
upload finishes, the bootloader exits immediantly. This means that the
bootloader does not reply to the computer at all anymore, and thus the
computer gives you that error.

It turned out that it was working. Because I was getting the error and didn't think it was uploading I wasn't moving on. Now the only thing let is serial support. I have found a software solution (vusb-for-arduino) that might work but I think I might just make a cheap USB to TTL serial adapter from a cheap USB to Serial adapter.




  

Processing

posted Feb 6, 2011 2:20 AM by robert sturzbecher





I have decided to post the Processing code to render the data from the Arduino. This my first processing project. I have kept the code very simple and with that flexible. This code does not have to be used with a PIR sensor it could be used with any analog sensor on 2 servos.  


// GR0B Basic draw   - Robert Sturzbecher
// This is my first Processing project. The purpose of this project is to render the values received back from a PIR sensor on 2 servos to give a crude image
// server stepping on the Arduino is 3/180 if you use some thing different 
// I have made the code very generic and flexable to suit any project that outputs (X Y Value)


import processing.serial.*;

Serial myPort;                                   // Create object from Serial class
int val;                                         // Data received from the serial port
int ServoStepping = 3;                           // Change this to match the Arduino servo stepping  


void setup() 
{
  size(555, 550);                                //    ((180x3)+10)
  String portName = Serial.list()[0];            // you will get a error here if port not found or in use. [0] is first serial port found
  myPort = new Serial(this, portName, 19200);      
  background(0); 
}


void draw()
{
 String xString = myPort.readStringUntil('\n');  // read the serial port until a new line
  if (xString != null) {                         // if theres data in between the new lines
    fill(0);                                     // set fill to black

    String[] SerialLine = split(xString,' ');    // split serial string line into array
                                                 // string from arduino should line like this "X: 90 Y: 80 Val: 154"
    int PosX = int(SerialLine[2]);
    int PosY = int(SerialLine[4]);
    int PIRVal = int(SerialLine[6]);
 
    PosX = PosX *3;                               // zoom pixel size. 1/180 now equles a 3x3 size
    PosY = PosY *3;

    // define Color   
    int R = (PIRVal - 120);                   // you will need to customise these values to your project
    int G = (PIRVal - 130);
    int B = 25;
    
    fill(R,G,B);                                 // set color     
    rect(PosX, PosY, ServoStepping*3, ServoStepping*3);                      // Draw colored square  
 
    //print some debug info to console
    print(xString);    
    print("RGB: "+R+" "+G+" "+B);
    println(" PIR:"+PIRVal);     
  }
}

Tricopter/HKdrone project update

posted Feb 3, 2011 2:54 AM by robert sturzbecher

This is just an update and round up on one of my slower moving and long running project.

So let me introduce my Tricopter projects so far.
The goal is to create a drone that is loosely based on the HK-Drone from the Terminator movies. 
The HKdrones are just tricopters but with vectored ducted jets as opposed to exposed exposed blades.

One of the goals (or limits) is to make the drone on the cheap so he is not going to have all the nice UAV features you might read about on DiyDrones. The drone will have a wireless link back to a computer  and camera that will handle some of the high level smarts using OpenCV to do face tracking (targeting).

Having my drone look identical is not a main goal. I am more focused on getting something functional and maybe work on the looks after I get it all working on the inside


Prototype 2
This is my first real attempt and more of a prototype to test the electronics and programming (smarts) hence the zip ties and duct tape.

MPU wise it is powered by an old Arduino nano clone I have and the code is based off multiwii which I have had to change and cut down a fair bit due to code size memory restrictions. 
For a gyroscopes I am using Wii Motion Plus ($5 off ebay).
For the accelerometers I am using a Wii Nunchuck.($7 off ebay) 

The little brother.
Prototype 3 
It is still very much a work in progress and sports a smaller lighter frame and a more powerful MPU so I do not have to worry about memory restrictions. This little guy is going to use the same motors and electronics so will have the same power but with much less weight. 

For the MPU I am using a Teensy2++ and for the code I am basing it off Baron Pilot 


And now the HKdrone surprise part.
Turret (Very work in progress)  
The drone has a 2.4Ghz wireless camera that links back to a PC running OpenCV with the python wrapper uses face recognition to aim the turret (Similar to this) currently I have it working on a separate board and not wirelessly yet nor weaponized yet nor small enough to mount under the drone, hence very work in progress.  



  





 

Pyroelectric PIR Part2

posted Jan 27, 2011 6:43 AM by robert sturzbecher   [ updated Feb 6, 2011 2:44 AM by robert sturzbecher ]

Woohoo Pictures

I have started to learn how to use Processing to handle the PC side of the image processing. 


The hardware is the same as in pyroelectric infrared sensors project with the exception of a little playdoh around the sensor to act as a lens the rest of the changes are software changes.


Here are some screenshots of the application after doing a full sweep. Can you see me on the right and the light on the left?

Each square is 5 degrees in size. About 2 mins to capture.
from side to side it is a total of 180 degrees and 60 degrees high






2 degrees resolution. And about 5 mins to capture
 
 



Arduino + Solar LiPo Battery packs

posted Jan 24, 2011 6:04 AM by robert sturzbecher

I will detail this project more later.

As a useful way of powering projects you can use the cheap Solar battery packs from ebay that are designed for charging your phone.

The batteries normally have a USB and provide 5v out which is enough for powering most Arduino based projects. They also contain a LiPo battery, LiPo protection/charging circuit, Solar cell and a 5v step up regulator. All of which is worth more then the $5-$10 you pay on ebay.


What you can also do with this is because it has 5volt regulated output and only a single 3.7v LiPo cell you not only can Power your next Arduino project but you can use a analog input to monitor the battery level.

The analog pin will return a low number for a low voltage so 0=0v and 1023=5v(Vcc).
If Vcc is exactly 5v (not likely) you use a trick like this to return a rough voltage

    sensorValue = analogRead(analogInPin);
    BatterytVoltage = map(sensorValue, 0, 1023, 0, 500); 

so if the battery is at 4volts, BatterytVoltage = 400


A LiPo battery fully charged will be just over 4.2v and below 3.5v when discharged. Over charging and discharging can damage the battery which is why the charging/protection circuit is required. This will let you keep and eye on the battery level and know a rough battery level. 

It is also useful to attach a resistor to the solar panel and monitor the charge rate too if you have a spare analog pin.  

This is what I am doing for my http://www.gr0b.com/0_o/updates/pyroelectricinfraredsensorspirthermograph project, I am also using the Arduino for power management to all connected devices (ie: motors, camera, lights and things to come)  

Next step is to add the wheels and send it on its way, unlike a robot cleaner that has to return to its charging dock it will just seek out a sunny spot on the floor.     
 

Pyroelectric Infrared sensors (PIR) (thermograph)

posted Jan 24, 2011 4:00 AM by robert sturzbecher   [ updated Jan 24, 2011 5:32 AM ]

Pyroelectric sensors are cool and so is thermograph but the main real downside is cost. 
If you don't need it to be accurate here is a cheap and easy way of adding it to your next Arduino project.


For this project I will use a pyroelectric sensor from a PIR motion detector. Of coarse the temperature reading is not going to be very accurate but if you need accuracy then you will need something better then a $2 PIR sensor. 


There are a few things to note about PIR sensors. 
  • Background temperatures and Sensor temperatures influence the output.
    Holding the sensor or heat near the case will also influence the output.
    (So don't put them next to things that can generate heat like motors, LEDs ,ect..)

  • Motion detector types have 2 elements inside them.
    A left and a Right. One will drop the output voltage and the other will increase it.
    (This is why we cover one file with foil tape) These sensors normally have square windows.

  • These sensors see humans, The motion detector PIR sensors have filters built in that are optimized to see the heat emitted by humans. 

Ok lets start


Modding the sensor is done with a small bit of foil tape. Because the sensor has a left&right sides that increase and decrease the output depending upon which side detects the most heat we will cover one side. I used foil tape as the metal is a good IR reflector and a good conductor of heat and will hopefully disperse the heat. I found it was better to block the side the lowers the voltage, but you can do ether.
   





Wiring the sensor is easy, They only have 3 pins (Drain/Vcc, Source/Out, Ground). To wire to an Arduino you need to connect up as below

  • Drain/Vcc goes to 5Volts.
  • Source connect directly to a Analog pin of the Arduino and needs a 47k resistor that connects to Ground. 
  • Ground goes to ground.
Above is an extract from datasheet with my notes on it.

I didn't have a 47k so I used a 20k, still works well.



The Code to get the sensor value.

                        sensorValue = analogRead(sensorPin);

What did you expect it to be more complex? You can use most of the Arduino demo sketches to use the sensor. The only thing to note it that analogRead works better if you put a delay in front of it to let things settle first. 


Putting to use 
If you want something a little more complex you could try mounting the sensor on servos and use it to track people and their appendages ;) and oh yes that is a wireless camera on top.
You could even use it to map the surrounding environment.


In the video below the head does a sweep reading the PIR sensor values then returns to the strongest point with the lights, then repeats. The values are outputted to the computer if connected.  


The next step for this that I am working on is to process the data computer side to create a 2d PIR image, almost like Thermo graph but without the stupidly expensive price tag. 


The Datasheet is also downloadable from the product page above.

You can also get the sensors from other online stores like (I'm not plugging them its just were I shop) 
http://www.littlebirdelectronics.com










    

Misc Mods

posted Jan 21, 2011 3:28 AM by robert sturzbecher

Server status LCD
Added a serial LCD to one of my servers. I coded the software in VB6. Nothing that exciting.
The display is from a serial POS pole display and accepts ASCII (VT100) data the same as a text only printer. 
The hardest part is gathering the data to display. I may post the code if anyone wants it. 




Router heatsink and fan.
Some cheap wireless routers don't handle WPA too well. This one would freeze under load so to fix it a added a heatsink inside to the main processor and a small 5volt fan from an old laptop. Now it works even better and rock solid.


More USB ports
Ever run out of USB ports on your laptop and needed more? I did so I added more, I rewired one of the USB ports if to a small 4 port USB hub then back to the port. This allowed me to add 3 more USB devices internally to my old laptop without loosing an external port. So I was able to add 802.11, Bluetooth and a flash drive inside the laptop.


External Antennas

posted Jan 21, 2011 3:10 AM by robert sturzbecher

These are some more of my older hacks/mods. Sometimes radio equipment works better when you add a bigger antenna ;) not that the FCC would approve.



This is a $9 802.11BGN adaptor I picked up from Ebay. In its factory form the performance was crap.
802.11n RT2870 adapter mod. Now has a pigtail with RP-SMA connector.



This shows that a better driver and a few tweaks can boost your performance.







Yet another PCMCIA card with a RP-SMA connector and a 9dBi antenna I added.






Replaced the internal antenna in my JasJar. This was only a temp mod as decided it was not that practical, But the performance was great.
The pigtails performs better then the default internal ant. The RSSI of of my local AP was -50 with internal ant. -70 with internal ant removed. -50 with just the pigtail and -29 with a 9dbi omni attached.




This was one of my first PDA wireless mods, The performance gain was so great it is what started this whole thing. The SanDisk wireless card went from having a range of 15m to a range of over 500meters. And if used my 1watt amp I would detect so many networks the software would crash. It would also make my brain tingle and the taps arc (not to mention the FCC get very unhappy with me).  



Not even Bluetooth is safe. This one was good you use in combination with my Bluetooth headphones. 

1-10 of 11