"--because the magic didn't happen."
Although our robot was stumped by the first room, our attempt was not a total loss. Through this course we learned:
- How to interface non-proprietary devices to a highly proprietary platform
- How to construct and program a robot to navigate a maze autonomously
- How to construct and program a robot capable of finding and extinguishing a flame
- How to build an array in RobotC
- Various methods for error-checking and heuristic analysis of environmental variables
(light intensity for finding a flame, available power, navigation)
In addition, the exercise proved great practice for my fabrication and construction skills.
For the final competition I hard-coded values for the shaft encoders, retrieved by manually pushing the robot through the maze and extracting the values from debugger. However, do to irregularities on the surface of tiles and floating values from the left encoder, the robot was unable to navigate the maze with any large amount of success. The robot did reach the first room on its second attempt and promptly froze--it was later discovered that gremlins in the machine had misplaced a segment of abandoned code in the middle of the "inRoom" function (which detailed the actions of the robot for pinpointing the flame inside a room of the maze once IR Sensor thresholds were met). As a result, the robot found the flame in the room and became stuck in a "while" loop.
In the future, an effort will be made to identify any limiting factors early on, as we assumed that the PIC microcontroller in the VEX brain had sufficient memory for acquiring the strategy we were counting on for victory.
Friday, February 17, 2012
Wednesday, February 8, 2012
Testing
...is what we should be doing...
In order to work around the memory limitations of the VEX brain and fully utilize a grid array navigation system, we devised a method of interfacing a Bluetooth receiver to the robot so that it can download instructions via wireless communication with a laptop.
Success was in the form of a VEX bot directly controlled over Bluetooth, but it remains to be seen whether we can pull off the autonomous portion in time for competition.
In order to work around the memory limitations of the VEX brain and fully utilize a grid array navigation system, we devised a method of interfacing a Bluetooth receiver to the robot so that it can download instructions via wireless communication with a laptop.
Success was in the form of a VEX bot directly controlled over Bluetooth, but it remains to be seen whether we can pull off the autonomous portion in time for competition.
Monday, February 6, 2012
Engineering an Extinguisher
Now...THIS...has probably been my favorite part of the project, tied only with Rick Rolling the class earlier in the course with my Annoy-a-tron Toy.
Sometimes, my best ideas owe their inspiration to a dream. Such was the case this time.
In order to achieve the maximum time bonus (based on flame extinguishing methods) in the firefighting robot competition, the rules state that a robot must use a non-contact, non-wind method to put out the candle flame.
Ideas were thrown around, many of which involved a high-pressure canister, water deflection, a water squirt gun...but none of these were sufficient, and a few of them exceeded our budget restriction of $20 (retail).
--A high-pressure canister (CO2 cartridge) would require a robust control valve, which was expensive and too complex to interface to the VEX brain reliably.
--A cheap plastic squirt gun creates a narrow stream of water, which translates to a very small margin of error in a platform and environment with a high level of unpredictability, and it was also difficult to construct a mechanical method of triggering the squirt gun quickly so that it built up enough pressure to project water at the flame.
Thus, it begins...
My search criteria was simple: a small container, capable of withstanding relatively high internal pressures while being easily triggered (mechanically). I began cleaning out my closet the weekend before when I noticed I had a can of silly string from about 5 or 6 years ago.
I punctured the sidewall of the can, purged its contents, cut it in two with the assistance of an air-powered circular die grinder and inspected its operational equipment. Inside was a straw leading up to a high-pressure valve, easily operated by exerting a finger's effort of pressure on the spray nozzle at the top exterior of the device. It was just what I had been looking for; it even had the Dollar Tree price tag still adhered to the plastic cap.
I requisitioned a Schrader valve from a discarded bicycle tire, set it into the sidewall of the can through a small circular hole from the die grinder and sealed the whole construction with JB Weld.
The result was a small device, capable of withstanding relatively high pressures while being easily triggered by pressing on the spray nozzle. Critical to its continued success is that it is also reusable: by removing the pintle assembly inside the Schrader valve, the can is capable of being preloaded with plain water before the valve is replaced and the canister is pressurized with air compressed by a bicycle tire pump (through the same valve!).
The device worked exactly as designed, but a greater cross-section was needed to remove the off-chance that the robot did not properly align itself with the flame. The original nozzle was a non-atomized design to spray silly string, and so the opening was relatively large to accommodate the flow of the suspension. By searching through the cleaning products and other aerosol devices around my house, I was able to locate a nozzle which 1) created the desired wide cross-section and atomization of the contents and 2) fit over the neck of the can's control valve--a suitable nozzle was lifted from a can of stainless steel cleaner.
I have since stress-tested the modified device and found that it is capable of pressures in excess of 70psi, which is far more than is needed for the desired operation. I almost lost my sight and hearing in the process when the can had a catastrophic failure and exploded at the seam of the Schrader valve and the JB Weld--Super Glue is suspected to have weakened the area from the runoff of a previously attempted repair.
I have also since purchased two more cans of silly string and an air horn (for its nozzle) from Dollar Tree, and these have undergone the same treatment as the first, providing me with a total of three working extinguishers of different sizes and capacities (the original can had a piece of dried silly string lodged in its valve and could not be repaired).
Sometimes, my best ideas owe their inspiration to a dream. Such was the case this time.
In order to achieve the maximum time bonus (based on flame extinguishing methods) in the firefighting robot competition, the rules state that a robot must use a non-contact, non-wind method to put out the candle flame.
Ideas were thrown around, many of which involved a high-pressure canister, water deflection, a water squirt gun...but none of these were sufficient, and a few of them exceeded our budget restriction of $20 (retail).
--A high-pressure canister (CO2 cartridge) would require a robust control valve, which was expensive and too complex to interface to the VEX brain reliably.
--A cheap plastic squirt gun creates a narrow stream of water, which translates to a very small margin of error in a platform and environment with a high level of unpredictability, and it was also difficult to construct a mechanical method of triggering the squirt gun quickly so that it built up enough pressure to project water at the flame.
Thus, it begins...
My search criteria was simple: a small container, capable of withstanding relatively high internal pressures while being easily triggered (mechanically). I began cleaning out my closet the weekend before when I noticed I had a can of silly string from about 5 or 6 years ago.
I punctured the sidewall of the can, purged its contents, cut it in two with the assistance of an air-powered circular die grinder and inspected its operational equipment. Inside was a straw leading up to a high-pressure valve, easily operated by exerting a finger's effort of pressure on the spray nozzle at the top exterior of the device. It was just what I had been looking for; it even had the Dollar Tree price tag still adhered to the plastic cap.
I requisitioned a Schrader valve from a discarded bicycle tire, set it into the sidewall of the can through a small circular hole from the die grinder and sealed the whole construction with JB Weld.
The result was a small device, capable of withstanding relatively high pressures while being easily triggered by pressing on the spray nozzle. Critical to its continued success is that it is also reusable: by removing the pintle assembly inside the Schrader valve, the can is capable of being preloaded with plain water before the valve is replaced and the canister is pressurized with air compressed by a bicycle tire pump (through the same valve!).
The device worked exactly as designed, but a greater cross-section was needed to remove the off-chance that the robot did not properly align itself with the flame. The original nozzle was a non-atomized design to spray silly string, and so the opening was relatively large to accommodate the flow of the suspension. By searching through the cleaning products and other aerosol devices around my house, I was able to locate a nozzle which 1) created the desired wide cross-section and atomization of the contents and 2) fit over the neck of the can's control valve--a suitable nozzle was lifted from a can of stainless steel cleaner.
I have since stress-tested the modified device and found that it is capable of pressures in excess of 70psi, which is far more than is needed for the desired operation. I almost lost my sight and hearing in the process when the can had a catastrophic failure and exploded at the seam of the Schrader valve and the JB Weld--Super Glue is suspected to have weakened the area from the runoff of a previously attempted repair.
I have also since purchased two more cans of silly string and an air horn (for its nozzle) from Dollar Tree, and these have undergone the same treatment as the first, providing me with a total of three working extinguishers of different sizes and capacities (the original can had a piece of dried silly string lodged in its valve and could not be repaired).
The second can, after failure
Note the cracking near the base of the Schrader valve
Second can, repaired and JB Weld cured by a heat lamp
All three cans, sitting on my desk at home
*The air horn nozzle in red
**The smallest can has the ideal nozzle
Friday, February 3, 2012
Sensing Location with a "Pinger"/SONAR Sensor
....we were doing fine at getting readings from the VEX SONAR sensor until the robot brain crashed and the robot crashed into a wall--we had aluminum extensions fixed to the front of the robot as bumper protection, but as the result of a freak accident they managed to slide between the partitions of the wall and failed to work. After spending about 15 minutes or so troubleshooting our software and hardware for faults, we determined that the VEX CPU had simply crashed for unexplainable reasons, as it wasn't responding to any changes in the software and RobotC debugger began posting static values for all pids.
When the brain was finally rebooted, the SONAR sensor appeared to have suffered a critical failure, thought possibly due to physical damage as a result of the robot running into the wall at full speed. However, we soon realized that the CPU was posting a static value of "16" (inches interpreted) even without the SONAR sensor plugged in.
So...it remains to be determined exactly what has happened and whether the situation is permanent or can be rectified.
When the brain was finally rebooted, the SONAR sensor appeared to have suffered a critical failure, thought possibly due to physical damage as a result of the robot running into the wall at full speed. However, we soon realized that the CPU was posting a static value of "16" (inches interpreted) even without the SONAR sensor plugged in.
So...it remains to be determined exactly what has happened and whether the situation is permanent or can be rectified.
Thursday, February 2, 2012
Infrared Photo Transistors and Locating a Flame
We interfaced IR phototransistors with the VEX brain and experimented with different resistor values in a positive-coefficient type voltage control circuit.
The rest of the night was spent adjusting the software and physical positioning of the sensors to optimize the ability of the robot to hone in on the location of a candle flame.
Wednesday, February 1, 2012
VEX Bot Maze Running and Using Wheel Encoders
A picture of our square-bot that would attempt to navigate its way through the tile maze
**Note the wheel encoders
A video of another group's run (immediately after ours).
I'll post a video of our run later, because my phone decided not to save the video I took.
RobotC Maze Code
#pragma config(Sensor, in2, rightEncoder, sensorRotation)
#pragma config(Sensor, in3, leftEncoder, sensorRotation)
#pragma config(Motor, port2, LEFT, tmotorNormal, openLoop)
#pragma config(Motor, port3, RIGHT, tmotorNormal, openLoop, reversed)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#define square 124
#define fleft 65
#define fright 63
#define rleft -63
#define rright -61
void turnLeft( int turnTicks ){
SensorValue[rightEncoder] = 0;
SensorValue[leftEncoder] = 0;
motor[LEFT] = rleft; //left
motor[RIGHT] = fright;
while (SensorValue[rightEncoder] < turnTicks);
motor[LEFT] = 0;
motor[RIGHT] = 0;
int RightTurns = SensorValue[rightEncoder];
int LeftTurns = SensorValue[leftEncoder];
}
void turnRight( int turnTicks ){
SensorValue[rightEncoder] = 0;
SensorValue[leftEncoder] = 0;
motor[LEFT] = fleft; //right
motor[RIGHT] = rright;
while (SensorValue[rightEncoder] < turnTicks);
motor[LEFT] = 0;
motor[RIGHT] = 0;
int RightTurns = SensorValue[rightEncoder];
int LeftTurns = SensorValue[leftEncoder];
}
void goForward( int goticks ){
SensorValue[rightEncoder] = 0;
SensorValue[leftEncoder] = 0;
motor[LEFT] = fleft; //foward
motor[RIGHT] = fright;
while (SensorValue[rightEncoder] < goticks);
motor[LEFT] = 0;
motor[RIGHT] = 0;
int RightTurns = SensorValue[rightEncoder];
int LeftTurns = SensorValue[leftEncoder];
}
task main( )
{
goForward( square*4.5 );
wait1Msec(200);
turnLeft( 99 );
wait10Msec(20);
goForward(square*2);
wait10Msec(20);
turnLeft(99);
wait10Msec(20);
goForward(square*4);
wait10Msec(20);
turnRight(99);
wait10Msec(20);
goForward(square*2);
wait10Msec(20);
turnRight(99);
wait10Msec(20);
goForward(square*6);
wait10Msec(20);
turnRight(99);
goForward(square*4);
turnRight(99);
turnLeft(45);
turnRight(140);
turnLeft(500);
}
Thursday, January 26, 2012
Hacking a Toy - COMPLETE
Well...I may have just outdone myself as far as my custom-made annoy-a-trons go.
By interfacing an electronic toy with a Picaxe 14M2 micro-controller, I have successfully bypassed all of the original electronic logic, creating my own unique program for the toy's operation.
Then I decided to get creative.
Unfortunately, I did not have sufficient parts to do EVERYTHING that I had hoped to accomplish (locking individual wheels to make the car turn while moving forward or backward) and some features were not even possible before I modified the toy, such as the press-switch activation which was supposed to occur when the toy was placed on a surface but was manufactured to a tolerance that allows the switch to get jammed in the open position every time the vehicle is standing on its own weight.
I have, however, come up with a brand new kind of annoying.
Using the LED masking function, I manipulated the electronic logic through physical and scripted methods to achieve alternating headlamps (fashioning miniature blue LEDs in place of what was once headlights which were painted on over opaque plastic) in sync with the toy's new musical output.
I'll upload the entire Picaxe BASIC script in a separate post.
By interfacing an electronic toy with a Picaxe 14M2 micro-controller, I have successfully bypassed all of the original electronic logic, creating my own unique program for the toy's operation.
Then I decided to get creative.
Unfortunately, I did not have sufficient parts to do EVERYTHING that I had hoped to accomplish (locking individual wheels to make the car turn while moving forward or backward) and some features were not even possible before I modified the toy, such as the press-switch activation which was supposed to occur when the toy was placed on a surface but was manufactured to a tolerance that allows the switch to get jammed in the open position every time the vehicle is standing on its own weight.
I have, however, come up with a brand new kind of annoying.
Using the LED masking function, I manipulated the electronic logic through physical and scripted methods to achieve alternating headlamps (fashioning miniature blue LEDs in place of what was once headlights which were painted on over opaque plastic) in sync with the toy's new musical output.
I'll upload the entire Picaxe BASIC script in a separate post.
**Beefy Desktop PC not included with toy
Custom LED headlights
(JDM or EuroSpec? Who knows...)
Toy's Original Logic Board
My custom logic board
**WARNING**
Bear in mind that this toy was created with the intention of being annoying.
Bear in mind that this toy was created with the intention of being annoying.
If the song(s) get stuck in your head or you're sensitive to loud lights and bright noises, please reconsider watching the video demonstration.
Picaxe BASIC Logic Script
Ready to be copied and pasted directly into Picaxe Programmer or AxePAD for simulation
main:
wait 1
sound B.1, (108,50)
wait 2
for b0 = 0 to 1
high 2
sound B.1, (84,3)
sound B.1, (40,4)
low 1
low 2
pause 165
high 2
sound B.1, (84,3)
sound B.1, (40,3)
low 1
low 2
pause 165
high 2
sound B.1, (84,3)
sound B.1, (40,3)
low 1
low 2
pause 220
high 2
sound B.1, (84,3)
sound B.1, (40,3)
low 1
low 2
pause 420
high 2
sound B.1, (84,3)
sound B.1, (40,5)
low 1
low 2
pause 115
high 2
sound B.1, (74,3)
sound B.1, (28,3)
low 1
low 2
pause 165
high 2
sound B.1, (74,3)
sound B.1, (28,3)
low 1
low 2
pause 165
high 2
sound B.1, (62,3)
sound B.1, (16,3)
low 1
low 2
pause 220
high 2
sound B.1, (62,3)
sound B.1, (16,3)
low 1
low 2
pause 900
next b0
'Party Rock Anthem 1
tune B.1, 3, 001100,($10,$10,$03,$03,$03,$03,$D3,$13,$51,$53,$D1,$8C,$08,$0A,$10,$08,$03,$0C,$03,$03,$CA,$C8,$8C,$0C,$10,$03,$03,$03,$03,$93,$D1,$8C,$08,$0A,$10,$0A,$08,$0A,$8C,$CC)
sound B.1, (124,2)
sound B.1, (84,2)
sound B.1, (40,2)
low 1
pause 135
sound B.1, (124,2)
sound B.1, (84,2)
sound B.1, (40,2)
low 1
pause 135
wait 2
sound B.1, (127,50)
sound B.1, (16,30)
sound B.1, (127,3000)
'Fail!
tune B.1, 1, 001000,($DB,$60,$62,$66,$63,$98,$60)
low 2
pause 17
high 2
pause 1333
low 2
pause 9
high 2
pause 20
low 2
pause 20
high 2
wait 2
low 2
wait 6
goto rickroll
rickroll:
high 5
pause 5
low 5
'Rollin 1
tune B.1, 3, 001100,($C5,$05,$C7,$07,$C0)
high 5
pause 5
low 5
tune B.1, 3, 001100,($C7,$07,$C9,$09,$50)
high 5
pause 5
low 5
tune B.1, 3, 001100,($4A,$09,$C5,$05,$C7)
high 5
pause 5
low 5
tune B.1, 3, 001100,($07,$C0,$04,$05,$C5)
high 5
pause 5
low 5
tune B.1, 3, 001100,($CC,$45,$05,$45,$CC)
high 5
pause 5
low 5
tune B.1, 3, 001100,($22,$24,$25,$25,$27)
high 5
pause 5
low 5
tune B.1, 3, 001100,($24,$64,$62,$20,$A0)
high 5
pause 5
low 5
tune B.1, 3, 001100,($EC,$2C,$22,$22,$24)
high 5
pause 5
low 5
tune B.1, 3, 001100,($25,$E2,$20,$00,$2C)
high 5
pause 5
low 5
tune B.1, 3, 001100,($00,$27,$A7,$2C,$22)
high 5
pause 5
low 5
tune B.1, 3, 001100,($22,$24,$25,$22,$25)
high 5
pause 5
low 5
tune B.1, 3, 001100,($27,$2C,$24,$22,$20)
high 5
pause 5
low 5
tune B.1, 3, 001100,($E0,$EC,$2C,$22,$22)
high 5
pause 5
low 5
tune B.1, 3, 001100,($24,$25,$22,$E0,$27,$27,$27)
high 5
pause 5
low 5
tune B.1, 3, 001100,($29,$E7,$EC,$A5,$25,$27,$29)
high 5
pause 5
low 5
tune B.1, 3, 001100,($25,$27,$27,$27,$29,$E7,$E0)
high 5
pause 5
low 5
tune B.1, 3, 001100,($AC,$22,$24,$25,$22,$2C,$27,$29,$27,$E7)
high 5
pause 5
low 5
'Strollin1
tune B.1, 3, 001100,($40,$42,$45,$42,$09,$49,$09)
high 5
pause 5
low 5
tune B.1, 3, 001100,($07,$C7,$40,$42,$45,$42,$07)
high 5
pause 5
low 5
tune B.1, 3, 001100,($47,$47,$07,$05,$45,$44,$02)
high 5
pause 5
low 5
tune B.1, 3, 001100,($40,$42,$45,$42,$C5,$07,$04)
high 5
pause 5
low 5
tune B.1, 3, 001100,($44,$42,$C0,$00,$C7,$85,$40,$42,$45,$42)
high 5
pause 5
low 5
tune B.1, 3, 001100,($09,$49,$49,$09,$07,$C7,$40,$42,$45,$42)
high 5
pause 5
low 5
tune B.1, 3, 001100,($D0,$04,$05,$45,$44,$02,$40,$42,$45,$42)
high 5
pause 5
low 5
tune B.1, 3, 001100,($C2,$07,$04,$44,$42,$C0,$40,$07,$0C,$C5,$CC)
'Strollin1b
tune B.1, 3, 001100,($60,$62,$65)
high 5
pause 5
low 5
tune B.1, 3, 001100,($62,$29,$69,$29)
high 5
pause 5
low 5
tune B.1, 3, 001100,($27,$E7,$60)
high 5
pause 5
low 5
tune B.1, 3, 001100,($62,$65,$62,$27)
high 5
pause 5
low 5
tune B.1, 3, 001100,($67,$67,$27)
high 5
pause 5
low 5
tune B.1, 3, 001100,($25,$65,$64,$22)
high 5
pause 5
low 5
tune B.1, 3, 001100,($60,$62,$65)
high 5
pause 5
low 5
tune B.1, 3, 001100,($62,$E5,$27,$24)
high 5
pause 5
low 5
tune B.1, 3, 001100,($64,$62,$E0)
high 5
pause 5
low 5
tune B.1, 3, 001100,($20,$E7,$A5,$60)
high 5
pause 5
low 5
tune B.1, 3, 001100,($62,$65,$62)
high 5
pause 5
low 5
tune B.1, 3, 001100,($29,$69,$69,$29)
high 5
pause 5
low 5
tune B.1, 3, 001100,($27,$E7,$60)
high 5
pause 5
low 5
tune B.1, 3, 001100,($62,$65,$62,$C0)
high 5
pause 5
low 5
tune B.1, 3, 001100,($24,$25,$65)
high 5
pause 5
low 5
tune B.1, 3, 001100,($64,$22,$60,$62)
high 5
pause 5
low 5
tune B.1, 3, 001100,($65,$62,$E2)
high 5
pause 5
low 5
tune B.1, 3, 001100,($27,$24,$64,$62)
high 5
pause 5
low 5
tune B.1, 3, 001100,($E0,$60,$27,$2C,$E5,$EC)
'Strollin1
tune B.1, 2, 001100,($40,$42,$45,$42,$09,$49,$09,$07,$C7,$40,$42,$45,$42,$07,$47,$47,$07,$05,$45,$44,$02,$40,$42,$45,$42,$C5,$07,$04,$44,$42,$C0,$00,$C7,$85,$40,$42,$45,$42,$09,$49,$49,$09,$07,$C7,$40,$42,$45,$42,$D0,$04,$05,$45,$44,$02,$40,$42,$45,$42,$C2,$07,$04,$44,$42,$C0,$40,$07,$0C,$C5,$CC)
'Strollin1b
tune B.1, 2, 001100,($60,$62,$65,$62,$29,$69,$29,$27,$E7,$60,$62,$65,$62,$27,$67,$67,$27,$25,$65,$64,$22,$60,$62,$65,$62,$E5,$27,$24,$64,$62,$E0,$20,$E7,$A5,$60,$62,$65,$62,$29,$69,$69,$29,$27,$E7,$60,$62,$65,$62,$C0,$24,$25,$65,$64,$22,$60,$62,$65,$62,$E2,$27,$24,$64,$62,$E0,$60,$27,$2C,$E5,$EC)
goto strollin
strollin:
'Strollin1
tune B.1, 1, 001100,($40,$42,$45,$42,$09,$49,$09,$07,$C7,$40,$42,$45,$42,$07,$47,$47,$07,$05,$45,$44,$02,$40,$42,$45,$42,$C5,$07,$04,$44,$42,$C0,$00,$C7,$85,$40,$42,$45,$42,$09,$49,$49,$09,$07,$C7,$40,$42,$45,$42,$D0,$04,$05,$45,$44,$02,$40,$42,$45,$42,$C2,$07,$04,$44,$42,$C0,$40,$07,$0C,$C5,$CC)
'Strollin1b
tune B.1, 1, 001100,($60,$62,$65,$62,$29,$69,$29,$27,$E7,$60,$62,$65,$62,$27,$67,$67,$27,$25,$65,$64,$22,$60,$62,$65,$62,$E5,$27,$24,$64,$62,$E0,$20,$E7,$A5,$60,$62,$65,$62,$29,$69,$69,$29,$27,$E7,$60,$62,$65,$62,$C0,$24,$25,$65,$64,$22,$60,$62,$65,$62,$E2,$27,$24,$64,$62,$E0,$60,$27,$2C,$E5,$EC)
goto strollin
Hacking a Toy pt. 3
Tonight, we continued programming and circuit-bending with our hacked toys.
I was able to find many shortcuts hidden in the Picaxe manual, namely related to functions for sound generation. This eliminates all need for guesswork in creating specific musical tones, and should cut my programming time considerably in addition to providing more musical options for the hacked toy's final software.
I was able to find many shortcuts hidden in the Picaxe manual, namely related to functions for sound generation. This eliminates all need for guesswork in creating specific musical tones, and should cut my programming time considerably in addition to providing more musical options for the hacked toy's final software.
Wednesday, January 25, 2012
Picaxe Sound Function
Through experimentation and a trained ear, I found that the Picaxe Basic function "sound" provides audible notes in a range of chords starting at a frequency of 40 and increasing by one full step in increments of 6, plus or minus a value of 2--one full octave higher than tone 40 is at 84.
Equipped with this knowledge, I can begin programming basic sheet music into the picaxe's memory.
**UPDATE** 3:56pm
Using a digital tuner I was able to confirm that tone 40 and tone 84 are in fact the musical note "A"
Equipped with this knowledge, I can begin programming basic sheet music into the picaxe's memory.
**UPDATE** 3:56pm
Using a digital tuner I was able to confirm that tone 40 and tone 84 are in fact the musical note "A"
Hacking a Toy pt. 2 -- Interfacing a Toy to User Command
A continuation of exploring possibilities for bending the original logic of an electronic-based toy.
*Original logic-board removed
A shot of the extension wires I soldered into place to take control of the sensors and outputs of the toy, keeping original color and polarity.
Soldering extension wires to the speaker proved a greater task than the other four, simply because of the low quality of the wafer attached to the base of the speaker which would flake and adhere to the solder, providing for a challenging joint.
Heat shrink was used to group wires, making it easier to visually follow their paths of execution to product (color) without opening the toy, hopefully simplifying process and cutting down on time spent troubleshooting.
A demonstration of direct control over the motor function of the toy--pressing the switch on the breadboard would supply 5V and cause the wheels to spin on command.
In a separate demonstration, the existing program (compiled over the weekend) would provide a range of incremental sound frequencies when the microcontroller was interfaced with the speaker.
Friday, January 20, 2012
Circuit Bending and "Hacking a Toy"
Self-explanatory experiments in bypassing the original logic of an electronic-based toy to implement our own.
Original Toy
When the power supply circuit was closed, the toy could be activated by shaking it, due to a small ball switch (orange wires) energizing the logic board to the "awake" state. The toy would emit sound from a speaker (yellow wires) and drive the rear wheel axle motor (red wires). Also included were a pressure switch attached to the front axle (purple wires), indicating that the toy was placed on the ground, and a bar switch
(blue wires), which was included but did not appear to be attached to any mechanical interface--most likely, it was a leftover process from another feature that the manufacturer had intended.
Logic-board exposed.
Interestingly, the rear axle of the toy is not a single-shaft direct-drive gearset. It has an "open" differential, leading to greater possibilities for hacking by locking up one wheel to make the toy turn while the motor is being driven forward or backward.
Thursday, January 19, 2012
Logic Probe and Picaxe Interfacing/Programming
We finished soldering on our logic probes to be used for identifying circuit logic and stray voltages.
Once the probes were soldered, interconnected wells on the wafer had to be "cut" to match the desired paths for current.
The next stage of our projects would make heavy use of a standard serial COM port to interface our Picaxe microcontrollers with a desktop computer for programming, so one was fashioned.
A detour in exercising transistor control.
The wiring diagram for interfacing a Picaxe 08M2 with a desktop PC serial port for programming in
Picaxe Programmer.
A successfully executed "flasher" program written in basic and downloaded to the 08M2, pulsing a red LED.
Wednesday, January 18, 2012
VEX Bot and Logic Probe
Taking a break from previous activities, we built basic VEX "square bots" as a precursory toward concepts of mechanical structure, build technique and creativity.
When the robot was finished
(over the weekend, at home, as class-time is now desperately needed to catch up on other activities....
and it's robots....which is like, the ultimate hobby),
it was handed over to a team of programmers who, after some technical difficulties, installed matching firmware and a basic VEX robot drive program to allow manual operation of the robot via a wireless controller. Once the robot was successfully paired with the operator controller and demonstrated to be in proper working order, it was set aside and we began building our logic probes.
After demonstrating an understanding of basic transistor theory and uses in simple circuits, we set to the task of prototyping a simple Hi-Low voltage logic probe on breadboards before be signed off to finalize the design on a small circuitboard. Sans the PWR and GND cables, the above picture represents all the hardware necessary and soldered in place.
Tuesday, January 17, 2012
Switches and Relays: Part 1
Using the above Single-Pole Double-Throw switches (SPDT), we constructed a simple circuit of alternating switches, per the diagram below.
However, this seemingly simple circuit provided many headaches, and troubleshooting with a multimeter to verify available voltage and continuity of the hand-built circuit pointed to a break in continuity within the bread board itself.
As it turned out, this conclusion was correct--this specific breadboard model has separate circuits for the top and bottom half of the board, noted by a small "W" stamped on the white plastic, just to the right of the ground-side of the brown wire in the picture above.
The next circuit posed more challenges, but of a different nature. Constructing the circuit manually proved to be difficult due to the scale of the parts being manipulated and lack of finer, more precise tools. Furthermore, because the relay could not be set within the breadboard (while still achieving the desired circuit), an alternate method of attachment was devised by structuring the relay with two stiff, green, single-strand wires and its pins at a visible facing.
This structure may not have been ideal in the most ergonomic sense, but it provided a better method of troubleshooting shorts or opens in the circuit.
**This circuit and exercise is yet to be completed
Thursday, January 12, 2012
Constructing and Diagnosing Simple Electronic Circuits
Using the 5VDC power supplies/transformers that we constructed during the previous session, we powered various simple circuits to demonstrate and understand Ohm's Law and the practical uses of bread-boarding circuit diagrams before building on a macro scale.
Upon completion of building a simple circuit with an LED and a resistor, Prof. Mason would then create a break in the system and we were tasked with diagnosing and repairing the fault. The purpose was to demonstrate the bane of most electronic circuit failures - no continuity. We were then instructed in the methods and applications of multimeters to check circuits for continuity, resistance, voltage and amperage.
In observing the difference between regulated vs unregulated power supplies, we were assigned with devising a method of using a resistor to create a load on a live circuit and then determining if the total available voltage decreased. In the case of our switching 5VDC power supplies, it did not.
Much magic smoke was released into the atmosphere on this evening.
Finally, to understand variable resistors (potentiometer) and "forward voltage" in LED circuits
(which Prof. Mason was delighted to explain to me)
the simple circuit below was constructed with a linear potentiometer, a 100 Ohm resistor and a red LED. Consequently, this also demonstrated the logarithmic gain inherent of LEDs.
Wednesday, January 11, 2012
Soldering Technique and Building and Testing a 5V Power Supply
After first day orientation and a "brief" description of the course, we were shown to the electronics lab room and given soldering kits and assorted electronic parts to practice soldering joints to an electronic wafer.
Once the instructors were comfortable with our understanding of soldering technique (filling the pad, proper use of flux, orientation and mechanical soundness), we moved on to practice parallel butt-joint soldering.
We made a ring of four butt-joints which had to be strong enough that it could not be broken with a moderate amount of manual force. Once we were finished, heat-shrink tubing was used to protect the fresh joints from the elements.
Our final task of the night was to combine the knowledge and techniques gathered from the two previous exercises in order to craft a customized 5V power supply to be used for powering our bread board projects for the rest of our course. A 120VAC-to-5VDC power supply was provided to us and we were tasked with stripping the original proprietary device link and soldering two metal pins in its place (using the aforementioned butt joint soldering technique).
Subscribe to:
Posts (Atom)