Make your own Mindstorm sensors

[Stewart Allen] acquired a Mindstorm kit about a month ago and he’s already building his own sensors for it. He wanted a more accurate range finder with a narrower measurement field than the stock sensor. Mindstorm has the option to communicate with sensors via an I2C bus. [Stewart] set up an ATtiny45 to act as a the slave on the bus, facilitating the analog measurement of the distance voltage¬†by using and lookup table, and handling the data transfer with the NXT brick. His testing setup is pictured above, with an AVR Dragon for programming the tiny45 and a Bus Pirate for sniffing the I2C data during the development process. The sensor, looking great on a professionally made PCB he ordered, requires a simple driver that [Stewart] hammered out for use with leJOS, the alternative Mindstorm firmware we’ve seen before.