git is a really interesting way to do source control and github.com provides a free git server.
I've moved my AVR code to github to make it more accessable. Find it here.
Thursday, April 30, 2009
Sunday, April 26, 2009
Phototransistor speed
I tried a phototransistor instead of an LDR. Look at the speed difference! The scale here is different (far faster sampling) which means that the phototransistor is at least 50x the speed of the LDR.
I'm designing a multi-channel colour sensor which will have 4 colour sensors controlled by a single AVR ATMEGA48.
* Each sensor has 3 LEDs red, green, blue.
* Each of these LEDs is turned on in turn, the ADC is then sampled approx 4 times and some filtering is done on the returned signal. The signal is then corrected for differences in phototransistor sensitivity etc by applying a simple gamma correction to give reasonably matched RGB values.
Using phototransistors should make this all fast enough to operate 4 channels at 100Hz or so.
100Hz sampling should be fast enough for an NXT robot.
Wednesday, April 22, 2009
LDR Speed
Light dependent resistors are cheap and relatively wide-band light sensors, but they are a bit slow relative to photodiodes and phototransistors.
I used an AVR-based board to measure this, as follows:
* Put an LDR and 6.8k resistor in series between 5V and ground as a voltage divider.
* Attach the AVR's ADC pin to the connection between the resistor and LDR.
* Set another pin up to toggle an LED every 50msec.
* AVR samples ADConce each millisecond and spits out the value as a string on the RS232 port.
* PC logs serial port into file
*Use gnuplot to plot results.
As you can see, after approx 15msec the ADC value has settled quite well.
I don't quite know why the formatting got hosed.... but so be it.
Monday, April 13, 2009
Make your own Lego NXT sensors
Just finished putting together a presentation for the Christchurch Robotics Group on making custom sensors for the Lego NXT.
Making resistive/switch sensors is very simple, but one of the sensors is an AVR-based I2C sensor which puts all the flexibility of a microcontroller in the sensor. More info on that to be posted later.
Presentation pdf and code for the micro here.
Update: Code is now on github.
Making resistive/switch sensors is very simple, but one of the sensors is an AVR-based I2C sensor which puts all the flexibility of a microcontroller in the sensor. More info on that to be posted later.
Presentation pdf and code for the micro here.
Update: Code is now on github.
Subscribe to:
Posts (Atom)