3D room mapping with sonar

My final project for the Arduno microcontroller class is this 3D room mapping thing. It still needs some work but here’s basically what it looks like. An ultrasonic distance sensor is mounted on a servo (which is mounted on another servo), and records the distance of objects located at various angles. Two angles and a distance from the center make up a spherical coordinate system, and those coordinates can be plotted.

Continue reading “3D room mapping with sonar”

Tri-color LED

Bought one of these RGB LEDs from Adafruit; here’s a video of it in action. I didn’t save the Arduino sketch, but I simply declared the PWM out value for each pin as a random byte between 0 and 255 in the setup() function and just added 1 to each value every iteration of the loop() function (since they were declared as bytes, it wraps around after exceeding a value of 255).

Audio playback assignment

One of our microcontrollers assignments was to use a digital potentiometer as a digital to analog converter. We were given a file with thousands of numerical values, and had to use a digital potentiometer to convert the values to an analog voltage, and using an audio connector and headphones/speakers, had to identify the song. In addition, a potentiometer is used to change the playback speed.

Sorry about the fact that the audio is kinda low.

Arduino softpot potentiometer game


Made a cave-navigation game using a Spectra Symbol softpot. The resistance of the softpot changes depending on where you press it, so you can do an Arduino analogRead() on the voltage output to determine where the circle goes on the screen. You have to make sure to add a resistor (I think I used a 100k resistor) going from the middle pin to ground (or power), or else the output floats.

Code available in the full post.

Continue reading “Arduino softpot potentiometer game”

Messing around with servos

This semester I’m taking a course about Arduino microcontrollers. One of the things included in the materials we got was a servo, and the first thing I did on the first day was looking up how servos worked. I didn’t know there was a servo library for the Arduino, so I ended up writing my own program to change the duration of the pulse sent to the servo based on some serial input (which I also had to look up, since we hadn’t learned it yet). I thought it was really neat and I ended up just playing around with it a lot.

Continue reading “Messing around with servos”