I accidentalmy hand 2weeks ago when I left my solder iron on for a prolonged period and I grabbed the metal guard. It is really a painful mistake. Luckily, no 3rd degree burn of that sort.
So prevent this from happening again, I decided to make a colour changing bling that reacts to temperature. All I is just hook up the temperature sensor to the heat source, for this example, the metal guard. It can be also modified to be fitted into a tap to give visual warning on the temperature of the water.
I laid my paws on RGB LEDs from sim lim tower that cost $1 per piece. It is on the pricey side and i only bought 5 of them. Loaned 1 to nigel and saravanan each for their D&I. Mr.Chew told me last Wednesday he got some for 40cents each (at 100pc lar)!! I felt I was really ripped off....I also have a temperature sensor LM35z lying in some dark corner in my tool box..
To light up R,G and B individually, just connect it to a logic low. My RGB LED is the common anode type. In arduino, this can be achieve by using the digital write.
But, to achieve "blending" of another color, it is necessary to input different intensity of Red, Green and Blue for that "new" colour. Hence an analog write is used.
I have used a 0-255 value, it is the same as programming HTML colour blending.
connect as below
int redLED=11; //Pin11 = Red LED
int blueLED=10; //Pin10 = Blue LED
int greenLED=9; //Pin9 = Green LED
A0 connect to vout of LM35z.
Vout is scaled to 1024 steps for easy conversion.
the code below is for your reference. Uncomment the colour blending part to play with the RGB LED.
take a look at the video. My office is at 20degC -> BLUE, my laptop is emitting heat at 30degC +++ RED. Anything in between, green.
Saturday, May 15, 2010
Monday, May 3, 2010
annotating power point slides with laser graffiti
I came across the GRL (Graffiti Research Lab) website while researching for open platform and openCV to do tracking of an image blob.
I am totally amazed by the ability to draw with a laser, albeit not the emotion they are expressing with graffiti.
So I was thinking, can I used it to annotate my powerpoint slides while teaching?? + the wireless presenter I am issued with to scroll the slides back and forth. It is going to be damn cool lar! commercial product such as "afterglow" is going for usd$1950 per copy for the same feature i mentioned.
quickly, I downloaded the code (I love open source!!) and compile it. The webcam is the input device looking at the whole vision field and the code tracks the red dot (it is called a blob)
you will need
1x code
1x webcam (any model with driver)
1x <5w laser pointer 1x projector
check out the video.
sadly, when i run it with power point slides as the background, the slides doesn't show up as the background. More code tweaking ahead and more weekends are needed....
Akan Datang............................
I am totally amazed by the ability to draw with a laser, albeit not the emotion they are expressing with graffiti.
So I was thinking, can I used it to annotate my powerpoint slides while teaching?? + the wireless presenter I am issued with to scroll the slides back and forth. It is going to be damn cool lar! commercial product such as "afterglow" is going for usd$1950 per copy for the same feature i mentioned.
quickly, I downloaded the code (I love open source!!) and compile it. The webcam is the input device looking at the whole vision field and the code tracks the red dot (it is called a blob)
you will need
1x code
1x webcam (any model with driver)
1x <5w laser pointer 1x projector
check out the video.
sadly, when i run it with power point slides as the background, the slides doesn't show up as the background. More code tweaking ahead and more weekends are needed....
Akan Datang............................
Friday, April 30, 2010
Arduino with servo (360deg)
arduino with servo motor (360 deg)
There are some servo code that came with arduino.
File->examples->servo->sweep
The servo is from parallax. It is a continuous rotation type. Courtesy of Ah Yap, TSO of T822.
I don't have a servo controller handy.... http://www.crustcrawler.com/downloads/manuals/ServoController.pdf
So I would just make do with manually programming my arduino to control 2 servo at a later stage.
The the servo takes 6v and 12mA and we do not want to power it directly off the MCU. If the current load is too high,
the MCU might be fried. I really take good care of my arduino, so I will try 1x servo instead of 2x.
Just to illustrate the working of it.
Ignore the sonar in the above picture. It is for decoration purposes.
Hook up servo +6v and gnd to arduino 5v and gnd, data to pin D10.
you can try try the example code "SWEEP" that comes with it and for convenience sake, it is attached below.
Check out the servo in action...
Now the questions come begging, how can we drive 2 servo using arduino (note: data pin only) for a forward and backward movement.
Arduino interface with maxbotic maxsonarEz1
Arduino interface with maxbotic maxsonarEz1


The readings are plain crazy. 35x cm before I move my hand across the sensor. The analog pin is not accurate for short distance. But for longer distance where granularity in terms of 10s' of cm is still acceptable.

http://snipt.net/teos0009/arduino-maxsonar-pw-pin?key=327e03f8dfda55271e87ed42d99f16ac
Maxsonar comes with a couple of flavours to interface, namely the analog and the pulse width. Below are the experiments I have done with them.
Connect MaxSonar pin 5v and Gnd to Arduino's 5V and gnd respectively. I am using Analog pin on max sonar, hence I connect it to A0 on arduino.
The ruler here is to help me to identify whether my readings are as accurate as possible. As I would put my hand across the sonar sensor at 15cm point and hopefully the readings will be 15cm too.
There are some sample code for sonar in arduino itself. I am using this from allen bruce. But he interface it to PING sonar instead.
http://snipt.net/teos0009/arduino-maxsonar-analog-pin/?key=2f06d19e68c5145fe0bbe650d3624ff8
Next up, try with the PW pin. PW= pulse width. It is the Tc of the pulse generated by maxsonar that is measured. Wire to pin D8 instead of A0.
Same setup as previous. But the code have to change to reflect the method.
The data looks so much more interesting.......

Wednesday, April 28, 2010
Interfacing Arduino with wiimote (and later the nunchuck)
Interfacing Arduino with wiimote (and later the nunchuck)



I was toying with the idea of interfacing wiimote to my arduino as my replacement for accelerometer and gyroscope which comes in this package the
IMU Combo Board - 3 Degrees of Freedom - ADXL203/ADXRS614
http://www.sparkfun.com/commerce/product_info.php?products_id=9249which cost USD$124 which is equivalent to SGD$162.44.
FYI, my wiimote cost me sgd$69 (left over from last year FYP project) and nunchuck sgd$25 (which I got from the shop at clementi city vibe where my student yenyu working part time).
Shall not elaborate about the wiimote and nunchuck...There are plenty of resources in the Internet.
I found out that the pin outs for the wii expansion port (WEP) from the Internet, thanks to the people that are willing to share the data! The drawing are for interfacing the IEEE1394 to the WEP.
Connect pin1 of WEP to Aref on arduino
pin2 of WEP to A5
pin5 to A4
pin6 to ground
I also found out that, it is not necessary to buy a nunchuck, cut out the connector part and used it with the wiimote. That, will render the nunchuck useless (to the Wii ofcourse, later you guys will find out more about my experiment with wiimote and why I have to use the nunchuck instead...........)
The replacement is a IEEE1394 male to male cable for sgd$7 from simlim square.
The pin out on the IEEE1394 and the WEP are carefully map out....
This is how it is going to look like, when they are connected...
Below are the code for sending and receiving data between arduino and pc. Similar code can be found at wiimeadows too! thanks to them for discovering the pattern of data send and receive out of the wiimote.
below are the ASCII art for the data flow of the devices that are hooked up together.
arduino ---wired--->wiimote--bluetooth-->PC
arduino <---wired---wiimote<--bluetooth--PC
Some way, some how, when I open my hyperterminal to observe the data output, I only receive my debug message which is "serial init finished". This means my serial connection of 119200 is setup correctly, but no generated data is observed. No subsequent data is collected both from the arduino through the wiimote to the pc (need to use 3rd party wiimote driver, such as wiimote library on the windows OS), nor the pc through the wiimote to arduino (through hyper terminal).
Used my multimeter to check the VCC and the gnd pin of IEEE1394 pin out, all seems to be correct. Just that no data is observed from the transferring between the devices.
Rewire the IEEE1394 again, with more meticulous effort put in... the result is still the same............................................
Fustrated, because if I can't get the accelerometer readings from the wiimote to arduino, my hypotheses of using it as my sensor would be false!!!!!!
I was contemplating to cut my nunchuck to retrieve the WEP PROPRIETARY connector..........because, I could still use the nunchuck on the wii (As if I got one, hahahah). If In the end, I decided to mutilate the nunchuck. Plug in the connector to the wiimote and the exposed end to the arduino.... No eureka moment.......... the data output is the same as the IEEE1394 cable........Very fustrated................................because of my hypotheses would failed..........................
But, which part went wrong?????? I am still finding the cause of it..........There are success stories on the Internet that used the similar setup.......
Before the last straw to be thrown, I tried to hooked up the nunchuck to the arduino instead.
with the code attached below
Atlas.... some readings from the accelerometer on the hyperterminal...data from the nunchuck.......
Subscribe to:
Posts (Atom)