During winter break I spent some of my time making a snow fort. The snow pile seen below is hollowed out leaving an area inside large enough to stand up in. The snow removed from the inside was added back onto the pile to make it larger.
I’ve been using my disc golf target for about a week now and I’ve found the weaknesses of it. I’ve been working on some simple fixes to these problems.
|From Disc golf target|
The first thing I noticed was that a single ring of chain worked for most puts but a few that should have been caught got through. The simple fix to this was to add a second ring of chains. I added six more chains halfway between the center and the outer ring. Very few discs actually make it through the chains.
The second problem was that discs can roll on their side out of the basket. It didn’t seem like it should happen too often because the disc had to be on its side rolling at an angle. The solution to this would be to either add more dowels so the disc cant fit through or to add a second plywood ring onto the dowels. I found that after I added more chain the problem happened less often.
The third thing I noticed was a few of my dowels were not actually hardwood. They were some lighter weight wood that looked the same. When the disc hit these dowels they cracked where the screws went in. I added some glue and a few zip ties to strengthen them. The best solution would be to make sure all the dowels are some type of hardwood.
Lastly, the extra part of the u bolts that sticks up can really eat away at your discs. Cutting the excess bolt off and smoothing it with a file helped a lot.
My second project using a Pic microcontroller was controlling the brightness of a LED using an ultrasonic range sensor. when an object was close to the sensor the LED was dimly lit and as the object moved away the LED got brighter.
Link to code: Sensor
For this project I learned how pulse width modulation worked and how to operate the SRF05 ultrasonic range sensor. I decided that since the pic18F1220 had a built in PWM module, I would learn how to use that.
In order to generate a pulse width modulation the pic microcontroller uses a timer and compares the timer value to two other registers. One of the registers (PR2 in the 18F1220) is the value at which the timer resets. This value is related to the period of the pwm waveform. The other register (CCPR1L in the 18F1220) is the duty cycle. When the timer is less than this value, the waveform is high. Otherwise the waveform is low. When CCPR1L is equal to PR2 the duty cycle is 100%.
The SRF05 creates a pulse who’s length is proportional to the distance an object is from the sensor. In order to begin the distance measurement the SRF05 needs a 10us trigger pulse. The SRF05 then measures the distance and outputs a pulse that is between 100us and 25ms. Measuring the pulse can be done by waiting for the output line of the SRF05 to go high, then setting up a timer with an appropriate prescaler to run until the line goes low. Once the pulse is over the timer value is read and can be mathematically manipulated to get the distance. The SRF05 recommends waiting 50ms before getting another measurement so the previous ultrasonic pulse doesn’t interfere. Documentation on the SRF05 can be found here
For this project I used a simple loop where I got the distance from the SRF05 then moved the timer value into CCPR1L. I then waited for 50ms before getting the distance again. The led was hooked up to the output of the pwm wave. The pulse widht modulation controlled the brightness of the led.