tag:blogger.com,1999:blog-62654572024-03-28T08:03:30.673-04:00FET TricksA few notes about some of my projects and interests. Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.comBlogger28125tag:blogger.com,1999:blog-6265457.post-53890260115927406182021-05-21T13:41:00.010-04:002023-02-17T12:56:01.197-05:00LEGO EV3 Minimal Gyro Proportional Drive Straight for FLL Robots<b><span style="font-family: arial; font-size: medium;">How to Help Your Robot Drive Straight Using the Gyro Sensor</span></b><br />
<b><br /></b><b><div><div style="font-weight: 400;"><b>Wait, It Drifts Left AND Right? </b><br />During my second season coaching FLL, the team had a robot that would sometimes drift to the left, but other times drift to the right, sometimes during the same run! This drove them crazy most of the season. Worst of all, when they put a mat on a hard floor to simulate a perfectly flat board, the drifting all but disappeared! </div><div style="font-weight: 400;"><br /></div><div style="font-weight: 400;">We finally figured out that the northside of our regular practice board was slightly higher than the south side. The robot had much of its weight on the back which made the back of the robot want to slide downhill while the robot was driving. This made the robot tend to drive uphill! So driving west to east the robot would drift left, but driving east to west the robot would drift right (always uphill). </div></div><div style="font-weight: 400;"><br /></div><div><span style="font-weight: 400;">Driving straight can be one of the most challenging tasks for any robot, including those in <b><i>FIRST</i> LEGO</b> </span>League<span style="font-weight: 400;">. The issue is that robots do not naturally drive straight. Actually very few things naturally move in a straight line (even people, see <i>MythBusters Season 9 Episode 15: Walk a Straight Line</i>). The article below discusses some of the reasons driving straight is such a challenge for robots.</span></div></b><div><div><br /></div><div><a href="http://www.legoengineering.com/why-doesnt-my-robot-drive-straight/">http://www.legoengineering.com/why-doesnt-my-robot-drive-straight/</a><br /><div><br /></div><div>When properly applied, a Gyro Sensor can help your drive robot straight. I am going to walk you through the simplest way I know to use a Gyro sensor, on an EV3 in this example. We are going to start simple, and explain in more detail as we progress. </div><div><br /><a href="https://education.lego.com/en-us/products/lego-mindstorms-education-ev3-gyro-sensor-/45505">LEGO EV3 Gyro</a></div><div><br /></div><div>The program below uses the Gyro Sensor to help the robot driving straight. We want the robot to drive straight in the direction, or heading, of 0 degrees at 50 power for a total of 4 rotations. We use 0 degrees because that is the initial reading from the Gyro Sensor anytime you run a new program.<div><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq5B9kgX5yVQHcQECAQI0F7sj2R0WeHiQO2sz209ws7q2IPDhzush1jOq60dXcoRvNH0AUntNdP4tTtDf5KZrGY0qxxSvJMEjE0ajo2K0sSYT_de4chRjIcvuhnpTxqwJUAc6m/s1600/Min+Gyro+Straight.png" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="242" data-original-width="710" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgq5B9kgX5yVQHcQECAQI0F7sj2R0WeHiQO2sz209ws7q2IPDhzush1jOq60dXcoRvNH0AUntNdP4tTtDf5KZrGY0qxxSvJMEjE0ajo2K0sSYT_de4chRjIcvuhnpTxqwJUAc6m/s640/Min+Gyro+Straight.png" width="640" /></a><br />
<br />
<br />
<br />
<b><br /></b>
<b><br /></b>
<b><br /></b>
<b><br /></b><div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: "times new roman";">One of the first things to notice is that we are using the Gyro Sensor in Angle mode. When the program starts the Gyro Sensor resets to 0 so we are using 0 degree as our heading ("a" in the red Math Block).</span></div><div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: "times new roman";"><br /></span></div><div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="font-family: "times new roman";">If the robot drifts left, the Gyro Sensor will report how far the robot has turned left in negative degrees. For example, if the robot is pointing 5 degrees left of where it was pointing when the program started, the Gyro Sensor will read -5. And if the robot drifts to the right the Gyro Sensor will report how far it has turned to the right in positive degrees. So if the robot is pointing 10 degrees to the right of where it was pointing when the program started, the Gyro Sensor will read 10. </span><br />
<br />
The program works by using a LOOP to read Gyro Sensor on port 2, then calculate the heading error by subtracting the gyro reading from our desired heading, 0 degrees, and using the heading error as the Steering Angle for the Move Steering block (the Motor Power is fixed at 60). This happens as fast as the Loop can run (many times per second). This continues until Motor B rotations are greater than or equal to 4, or for four rotations.<br />
<br />
This is a Proportional Control or Proportional Feedback system. It is called this because you are changing the output, the Steering Angle, by an amount that is proportional to the error, or the difference between the desired heading (0 degrees) and the measured direction.</div><div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></div><div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">A control system work to keep the system error as close to zero a possible. In this case it just means that the EV3 blocks above will keep adjusting the move block's steering angle to keep the robot's gyro sensor, and the robot, pointing at a heading of zero degrees. </div><div style="-webkit-text-stroke-width: 0px; color: black; font-family: "Times New Roman"; font-size: medium; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><br /></div>
<h2 style="text-align: left;"><span style="font-family: arial; font-size: large;"><b>Understanding Proportional Feedback</b><b> to Help Your Robot Drive Straight</b></span></h2><b><div><b><br /></b></div>The Good Stuff - Proportional Feedback and Proportional Control</b><br />
We are going to walk through how to use the Gyro Sensor and Proportional Feedback to make your EV3 based LEGO robot drive straight. The robot will drive straight even if the wheels slip or if the wheels are even different sizes. I am still impressed every time I push the back of the robot to make it turn off course and it turns back to follow the desired heading.<br />
<br />
<b>Gyro Sensor</b><br />
We are going to assume that your robot's Gyro Sensor is mounted with the arrows facing up (ensuring that rotating the robot to the left will produce negative readings from the sensor) and somewhere near the centerline of the robot (ensuring that turns to the left and right each require similar adjustments to the robot's drive system.<br />
<br />
The Gyro Sensor does have a few unique traits. First, it calibrates while the EV3 brick is booting up. This means your robot needs to be very still while booting. I recommend putting the robot on a clean piece of paper on the floor for booting up.<br />
<br />
You can force the Gyro Sensor to recalibrate by plugging and unplugging the sensor's cable or using a specific combination of programming blocks. I will not cover software methods for resting the Gyro Sensor because it very often causes more problems than it solves.<br />
<br />
<b>Move Steering</b><br />
The Move Steering block makes our task simpler by allowing us to change the robot's direction by adjusting the Steering Angle input.<br />
<br />
Proportional Control simply means that you are making a change, this case steering angle, based on the size of the measured error. Here our error is the difference between the direction we want to drive and the angle the gyro says we are driving. output to a value that is proportional to the system error. In the case of the Gyro Sensor, any errors to the right, or clockwise, are read as positive angles and error to the left are negative angles. And we are going to use a Move Steering block and adjust the Steering Angle based on the Gyro Sensor reading to make the robot drive straight. So if the robot is going a little left of where we want, say -5 degrees, then we want to set the Steering Angle to steer to the right, perhaps 5 degrees.<br />
<br />
Below is a Minimal Gyro Drive Straight program. I think it is very cool that you can build it with only five blocks, including the Start block!<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<b>Going Straight</b><br />
Going in a straight line is not a natural thing for a robot, or for humans for that matter (see MythBusters episode 173: Walk a Straight Line). It turns out that humans and robots both need some kind of feedback to go in a straight line. For humans, the feedback is usually visual but you can also use a compass as a reference to keep you pointed in the same direction. Robots are similar in that you can use a Color Sensor to follow a line or use the Gyro Sensor to follow a heading.<br />
<br />
<b>Why Straight is Difficult for Robots</b><br />
Driving straight using only mechanical design is challenging. The robot needs to have wheels of the same diameter, precisely aligned to each other and in line with the robot chassis, the motors must rotate the wheels at the same speed (be synchronized), the weight distribution must be balanced between the wheel to ensure the robot has a center of gravity centered between the wheels and the wheels cannot slip. </div><div><br /></div><div>Rarely if ever are all of these conditions true, so most robots, even good designs, do not actually drive straight. For example, a ball bearing castor will often provide changing forces during a straight drive and cause small changes in direction. Some of the driving straight issues can be difficult to diagnose. This is one reason that robust FLL robot strategies always include aligning on mission models, or lines or walls at multiple points during a run. Alignments and referencing are a top of their own that I hope to touch on in the future,</div><div>
<h2 style="text-align: left;"><b><span style="font-family: arial; font-size: large;">Potential Gyro Pitfalls and How to Avoid Them</span></b></h2>Gyro sensors are very useful sensor but can be a little confusing, and has some pitfalls that have tripped up even advanced teams.<br /><br />
First, Gyro sensors usually calibrate automatically at power on, like when the EV3 boots up, which means any movement of the robot, or table, while the EV3 brick powers up can produce drifting in the gyro. I recommend setting the robot on the floor on a sheet of paper (to keep dirt off of the wheels) and let it boot up without being disturbed. </div><div><br /></div><div>Second, poor wire management can lead to connection glitches that cause the Gyro Sensor to restart and recalibrate. The robot may drive in sharp arcs or even spin in place follow a gyro reset due to a poor connection while the robot was being handled by the team. This can be a very tough problem to identify because the problem happens when the wires are bumped but the robot driving failure doesn't show up until you go to use the gyro later. So the robot can be great on a practice table but suffer a gyor reset while walking to the competition tables or even during a match.</div></div></div><div><br /></div><div>I recommend NOT using a program to force the gyro to recalibrate. I have worked with many teams how had a great plan for how and when they would calibrate the gyro, and most, if not all, eventually have the gyro fail them during a competition run. I do recommend that early in the season adding some programming that will alert you if the gyro reading is changing when the robot should not be moving. This will let you find out if and when your robot's gyro starts drifting. This can warn you when someone didn't follow the EV3 startup procedure or a cable issue caused a gyro reset. </div><div><br /></div><div>I hope this has been helpful and encourages you to look into trying out a gyro sensor on your robot! </div></div>Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-86281366897419838452019-07-05T13:22:00.033-04:002022-10-20T22:35:39.188-04:00The Wharf Rats and the Hail Mary Mods at the Houston 2019 FIRST LEGO League Wold Championship<div><div>The Wharf Rats qualified for the FIRST LEGO League World Championship in Houston when they received the Grand Champion award at the North Carolina's FLL State Championship - Track B for the FLL Into Orbit Season.</div><div><br /></div><div>I want to share a little of the real world engineering experience the team had in Houston. During practice rounds they saw new features (missions) break in new ways under new test conditions and had to respond to the new data. Fix a bug or delete the feature so you can ship the product? Their "ship date" was inflexible. So they learned that sometimes you have to delete features to move a project forward.</div><div><br /></div><div>Their robot had a rough day during Wednesday's Practice Rounds (scored runs that do not count toward competition scores). Some fixes appeared to work but then they saw new failure modes in missions later in the run. The more they tried to fix it, the worse it seemed to get. The robot was score was just over 100 where it scored 192 at the state championship, and closer to 300 in practice sessions prior to Worlds. They were discouraged and stopped working on the robot before the pits closed at 4:30 pm. Instead they went to the party in the park, listened to the music, played games, danced and just had a good time.</div><div><br /></div><div>When the party was winding down, I shared that it was a common programming practice to eliminated unstable features from a product to allow you to hit your ship date. So we talked about looking for a key failure point that might have the most impact on their total score. They picked Run 4's Strength Exercise mission whose failure impacted the most missions down the line. They agreed it would be better to eliminate that mission, and it's points, to improve the robot's reliability for missions that follow. But that would require modifying the robot, changing mission fixtures and updating the firmware (thing they worked on for months). Their robot and fixtures are locked up in the pit until 7 am the next morning and their first competition run is at 8:40 am. Time for a Hail Mary! No fear! </div><div><br /></div><div>This is engineering! A bug is found in late testing. Your project ships tomorrow at 8:40 am. You can start working on it at 7 am. Now fix it!</div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMOWA-SEfF5Qwjdejakhx1owvSkMPjO9HIanNnmTbQBpQ6huc0VKLWcK21UxwhWx9P2ipQmYqScpQYUMStcJkGLT18kWmM6ZHAgGLEFaCKHTqFwzj-Qs52DM-nr_2nTBrF-hXQ/s1024/Wharf+Rats+Making+Mods.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="621" data-original-width="1024" height="391" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMOWA-SEfF5Qwjdejakhx1owvSkMPjO9HIanNnmTbQBpQ6huc0VKLWcK21UxwhWx9P2ipQmYqScpQYUMStcJkGLT18kWmM6ZHAgGLEFaCKHTqFwzj-Qs52DM-nr_2nTBrF-hXQ/w647-h391/Wharf+Rats+Making+Mods.png" width="647" /></a></div><br /><div>Here is the team at 7:33 am Thursday morning. Everyone is tired but ready to go. They are working on their robot with less than an hour before they need to be in the queue for their 8:40 am run. You can see the venue is almost empty (the practice boards do not open until 8 am).</div><div><br /></div><div>They modified the robot's attachment to remove the mission being deleted, update software and signed up for an 8 am practice table. They had time for one 10 minute slot to test the mechanical changes and dial-in the programming changes. After multiple corrections, the robot turned the wrong direction then started driving the wrong way, they finally got Run 4 to work ONCE before they had to run to the pit to drop-off the laptop and get in the queue by 8:30 am for their first run! Their 8:40 am run scored 250 which held on to give them 13th place in robot performance! Video linked below.</div><div><br /></div><div><a href="https://drive.google.com/file/d/1_fIpmsupaJOIJ3k790nGBJhJSrIgMLLf/view?usp=sharing" target="_blank">Wharf Rats Run 1 at Houston World Championship</a></div><br /><div>My favorite part of the run is the 180 degree turn at 1:51. The turn was needed because the robot had been aligning on the wall using the Strength Training fixture on the back of the robot that was deleted. The fixture that was removed left the back of the robot uneven, so the robot had to spin and do the wall alignment using the front of the robot. That also meant that the first mission after the wall alignment, 3D Printer, had to be updated to turn the opposite direction since the robot was now facing the wall rather than backing into the wall for the alignment. (I also like how at 0:39 seconds that the robot does a 180 degree turn when a fixture is removed to point in the correct direction for the next fixture)</div><div><br /></div><div>And for a while, they were at the top of the robot game leader board.</div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkUHaVqrlCVKjGlPjlVw232u95j2ns5EMZKOglPnn-3Db_JLSRFtvRFp6NSnNnhvAe6CxF_niXBBbDT4PzKBx77AgQo080b-XxFqtwGb_0ted10xA30AloBzI4EEl7N3f6MvC3/s640/Wharf+Rats+on+Houston+Leader+Board+2019+cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="375" data-original-width="640" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkUHaVqrlCVKjGlPjlVw232u95j2ns5EMZKOglPnn-3Db_JLSRFtvRFp6NSnNnhvAe6CxF_niXBBbDT4PzKBx77AgQo080b-XxFqtwGb_0ted10xA30AloBzI4EEl7N3f6MvC3/w615-h361/Wharf+Rats+on+Houston+Leader+Board+2019+cropped.jpg" width="615" /></a></div><br /></div><div>They also had a great research project (a system to reduce the deterioration of the human balance system during extended exposure to micro-gravity) that we hope to continue to advance. I could not be more proud of what they accomplished this season!</div><div><br /></div><div>If you are curious, below is their YouTube video showing their planned robot game strategy a week before worlds. They did get that first cart to roll down the ramp. You get a better look at the robot rotating in base at 0:44 in this video.</div><div><br /></div><div><a href="https://drive.google.com/file/d/1bpiagf14P04NtXxv_g0MFuqMlYhxYq8m/view?usp=sharing" target="_blank">Wharf Rats - Into Orbit - One Week to Worlds</a></div><div><br /></div><div>You can support FIRST by volunteering as a coach, mentor or assistant! Teams can always use extra help with something. Find a team (or teams!) in your area and share your skills! Email me if you want help finding a local team. And contact me if you are interested in establishing an FLL program at your school. </div><div><br /></div><div><a href="https://www.firstinspires.org" target="_blank">https://www.firstinspires.org</a> </div><div><br /></div><div><br /></div><div>Thanks!</div><div>Shane</div><div><br /></div><div>Coach - Wharf Rats - FLL #5027</div><div>Instructor - Summer Robotics Camp</div></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-90068144680415106052019-07-02T11:43:00.001-04:002020-04-28T10:39:50.575-04:00Repair OVER SPEED Error on Generac 15 kW GeneratorNote this is a follow up on the post linked below where we installed an external battery charger on this Generac generator. The Battery Tender we installed has been working well for over 4 years using the same battery that failed twice using the factory charger!<br />
<br />
<a href="https://fettricks.blogspot.com/2015/06/substitue-battery-charger-for-generac.html">https://fettricks.blogspot.com/2015/06/substitue-battery-charger-for-generac.html</a><br />
<div>
<br /></div>
<div>
The most recent issue with the generator was a failure to complete its weekly self test. Upon inspection the OVER SPEED error light was on. You could still run the generator in Manual mode and it sounded like it was running normally.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG9ajnsAlfwcI_DHTBIjRgy1CYu7m-YOPpJVmQ83ZQ371p-8wyxn39ol9LeTN6qM_xNKui-NlUzN8119WmxuXeU-61Uex_RNZoE53bQPuUUMtaFE9waO2iDyEPP1Yoh2hCvjwd/s1600/Generator+Over+Speed+Indicator.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="718" data-original-width="1600" height="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG9ajnsAlfwcI_DHTBIjRgy1CYu7m-YOPpJVmQ83ZQ371p-8wyxn39ol9LeTN6qM_xNKui-NlUzN8119WmxuXeU-61Uex_RNZoE53bQPuUUMtaFE9waO2iDyEPP1Yoh2hCvjwd/s640/Generator+Over+Speed+Indicator.jpg" width="640" /></a></div>
<br />
My research indicated that, in addition to a genuine over-speed condition, this error can be caused when the sensor board doesn't have power so the sensor reading is not present, causing an erroneous Over Speed error. So I started looking for reasons that the sensor board might not be getting power. Let the sleuthing begin!<br />
<br />
<span style="color: red; font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;"><b>Danger Will Robinson! </b></span>You should have a qualified generator service technician diagnose any issues with your generator. The voltage levels in the generator and associated switch gear are lethal. Forgetting to disconnect the power or touching the wrong spot at the wrong time can and will kill you. It is too easy to forget that you closed a breaker a few minutes ago. Really, have a technician do the work on your generator.</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHfOk-jiSP6U4SrnCRzi3sTVGW9ptsEn64h6eQ3vihhenEQJHGku94iViRyfWKLHlQ9BWmi3yj_qCJnk3l54tuclKIUFor23DphaO5Z4aPcR-N9EJHPpgXl-dWHiJq6act1Dv/s1600/Generator+Electronic+Controls+Board.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1118" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHfOk-jiSP6U4SrnCRzi3sTVGW9ptsEn64h6eQ3vihhenEQJHGku94iViRyfWKLHlQ9BWmi3yj_qCJnk3l54tuclKIUFor23DphaO5Z4aPcR-N9EJHPpgXl-dWHiJq6act1Dv/s640/Generator+Electronic+Controls+Board.jpg" width="444" /></a></div>
<br />
Safety first, this meant putting the generator in OFF mode and turning off the power to the house. Even then I pretend that every circuit is still live and avoid touching any conductors. Belt AND suspenders type of caution is the only way to go when dealing with electronics that can kill you!</div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzRcdZTcelrHfR6e502FB6mw3zWAFyp4-ElZPbPcRxI_OPN5tnQdRw1l1CkEhb1aJmrGdOFU7oJRYcVccPSd6LDIbh0lWSEZl0-yxkeDuHx6jDi0zL1oYM9tje7ocvJ1IPOZk1/s1600/_MG_9871.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1067" data-original-width="1600" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzRcdZTcelrHfR6e502FB6mw3zWAFyp4-ElZPbPcRxI_OPN5tnQdRw1l1CkEhb1aJmrGdOFU7oJRYcVccPSd6LDIbh0lWSEZl0-yxkeDuHx6jDi0zL1oYM9tje7ocvJ1IPOZk1/s400/_MG_9871.jpg" width="400" /></a></div>
When everything was off, I open up the generator's electrical panel and the transfer switch panel to look for obvious issues like disconnected wires, loose wire terminals and blown fuses. I got luck and found a blown fuse in the top of the transfer switch. There had been thunderstorms in the area shortly before the generator failed it's first weekly test. </div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ57fYpS0_MFaksRSVyecJi8ed4tYQTm5jU49_gc5AUFXLljYz35pbdQMfQCVfcEfU1ntAGOptyaFppi5YobzAVg7yoQHTB84YxuM8N4H9VKq4K5GwUjg5MeiaNLVbLo366kEa/s1600/AC+Power+Transfer+Box.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZ57fYpS0_MFaksRSVyecJi8ed4tYQTm5jU49_gc5AUFXLljYz35pbdQMfQCVfcEfU1ntAGOptyaFppi5YobzAVg7yoQHTB84YxuM8N4H9VKq4K5GwUjg5MeiaNLVbLo366kEa/s640/AC+Power+Transfer+Box.jpg" width="480" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOZlHOBvGGUGibXPyLxurYfq4-nMa8HcdWeCh4VR01OiRGy3QPf3WQ9X3KPkWYv-a8D36Hw0PPvfbShDF7eGYWGk99NpKlv7wF7jS7T4Gfu7LsmBJDl6aXLKrlyX8o0rZUe-cb/s1600/Generator+Fuse+Cropped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="503" data-original-width="928" height="345" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOZlHOBvGGUGibXPyLxurYfq4-nMa8HcdWeCh4VR01OiRGy3QPf3WQ9X3KPkWYv-a8D36Hw0PPvfbShDF7eGYWGk99NpKlv7wF7jS7T4Gfu7LsmBJDl6aXLKrlyX8o0rZUe-cb/s640/Generator+Fuse+Cropped.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I ordered a pair of fuses, $7 each, and a $15 fuse puller/installer. The fuse were not cheap but I ordered two since there is at least a 50-50 chance that the fuse blew for a reason and the first replacement will blow again as soon as you power the unit back on. If that happens, then back to the diagnostics. I would start with again killing the power and checking the resistance between the fuse terminals and the chassis, looking for a frayed wire shorting against an edge somewhere.<br />
<br />
<a href="https://smile.amazon.com/gp/product/B0195UD1HE/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1" target="_blank">Fuse on Amazon</a><br />
<a href="https://smile.amazon.com/gp/product/B000ZZD070/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1" target="_blank">Fuse Puller on Amazon</a></div>
<div>
<br /></div>
<div>
The fuses arrived quickly, thank you Amazon, and I repeated the process of turning the generator off and turning off power to the house. I then used the fuse puller to remove the old fuse and install the new one. To be honest, I also wore rubber gloves when working with the fuses. Never bet your life that a power circuit is actually off.<br />
<br /></div>
<div>
We reconnected the house power, set the exercise time and the generator ran fine. It has now been over a year since the fuse was replaced and the generator has not missed a weekly self-test. It has also automatically started several times during actual power outages. And we still have a spare fuse!</div>
<div>
<br /></div>
<div>
<h3>
Preview</h3>
</div>
<div>
I am doing some early testing for a battery voltage monitoring system that I put together for this generator. Below is a graph showing the battery voltage during the generator's weekly exercise. Here you can see the battery voltage drop during starting, then the voltage begins to recover while the generator is running and then the battery is topped off by the Battery Tender before dropping back to the standby voltage. I can also configure the system to send me an email or SMS when the voltage drops below a specific voltage (generally this happens during starting so I am notified of start events). My goal is to be able to detect battery deterioration (and indicate that the battery needs to be replaced) before a failure to start occurs. It is also reassuring to see the battery charger topping off the battery following the weekly self test.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimgCjaCbp-KiYg7rZ5CHBLzz-kOG4meNFfjED6OhN0CPDdgBwZXxycQU1mHqvbizrIGVcow1CuZ6Q6FSZLcZ1xL08QjabXN8NokBclsWKz2gg6kzHWyp-Mu5Zyiq5L7HKLUs9U/s1600/Generator+Starter+Cycle.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="230" data-original-width="336" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimgCjaCbp-KiYg7rZ5CHBLzz-kOG4meNFfjED6OhN0CPDdgBwZXxycQU1mHqvbizrIGVcow1CuZ6Q6FSZLcZ1xL08QjabXN8NokBclsWKz2gg6kzHWyp-Mu5Zyiq5L7HKLUs9U/s400/Generator+Starter+Cycle.png" width="400" /></a></div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br />
<div>
<br /></div>
<div>
<br /></div>
</div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com1tag:blogger.com,1999:blog-6265457.post-90928468272214355242019-03-13T10:22:00.006-04:002022-10-20T14:54:14.612-04:00Minimal 3-Axis Magnetometer Rapid Prototype<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin-left: 1em; margin-right: 1em;">
<img height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIDutwz_gvEKMU2ERCLNrXUCN9Oa3EbFHZOuNB3QMls6zz2Pylau5z9U9W6TBmnHXxNPN34UyQ7b6422bU3vPLjoJtN60EpjpT2-rylpOCRHly0sqh7ZjPcN7ZPMYFNvaiegIF/s640/2017-03-28+21.02.16.jpg" width="640" /></div>
<br />
<br />
<br />
This project started when a friend asked me to develop a method to measure the strength of a low-level magnetic field for a fixture in one stage of the playing field for a robotics competition. This was a college level event with teams from around the globe. The system used a low-level magnetic field so detecting the field was more challenging than simply using a reed-switch or hall effect sensor.<br /><br />
The design target for the magnetic field stage of the event was 1000 microTesla (<span class="Latn headword" face="sans-serif" lang="mul" style="background-color: white; color: #202122; font-size: 14px;">μT), or 1 milliTesla (1mT)</span>. To ensure fair competition, the event manager needed a way to verify all of the boards produced a field meeting or exceeding 1000 <span class="Latn headword" face="sans-serif" lang="mul" style="background-color: white; color: #202122; font-size: 14px;">μT</span>. I suggested a potential sensor, the <a href="https://cdn.sparkfun.com/assets/e/e/f/2/7/MLX90393-Datasheet-Melexis.PDF" target="_blank">Melexis MLX90393 Triaxis Magnetometer</a> for calibrating the fields and was quickly asked if I could put something together. That is the ever present danger of tossing out an idea in a meeting, "That sounds great! Why don't you make that happen!".<br />
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
It sound like a great opportunity to quickly assemble a minimal viable product (MVP) and share some rapid prototyping tips. Here is how I built the magnetometer used to validate the magnetic field generators for the <a href="http://sites.ieee.org/southeastcon2017/student-program/student-hardware-competition/" target="_blank">IEEE Southeastcon 2017 Student Robotics Competition</a>. </div>
<br />
One of the robot challenges required performing an action only when a magnetic field was present (there was a Star Wars theme for this stage so detecting the field was referred to as sensing "The Force"). The goal was for the robot to detect the field and mechanically tap the target to score and turn off the magnetic field. After a random time delay the field turns back on and the process repeats until the end of that timed stage. Tapping the target when the field was off would award negative points. The video below shows The University of Alabama on this stage. You can watch the whole video to see all of the event's stages.<br />
<br />
<a href="https://youtu.be/Cr8ltGDthas?t=23" target="_blank">"Sense the Force" Stage from The University of Alabama</a><br />
<br />
There were many innovated robots on display at the event. <a href="https://www.youtube.com/results?search_query=ieee+southeastcon+hardware+competition+2017" target="_blank">Here are more videos from this and other IEEE Southeastcon events.</a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
The MLX90393 was available from Sparkfun as a SparkX product (SparkX devices are early development boards made available to adventurous customers for early testing). Note that this <a href="https://www.sparkfun.com/products/14571" target="_blank">breakout board</a> is now availability as a regular Sparkfun product with the modular Qwiic connectors. Sparkfun also offers a full hookup guide to get you started with your own project.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKHdjbwD3MkM2IRR8hHTnOXjNF29RgVtHhIwJNIbP6r-t9SR-I_8hllp4_Ba6GyCDhreRxVgzoE-Pc702zrxyHxiYCYmpFwCzmUzW4KkTGewsrhC9O0mIdkAmr3avS0cF-7zI0/s1600/MLX90393_001.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="600" data-original-width="600" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKHdjbwD3MkM2IRR8hHTnOXjNF29RgVtHhIwJNIbP6r-t9SR-I_8hllp4_Ba6GyCDhreRxVgzoE-Pc702zrxyHxiYCYmpFwCzmUzW4KkTGewsrhC9O0mIdkAmr3avS0cF-7zI0/s320/MLX90393_001.jpg" width="320" /></a></div>
<br />
I purchased a couple of SparkX boards, combined them with a <a href="https://www.sparkfun.com/products/11114" target="_blank">Sparkfun Arduino Pro Mini</a> and a <a href="https://www.sparkfun.com/products/14050" target="_blank">Sparkfun Basic Serial board</a> along with an OLED display on a bread board and got started. Below you can see all of the elements on a breadboard on my workbench.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMRwW8P92mW-xhhfHQpXHgLZ49dfJD_2jAKUs8pZx-BHMlY24kPFCz6j4h_TpAkWUie_OA-N7oDm94epUg-zwdg8hLyAX_L00UoibPX6PtarcIgMn51PRP38blWFXEf6nb7yxJ/s1600/SparkX+breadboard+Cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="753" data-original-width="1600" height="299" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMRwW8P92mW-xhhfHQpXHgLZ49dfJD_2jAKUs8pZx-BHMlY24kPFCz6j4h_TpAkWUie_OA-N7oDm94epUg-zwdg8hLyAX_L00UoibPX6PtarcIgMn51PRP38blWFXEf6nb7yxJ/s640/SparkX+breadboard+Cropped.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
I began with an example sketch, modified it to send the the data to the OLED, added a little text formatting for the display and the programming was done! Here is a link to the code that was hacked together from several sources.<br />
<br />
<a href="https://github.com/sdtrent/Minimal-Magnetometer">https://github.com/sdtrent/Minimal-Magnetometer</a><br />
<br />
Next up, the breadboard was fine for my workbench, but how should I package the magnetometer for travel and use on the floor at the actual IEEE event? This was a fast and dirty project so I did not want to design a case. I wanted something that was just good enough to meet my minimal requirements. A quick glance around my workbench provided the answer! At arm's reach was a Sparkfun box that fit the bill nicely!<br />
<br />
It was quickly re-purposed to hold the sensor, display and power switch. It took only a few minutes to make holes in the box for each of those. By carefully cutting the holes as slits and keeping the fit tight, the flex and friction of the box held everything in place. I did cover the actual sensor with a layer of clear packing tape to provide some insulation since we were going to be placing the sensor up against the the metal head of the bolt used for the core of the electromagnet. The clear tape also made it easy to see the sensor to help ensure we were putting it directly over the head of the bolt.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKU_u0_J6PEAkDT6T_aaHvSjqf85c5YBu1aTkPwsf1iMmNJ0mXVsF6gvp98sTL32zg1asyWMuTAsAp0Ua76YCpuG6DtTTa8mwN30t9H5sx-gwWwA20qCQ-gaU9EUeL29QEjDk_/s1600/Sparkfun+Box+internals.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1583" data-original-width="1600" height="632" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKU_u0_J6PEAkDT6T_aaHvSjqf85c5YBu1aTkPwsf1iMmNJ0mXVsF6gvp98sTL32zg1asyWMuTAsAp0Ua76YCpuG6DtTTa8mwN30t9H5sx-gwWwA20qCQ-gaU9EUeL29QEjDk_/s640/Sparkfun+Box+internals.jpg" width="640" /></a></div>
<br />
<br />
The 18650 Lithium Ion battery is massively over spec for the use-case, but I had the battery and holders on hand so in they went! The breadboard and battery holder were attached with Velcro dots.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSzXNkk6IIfXWMip0q4xzfmdQprMKjc1f2NB7D5lHuulOaTwrhMevlZco2_lzjEd03aDoRuwr5YoiNBG2kY5g2ck5jQNcoTuvAiYi7zmqgkt_7GzZbSvjeIJWj9kLS8vnoR-oN/s1600/2018-10-31+14.34.34+cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1365" data-original-width="1600" height="544" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSzXNkk6IIfXWMip0q4xzfmdQprMKjc1f2NB7D5lHuulOaTwrhMevlZco2_lzjEd03aDoRuwr5YoiNBG2kY5g2ck5jQNcoTuvAiYi7zmqgkt_7GzZbSvjeIJWj9kLS8vnoR-oN/s640/2018-10-31+14.34.34+cropped.jpg" width="640" /></a></div>
<br />
The device worked great in the field. We even caught when a few of the boards were wired (or wound) with the opposite magnetic polarity. Those boards were quickly rewired to ensure a level playing field for all of the teams.<br />
<br />
I was impressed with the performance of the Melexis MLX90393. It could easily measure the change in magnetic field when a neodymium magnet is rotated 15 cm from the sensor.<br />
<br />
This is one example of how you can quickly assemble a proof-of-concept prototype to test an idea or even provide a Minimum Viable Product for initial field testing. I hope this helps you with your prototyping!Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-44322735960084346092019-01-19T14:55:00.011-05:002021-09-20T10:26:11.945-04:00Building a Lightweight Folding LEGO Sumo Bot Practice Board<div>
Here is an easy to build, lightweight, folding LEGO Sumo Bot practice board. Note that this board is NOT suitable for competition because it does not meet the requirements for the board dimension in the rules and does not provide a drop from the edge of the board to the floor as seen in competition. However, it is super light, easy to carry in one arm and can fit in any car. It provides a great platform for testing your robot programming and sensors in preparation for a Sumo bot event.<br />
<br />
Our first effort at testing a Sumo Bot was actually putting black electrical tape on a table for the robot to detect and stop and then turn around. We figured we could change the Light Sensor thresholds from Black to White before the competition. We quickly learned to be ready to catch the robot when it ran off the table! That got old quickly so we wanted a better solution. So we came up with a folding practice board described here.<br />
<br /></div>
<h3>
Folding Sumo Bot Practice Board</h3>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXwM2MxQWTGmY5VEoAsoREJATMWhXXHQ1OAwh7q8d5m-PelMQekyIUM2U2JBrJe0-zuWq8JTvQFRDaiKMZgJdbCAfFOWn9os6jXMcGiJ-k1AxK7xy8TjCVkqt-AyoeaMgUCNEH/s1600/Sumobot+Board+Cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1195" data-original-width="1600" height="476" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXwM2MxQWTGmY5VEoAsoREJATMWhXXHQ1OAwh7q8d5m-PelMQekyIUM2U2JBrJe0-zuWq8JTvQFRDaiKMZgJdbCAfFOWn9os6jXMcGiJ-k1AxK7xy8TjCVkqt-AyoeaMgUCNEH/s640/Sumobot+Board+Cropped.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
The board is made by simply using white tape to add a border to a black tri-fold poster board (I like foam-core if you can find it) and drawing starting boxes with a marker. I used 2" white masking tape on a foam core 36" x 48" tri-fold. The boxes were drawn with a gold Sharpie marker. We tried a silver Sharpie but it triggered our robot's light sensor, causing problems when traversing the board.<br />
<br />
The size and location of the starting boxes are the only items here that follow the official rules. But these are the most important requirements because they accurately define the only time in the match that you will know the location of both your robot and your opponent's robot.<br />
<div>
<br /></div>
The dimensions and placement of the boxes came from the Watauga Rules linked below. We actually cut a cardboard square the size the starting box and centered it on the center panel. Using the orientation of the image above, we traced just the top and bottom sides of the cardboard square which will be the bottom of the top box and the top of the bottom box respectively. This step ensures the starting boxes are the correct distance apart. Then we added the other three sides of each square to produce what you see above.<br />
<div>
<br />
The placement of the tape is not that critical. We start with a strip at the top and bottom of the center section, stopping at the fold line. Then we added the four angled pieces before finally added the lines on the left and right ends to finish up the frame. While it is not a circle, it still provides an effective test platform for the robot.<br />
<br /></div>
<h3>
Sumo Bot Events</h3>
<div class="separator" style="clear: both; text-align: center;">
</div>
LEGO Sumo Bot events offer competitors a chance to design, build and program a LEGO MINDSTORMS robot to compete head to head with another robot. I have coached in <a href="https://www.firstinspires.org/robotics/fll" target="_blank"><b><i>FIRST </i></b>LEGO League</a> for several years and my students have enjoyed participating in Sumo Bot (and LEGO Line Follower) events. The single day events do not require the extended effort needed to compete in FLL and let the students enjoy the head-to-head competition. It is also nice for the students to have a simple goal that allows them to quickly test different mechanical designs and programming strategies.<br />
<div>
<br /></div>
<div>
The events we attend follows the Watauga Sumo Bot rules as shared by Dr. Eric Marland at Appalachian State University in Boone, North Carolina. The link below has information for their Sumo Bot program. Other events may follow different rules but most are similar. </div>
<div>
<a href="http://www.appstate.edu/~marlandes/sumo/sumosumo.html">http://www.appstate.edu/~marlandes/sumo/sumosumo.html</a></div>
<div>
<br /></div>
<div>
Here is a link for the Watauga LEGO Sumo Bot Rules for 2019 (unchanged from 2018).</div>
<div>
<a href="http://www.appstate.edu/~marlandes/sumo/SumoRules18.pdf">http://www.appstate.edu/~marlandes/sumo/SumoRules19.pdf</a></div>
<div>
<br /></div>
<div>
Note that many events also offer an "Open Category" that allows robots with non-LEGO components. I expect this practice board would be helpful for them as well. </div>
<div>
<br /></div>
<div>
Sumo Bot has a simple premise, after a 5 second delayed start, your robot leaves the 10" starting square and then works to push the other robot out of the Sumo Bot ring without your robot leaving first. The action is made more interested because the ring is generally elevated slightly from the floor and a robot is officially out of the ring when any part of the robot touches the floor. This includes parts that fall off of your robot (if a piece touches the floor, you are out). </div>
<div>
<br /></div>
<div>
Note there are some great instructions online for building a real Sumo bot ring, the kind you will need if you are going to host an actual LEGO Sumo Bot event (in fact you will probably need at least two or three boards to keep an event moving). But official boards require materials, tools and time to build them. In addition the boards are very large (77 cm across) and heavy, making it a hassle to move them from room to room let alone try to transport them.</div>
<div>
<br /></div>
<h3>
Practice Board in the Pits</h3>
<div>
We take our practice board to the pits at events for use if the students need to test tweaks to the software or verify calibration of the light sensors. It also provides a great platform for demonstrating the robot's behavior or even doing some friendly scrimmages before the event starts. Most events include practice rounds but you must sign up for specific time slots. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkw9OfJdxnuOl45JD6zA7eVvDYygv_HFZklkD0kiaa63h3YXVmT8VKLL_XQpkaNcaCnnhzxtAuYllVCD_s5yEPIurYi06w6EnSbpi-OexdOqqWE4Qm5oEbxl3Nv8Lducdew45V/s1600/Sumo+Bot+Board+in+Pits+Cropped+2.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1050" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkw9OfJdxnuOl45JD6zA7eVvDYygv_HFZklkD0kiaa63h3YXVmT8VKLL_XQpkaNcaCnnhzxtAuYllVCD_s5yEPIurYi06w6EnSbpi-OexdOqqWE4Qm5oEbxl3Nv8Lducdew45V/s640/Sumo+Bot+Board+in+Pits+Cropped+2.jpg" width="419" /></a></div>
<div>
<br /></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
</div>
<div>
<br /></div>
<div>
Each spring, Triangle Math & Science Academy holds both a LEGO Sumo Bot and LEGO Line Follower event. I recommend these for students who want to improve their LEGO MINDSTORMS building and programming skills.<br />
<br />
Both events are fun and each offer k-5th and k-8th brackets and each bracket has it's own competition ring (or line following field for the Line Follower). Typically they matches in both brackets at the same time. Below you can see one of our team members setting up for a run. Notice how the official Sumo Bot board is larger and is elevated from the floor. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD5toYO9ZtMyMoEs-SES5qlGn2UJ49CK0HigN-IXeoL0CgRVNPRtuxk3zrmYiriNwCgg8olpK9ESoeMOLEdPNUdHnYLtASrSmpnnnori0DZeOjhRLW-J1B4VKKIIMm9GSUlpeq/s1600/2018-05-12+13.56.59+Cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1145" data-original-width="1600" height="457" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgD5toYO9ZtMyMoEs-SES5qlGn2UJ49CK0HigN-IXeoL0CgRVNPRtuxk3zrmYiriNwCgg8olpK9ESoeMOLEdPNUdHnYLtASrSmpnnnori0DZeOjhRLW-J1B4VKKIIMm9GSUlpeq/s640/2018-05-12+13.56.59+Cropped.jpg" width="640" /></a></div>
<div>
<br /></div><div>The team's game strategy was to quickly attack the opponent the only time they know where the other robot will be, just outside of the box at the the start of the match. Their robot starts on release of the touch sensor so they can start their program well before the match begins. </div><div><br /></div><div>The robot drives out of the box backwards to have a smaller turn toward their opponent to reach the other robot more quickly. The referee tells the teams which direction to use to launch their robot to start the match. So the team used two touch sensors to allow them to start the robot in either direction and still make the proper turn toward their opponent. They were pleased with their strategy and named their robot "Tech Norris" in reference to Chuck Norris. Here is a compilation of all of their LEGO Sumo Bot runs for the day. </div><div><br /></div><div><a href="https://drive.google.com/file/d/13120N8YLtnT4qE6-OWW3W4zzNiyus_dF/view?usp=sharing" target="_blank">Sumo Bot Run Compilation</a><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div>
<div>
I hope this information helps you build a great practice board and get a chance to participate LEGO Sumo Bot event!</div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-72674112707915050952018-10-25T14:27:00.008-04:002024-01-14T10:52:16.002-05:00Roasting Coffee with a Hot Air Poppcorn PopperThere are many methods of roasting your own coffee. In fact, roasting your own coffee on an as-needed basis using a stove, oven or fire to was common until relatively recently. I have used several machines for roasting coffee at home. Today one of the fastest and easiest methods of roasting coffee is using a hot-air popcorn popper and the method I use most often myself (although I have purchased two dedicated roasting appliances over the years). Here I will share some details about the roasting set up that evolved since I began recreational coffee roasting in 2003.<div><br />
<h3>
</h3>
<h3>
The Beans</h3>
Today's roast is Timor Leste Lacao Village from Sweet Maria's. They are my favorite supplier of green coffee and a great source of information about roasting and the history of coffee. I have also purchased multiple coffee roasters from them over the years.</div><div><br /></div><div><a href="https://library.sweetmarias.com/">Sweet Maria's Coffee Library</a><br /><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjjmLBF7_bBDKTrHLVUct2-GbvJ-hkIbWsHRUvCSkTTDbXPMWLY1MlaNXX4BWlCYEs-SKyemO3A6ACiyMHW1f23v4S6RgDSL2l9R_iYYcpA_aZzhyu6ScrfUmjAKxogVGS2CiX/s1600/Sweet+Maria%2527s+Coffee.jpg" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="998" data-original-width="1600" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjjmLBF7_bBDKTrHLVUct2-GbvJ-hkIbWsHRUvCSkTTDbXPMWLY1MlaNXX4BWlCYEs-SKyemO3A6ACiyMHW1f23v4S6RgDSL2l9R_iYYcpA_aZzhyu6ScrfUmjAKxogVGS2CiX/s400/Sweet+Maria%2527s+Coffee.jpg" width="400" /></a></div>
<br />
<br />
<h3>
</h3>
<h3>
The Roaster</h3>
My current roaster of choice is a donated vintage popcorn popper that has worked well for several years. Newer popcorn poppers may work but it depends on the model, some have low temperature cutoffs that prevent coffee roasting. Often older poppers are available in thrift shops. If you ask friends and family I expect you will find someone who is happy to give you one that has been sitting unused in the cabinet for years.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijJQRaRhrpeV4rKtKZBDpKZWDuwggv_7XdZaJesyrD5QHPh1PJXD099vR8nv-K05sudARa_lhB58295_66xx3nXi0KS6TJuLktE2JIdF32cLtKY23daiwM0LvOEilR_h3ulm6L/s1600/Vintage+Hot+Air+Popcorn+Machine.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1339" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijJQRaRhrpeV4rKtKZBDpKZWDuwggv_7XdZaJesyrD5QHPh1PJXD099vR8nv-K05sudARa_lhB58295_66xx3nXi0KS6TJuLktE2JIdF32cLtKY23daiwM0LvOEilR_h3ulm6L/s640/Vintage+Hot+Air+Popcorn+Machine.jpg" width="532" /></a></div>
<br /><br /></div><div><br /></div><div>Another recent option is the Popper coffee roaster that can be purchased through Sweet Maria's. It offers full control of heater power level, air flow, and even a built in timer. They also offer bundles that include a power meter (to let you adjust for your AC wall voltage) and green coffee beans.</div><div><br /></div><div><a href="https://www.sweetmarias.com/popper.html">Popper Coffee Roaster</a><br /></div><div><br /></div><div>
I have had the power switch fail on a couple of poppers over the years. Now I connect the popper and cooling fan to a switched power strip so I can turn them both off and on at the same time. In addition to eliminating the popper switch as a failure point, it also saves the hassle of wrestling the popper around in the roasting box feeling for the switch. One detail I like about this popper is the open-topped discharge shoot that works well with the vent used in my setup.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb7-L5DdCDKtHQz4ySuoLT7Y_3W-baV5YOioRJFOV0Fip8Pue8apZGuOXaCL2vkWUA2TCZKgylXpQaLSW9hRebPiMskkAqqTiKLx7fo1wjzOzT4Ju7-siLUwhDr-nZ6cR51S9y/s1600/Hot+Air+Popper+Shield.jpg" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="1600" data-original-width="1200" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjb7-L5DdCDKtHQz4ySuoLT7Y_3W-baV5YOioRJFOV0Fip8Pue8apZGuOXaCL2vkWUA2TCZKgylXpQaLSW9hRebPiMskkAqqTiKLx7fo1wjzOzT4Ju7-siLUwhDr-nZ6cR51S9y/s640/Hot+Air+Popper+Shield.jpg" width="480" /></a></div>
<br />
Roasting coffee produces chaff (a piece of the parchment-like wrapper that comes loose from the bean during roasting) and smoke and keeping both of these under control makes roasting much more pleasant. My approach is to keep the popper a box with a top-mounted vent connected to a bilge blower that exhausts through an insulated panel installed in a window in my garage.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5YCYRIYcT-RByULF0r1mJ81cXPQsA-HPSDBs0g54R64AeEJeXQNYgeAfXjn0xOFmB5qthhSdn5vDMumfvfv8USBzRa-qse_jnckniCIv1Ql9KmsN8fkMzKhcQBV2t0mVZuc3X/s1600/Popper+in+Box+with+Vent.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5YCYRIYcT-RByULF0r1mJ81cXPQsA-HPSDBs0g54R64AeEJeXQNYgeAfXjn0xOFmB5qthhSdn5vDMumfvfv8USBzRa-qse_jnckniCIv1Ql9KmsN8fkMzKhcQBV2t0mVZuc3X/s640/Popper+in+Box+with+Vent.jpg" width="480" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Power for the bilge blower comes from an adjustable power supply on my workbench. By turning down the power to the blower and slightly closing the flaps on the box, I can improve how quickly the roaster warms up during cold weather. It is no fun waiting for a slow roast to finish in an unheated garage.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4raZFebFHE6Y-sypQ4aVgo3UFbSs5WAOPc0b6GYBqZSU7lYaxafhj9OHX1VSVibbFrPpYDwlOdbsfWm3-IwrQdXAuDUrx_QUxVVojlMG3jN_iRdaWW-qd-U3E51nX9jF-o-g4/s1600/Box+Vented+with+Bilge+Blower.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4raZFebFHE6Y-sypQ4aVgo3UFbSs5WAOPc0b6GYBqZSU7lYaxafhj9OHX1VSVibbFrPpYDwlOdbsfWm3-IwrQdXAuDUrx_QUxVVojlMG3jN_iRdaWW-qd-U3E51nX9jF-o-g4/s640/Box+Vented+with+Bilge+Blower.jpg" width="640" /></a></div>
<br />
<h3>
</h3>
<h3>
Automated Control Options</h3>
<h3>
<div style="font-size: medium; font-weight: 400;">
Without hacking into the electronics of the popper, this setup still offers two clear options for automated control. The first option is to use a hobby RC servo to control a vent (flap or sliding window) on the side of the box. The idea is to close the vent and operate the roaster in the sealed box until the interior temperature of the box reaches a specific threshold (100 F?) to get the roast started quickly, even in cold weather.<br />
<br />
The second option would be to add PWM control of the blower to run at be off or run at low speed until the temperature reaches the desired threshold. Again to help the roast comes up to temperature quickly in even the coldest temperatures while still ensuring the fan is on to vent smoke and chaff outside once the roast gets going. </div>
</h3>
<h3>
<b><br /></b></h3>
<h3>
<b>Roasting Technique</b></h3>
I start the popper and pour green beans into the chamber until the beans just stop swirling (maybe just a few extra beans). I will then give the roaster a few shakes (it might take a minute) until the beans are swirling on their own. My goal is to use as much coffee as the popper can circulate.<br />
<br />
The bean will go through many stages during the roast. Where you stop the roast depends on the type of bean and the degree of roast that you want. The article below outlines the differences between the stages of roast.</div><div><br />
<a href="https://library.sweetmarias.com/using-sight-to-determine-degree-of-roast/" target="_blank">Degrees of Coffee Roast</a><br />
<br />
As the beans warm the coffee beans will begin to change color and begin losing some of their chaff. As the beans begin to roast you will hear a popping sound, the first crack, and the chaff will come off of the beans very quickly. I like to stop the roast when the first crack has just finished. This is generally described as a City Roast. For this batch, I stopped the roast at a little under 6 minutes.<br />
<br />
I feel most coffees reach their peak of flavor between the end of the first crack and the very start of the second crack. If you want to roast past City Roast the quickness of your cooling method becomes more critical as the roast begins to be exothermic and can coast for some time after being removed from the heat. If your cooling is too slow it is very easy to overshoot and get a darker roast than you intended.<h3>
<b>Cooling the Roasted Coffee</b></h3>
I cool the roasted coffee by dumping into a wire mesh colander setting on a fan aimed straight up. I found that cooling time can be shorted by bending a dome into the bottom of the colander and using a little painter's tape to direct the airflow inward. With this set up the beans are cool to the touch in less than two minutes.<br />
<br />
<div style="font-weight: bold;">
<b><br /></b></div>
<div class="separator" style="clear: both; font-weight: bold; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjht9HN-qQvpw6uT3lMEWd1_38CdVYdEnMzekdP2Y6oHL-vL7OpHKc_jSnwLgq9SC0lHqYqotKkzsiZleCr6YMB-V5xY917iNjQF0934Ww5jYtu4mLIJ_4rhXqtRsYF5pCWB7n2/s1600/2018-10-25+08.02.46.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjht9HN-qQvpw6uT3lMEWd1_38CdVYdEnMzekdP2Y6oHL-vL7OpHKc_jSnwLgq9SC0lHqYqotKkzsiZleCr6YMB-V5xY917iNjQF0934Ww5jYtu4mLIJ_4rhXqtRsYF5pCWB7n2/s640/2018-10-25+08.02.46.jpg" width="640" /></a></div>
<div style="font-weight: bold;">
<b><br /></b></div>
<div style="font-weight: bold;">
<span style="font-weight: 400;">The dome keeps the beans away from the center of the fan that has low airflow. Before the dome, I had to shake the beans around to ensure even cooling. </span></div>
<div style="font-weight: bold;">
<b><br /></b></div>
<div class="separator" style="clear: both; font-weight: bold; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5qcnAzfFQWHAm4pNKxrFkhRYqyoa9v1q766FgnOPfhZDwjpxp1lCph9QkZLlWYPzZSNkMx8dR4Iz1J3SULF0GjkLcxsC_GRW6iiqM9L1LoSlAQ76yrzJLq8qn_hoFDZ1RFcmu/s1600/Domed+Bottom+of+Roasting+Basket.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5qcnAzfFQWHAm4pNKxrFkhRYqyoa9v1q766FgnOPfhZDwjpxp1lCph9QkZLlWYPzZSNkMx8dR4Iz1J3SULF0GjkLcxsC_GRW6iiqM9L1LoSlAQ76yrzJLq8qn_hoFDZ1RFcmu/s640/Domed+Bottom+of+Roasting+Basket.jpg" width="640" /></a></div>
<div style="font-weight: bold;">
<b><br /></b></div>
<div style="font-weight: bold;">
<br /></div>
This batch yield 116 grams, or just over 4 ounces, of roasted coffee. The beans get lighter as they lose moisture and volatiles during roasting so this probably started out as close to 5 ounces of green coffee.<br />
<div style="font-weight: bold;">
<b><br /></b></div>
<div class="separator" style="clear: both; font-weight: bold; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvB31ygs0Tq8qLdQvn0hgI5JNJ81VNHZXsaHQHkntFGetKn2H5IVmnZrhaRmIJkaVAMiwifIU35GjDDRWUKASVPZfWnSlBUU0BEQmBls1CCDkfIZT571pJ7EKsDjyyKRESipL8/s1600/Roasted+116gm+Coffee.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvB31ygs0Tq8qLdQvn0hgI5JNJ81VNHZXsaHQHkntFGetKn2H5IVmnZrhaRmIJkaVAMiwifIU35GjDDRWUKASVPZfWnSlBUU0BEQmBls1CCDkfIZT571pJ7EKsDjyyKRESipL8/s640/Roasted+116gm+Coffee.jpg" width="480" /></a></div>
<div style="font-weight: bold;">
<b><br /></b></div>
<div style="font-weight: bold;">
<b><br /></b></div>
I usually do at least two batches of whatever I am roasting. This usually means two batches of caffeinated and two batches of decaf. This is just the right amount to fill the jars that I like. Coffee brewed with beans fresh from roasting tastes great to me but many types of bean will improve in flavor with a rest of 6 to 48 hours.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8lFIFsOkSRHoFZ3JFOghYIlYeA4kWPuBY0-SSE_lpsFqNAoTfMDu42Aun2mHs7OxBeWf5ckvd_EEhxhe2itEdr-FLuapMTrFgCRoMe7xEzWpV-jah2M3r_BINbqZndWhvRcZQ/s1600/Two+Batches+of+Roasted+Coffee.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1253" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8lFIFsOkSRHoFZ3JFOghYIlYeA4kWPuBY0-SSE_lpsFqNAoTfMDu42Aun2mHs7OxBeWf5ckvd_EEhxhe2itEdr-FLuapMTrFgCRoMe7xEzWpV-jah2M3r_BINbqZndWhvRcZQ/s400/Two+Batches+of+Roasted+Coffee.jpg" width="312" /></a></div>
<div style="font-weight: bold;">
<b><br /></b></div>
If you would like to try roasting yourself, I recommend starting with a hot-air popper and coffee sampler from Sweet Maria's. Try the half-decaf bundle and you may be surprised at how good decaff coffee can taste. My favorite everyday coffee is half decaffeinated Indonesian and half caffeinated Yemen or Ethiopian. I also like having decaf on hand for the occasional evening cup of coffee.<br />
<br />
<a href="https://www.sweetmarias.com/nostalgia-electric-popcorn-popper.html">Hot Air Popcorn Popper</a><br />
<br />
<div style="font-weight: bold;">
<br /></div>
I hope you have learned something that helps you improve your coffee roasting.</div>Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-61128631977209272682017-09-26T09:55:00.007-04:002023-10-04T22:05:02.016-04:00Research Links on Weight Loss, Nutrition and Fasting<div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">
<div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">I began researching weight loss approaches and fasting in particular in early 2017. Here are some links for the sources that I found most informative. I used periodic fasting (ranging from not eating until dinner time all the way up to having a meal Sunday evening and not eating again until dinner on Friday). </span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">I lost 40 pounds (and have kept it off for six years). I also used fasting to help improve my concentration when studying for and taking the USPTO Patent Bar Exam (I passed!) I hope you find this information helpful.</span></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">The bottom of this page also includes links found during my research that discuss a connection between calorie restriction and improved experiences with chemotherapy. <br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica neue" , "arial" , "helvetica" , sans-serif">Novel study (super controlled and reversing test/control subjects) on Ultra-processed food.</span><br />
<span face=""helvetica neue" , "arial" , "helvetica" , sans-serif"><a href="https://directorsblog.nih.gov/2019/05/21/ultra-processed-diet-leads-to-extra-calories-weight-gain/">https://directorsblog.nih.gov/2019/05/21/ultra-processed-diet-leads-to-extra-calories-weight-gain/</a></span><br />
<span face=""helvetica neue" , "arial" , "helvetica" , sans-serif"><br /></span>
<span face=""helvetica neue" , "arial" , "helvetica" , sans-serif">Full text of the study of Ultra-processed diet.</span><br />
<a href="https://www.cell.com/cell-metabolism/fulltext/S1550-4131(19)30248-7"><span face=""helvetica neue" , "arial" , "helvetica" , sans-serif">https://www.cell.com/cell-metabolism/fulltext/S1550-4131(19)30248-7</span></a><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Forks over knives article on fasting</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.forksoverknives.com/who-benefits-from-medically-supervised-fasting/?utm_source=facebook&utm_content=plant-based&utm_term=vegan#gs.nTX0Lrs">https://www.forksoverknives.com/who-benefits-from-medically-supervised-fasting/?utm_source=facebook&utm_content=plant-based&utm_term=vegan#gs.nTX0Lrs</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Experiments in intermittent fasting by an athlete who is already in great shape and eating well. </span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="http://www.precisionnutrition.com/intermittent-fasting">http://www.precisionnutrition.com/intermittent-fasting</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span><span face=""helvetica" , "arial" , "droid sans" , sans-serif">An interesting paper on metformin impact on blood sugar and weight loss</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.thieme-connect.com/products/ejournals/pdf/10.1055/s-0032-1327734.pdf">https://www.thieme-connect.com/products/ejournals/pdf/10.1055/s-0032-1327734.pdf</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Dietary restriction with and without caloric restriction for healthy aging</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4755412/">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4755412/</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Health Impacts of Calorie Reduction</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.scientificamerican.com/article/the-hunger-gains-extreme-calorie-restriction-diet-shows-anti-aging-results">https://www.scientificamerican.com/article/the-hunger-gains-extreme-calorie-restriction-diet-shows-anti-aging-results</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Fasting Weight Loss Paper</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2466480/?page=1">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2466480/?page=1</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Investigation of Starvation Mechanisms</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3529354/">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3529354/</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Why fasting bolsters brainpower.</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.youtube.com/watch?v=4UkZAwKoCP8">https://www.youtube.com/watch?v=4UkZAwKoCP8</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Why does fasting boost learning?</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="http://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.2002032#sec002">http://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.2002032#sec002</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Intermittent Fasting and Weight Loss</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://authoritynutrition.com/intermittent-fasting-and-weight-loss/">https://authoritynutrition.com/intermittent-fasting-and-weight-loss/</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Write up about a supervised 382 day fast, the patient lost 276 lbs.</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2495396/pdf/postmedj00315-0056.pdf">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2495396/pdf/postmedj00315-0056.pdf</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">A History of Modern Research into Fasting, Starvation, and Inanition</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.springer.com/cda/content/document/cda_downloaddocument/9783642290558-c2.pdf?SGWID=0-0-45-1331359-p174310858">https://www.springer.com/cda/content/document/cda_downloaddocument/9783642290558-c2.pdf?SGWID=0-0-45-1331359-p174310858</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Interesting fasting information collected from several reference sources</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="http://anabolicapex.com/2016/02/03/intermittent-fasting-benefits/">http://anabolicapex.com/2016/02/03/intermittent-fasting-benefits/</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Good video with links for references on Longevity and eating one meal a day.</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.youtube.com/watch?v=PKfR6bAXr-c">https://www.youtube.com/watch?v=PKfR6bAXr-c</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Is Ketosis Dangerous?</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.youtube.com/watch?v=Dan8qtgQRi8&feature=youtu.be">https://www.youtube.com/watch?v=Dan8qtgQRi8&feature=youtu.be</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Fasting versus eating less.</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.youtube.com/watch?v=APZCfmgzoS0">https://www.youtube.com/watch?v=APZCfmgzoS0</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">We should never have told people they could 'burn off' calories with exercise.</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.businessinsider.com.au/exercise-not-weight-loss-key-2017-6?r=US&IR=T">https://www.businessinsider.com.au/exercise-not-weight-loss-key-2017-6?r=US&IR=T</a></span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Where does the fat go when you lose weight?</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="http://www.sciencealert.com/this-is-where-body-fat-ends-up-when-you-lose-weight">http://www.sciencealert.com/this-is-where-body-fat-ends-up-when-you-lose-weight</a></span></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><h1 style="text-align: left;"><b><span style="font-size: x-large;">Fast and Cancer Treatment</span></b></h1>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><b><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><span face=""helvetica" , "arial" , "droid sans" , sans-serif"><b><br /></b></span></div>The potential impact of fasting on cancer treatment continues to be investigated. Those interested should search for the most recently published study results.</b></span></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><span face=""helvetica" , "arial" , "droid sans" , sans-serif"><br /></span>
<span face=""helvetica" , "arial" , "droid sans" , sans-serif">Cancer cells use glucose for energy to build with amino acids (03-07-16)</span><br />
<span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="http://news.mit.edu/2016/how-cancer-cells-fuel-their-growth-0307">http://news.mit.edu/2016/how-cancer-cells-fuel-their-growth-0307</a></span><br />
<br />
<span face="helvetica, arial, droid sans, sans-serif">Fasting and Caloric Restriction in Cancer Prevention and Treatment (2016)</span><br /><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7476366/">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7476366/</a></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><span face=""helvetica" , "arial" , "droid sans" , sans-serif">Effects of Short-Term Fasting on Cancer Treatment (05-22-19)</span><br /><span face=""helvetica" , "arial" , "droid sans" , sans-serif"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6530042/">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6530042/</a></span><br /><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">Why might cancer cell use fermentation rather than oxidation for energy? (01-22-21)</div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><a href="https://www.iflscience.com/health-and-medicine/new-research-has-solved-a-100yearold-mystery-about-cancer/?fbclid=IwAR3mOddl6CoenwYzotGUkSvU7CNYu0QlHCoCKISwnihvmdQv0TxXgPFI9L8">https://www.iflscience.com/health-and-medicine/new-research-has-solved-a-100yearold-mystery-about-cancer/?fbclid=IwAR3mOddl6CoenwYzotGUkSvU7CNYu0QlHCoCKISwnihvmdQv0TxXgPFI9L8</a></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">Fasting and fasting-mimicking diets for chemotherapy augmentation (02-07-21)</div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8190229/">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8190229/</a></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">Intermittent fasting and cancer study of 101 people, 73 women, 28 men. (11-29-21)</div></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><a href="https://www.breastcancer.org/research-news/intermittent-fasting-may-help-cancer-treatments-work-better">https://www.breastcancer.org/research-news/intermittent-fasting-may-help-cancer-treatments-work-better</a><br />
<br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;">Short-term fasting and fasting mimicking diets and chemotherapy: a narrative review (03-22-23)</div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10037739/">https://www.ncbi.nlm.nih.gov/pmc/articles/PMC10037739/</a></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><a href="https://translational-medicine.biomedcentral.com/articles/10.1186/s12967-023-04263-8#:~:text=Moreover%2C%20metformin%20has%20been%20used,therapeutic%20dosages%20of%20anticancer%20treatments.">Metformin and cancer hallmarks: shedding new lights on therapeutic repurposing</a></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><br /></div><div style="border: 0px; line-height: 1.42857em; margin: 0px; padding: 0px;"><a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6497052/#:~:text=Metformin%20inhibits%20UPR%20activity%20in,undergo%20apoptosis%20and%20ultimately%20die.&text=It%20has%20also%20been%20shown%20that%20metformin%20prevented%20cell%20growth,growth%20factor%20receptor%202)%20level.">The beneficial effects of metformin on cancer prevention and therapy: a comprehensive review of recent advances</a></div>
</div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-53358992741239128312017-06-02T13:00:00.000-04:002017-09-21T08:01:37.372-04:0012V Cellphone and GPS Socket for 6V Positive Ground Studebaker<div class="separator" style="clear: both; text-align: center;">
</div>
<b>The Car</b><br />
<br />
Sam (my Step-Father) has a 1952 Studebaker Champion that he has restored. During one of our too infrequent visits he was showing me his latest work when I noticed a small 12V battery (like you would find in a UPS or alarm system) in the trunk with a cigarette lighter socket attached via a short cable. He explained that the car had a 6V positive ground electrical system and he used the 12V battery to power his GPS when he drives to car events and for charging his cellphone while he is in the car. He said a 12V outlet for the car would be nice and asked if I thought I could build one. Challenge accepted!<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjN-zVb97Ah32sfjvLb2cNEifKsIcYLKBe7DX2II_xyrOcKQ2eSQ1iQa2uOrxmUg0dJKYbnkDqxiGlgbRQeXgLtOT7RwM4ZQ4ENtCxlFgbv7SSIw0JIQI_OfzAnTzy8x-uzuEs/s1600/Champion+Cropped.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="845" data-original-width="1600" height="337" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjN-zVb97Ah32sfjvLb2cNEifKsIcYLKBe7DX2II_xyrOcKQ2eSQ1iQa2uOrxmUg0dJKYbnkDqxiGlgbRQeXgLtOT7RwM4ZQ4ENtCxlFgbv7SSIw0JIQI_OfzAnTzy8x-uzuEs/s640/Champion+Cropped.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sam's 1952 Studebaker Champion</td></tr>
</tbody></table>
<b>Design Steps</b><br />
<b><br /></b>
Initially I used electrical tape to insulate the power socket from the metal dash (which is at +6V) so the body of the socket could be connected to battery negative. This allowed the use of boost converter to generate 12V from the 6V battery.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYtzGX8vdMYwXy-eBARQEm38heTuV6RBRJiInHB_xKQhJEOCLwwSmYM7jTMBIoa9VOu2NKjoBbbJjgYfnDKeQj42Mgx-s9NZZsS1SVx57j3h5FjQbIEQB9UHoR044hgFX57Mn6/s1600/Insulated+power+socket.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="1103" data-original-width="1600" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYtzGX8vdMYwXy-eBARQEm38heTuV6RBRJiInHB_xKQhJEOCLwwSmYM7jTMBIoa9VOu2NKjoBbbJjgYfnDKeQj42Mgx-s9NZZsS1SVx57j3h5FjQbIEQB9UHoR044hgFX57Mn6/s320/Insulated+power+socket.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">First attempt insulated the power socket from the 6V positive ground metal dash.</td></tr>
</tbody></table>
While this worked and was installed in the car for over a year, insulating the outlet was an extra step and failure of the insulation between the socket and the metal dash paneled seemed to be a likely failure point. Before sharing the design I wanted a more robust solution that would be easy to install.<br />
<br />
I considered a fully insulated power socket but could not find one that would fit the existing dash opening. I also considered using a plastic bracket to mount the power socket but that would spoil the factory look the dash. Sam was so kind as to offer to use a pigtail socket that he stows under the seat when not needed but I was determined to find a way to use the existing mounting spot in the dash.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
The eureka moment came when I wrote out the the system assumptions and requirements and noticed that devices plugged into the power socket make no other connections to the vehicle electrical system. This means that the power socket does not require an absolute voltage output, but actually needs only a 12 volt difference between the power socket center terminal and the body or chassis connected terminal. So if I apply 18V to the center terminal of the power socket, any device plugged into the socket will see 18V - 6V or 12V between the socket's terminals. Sometime just writing a spec can help set the direction for a project!<br />
<br />
A search of <a href="https://www.pololu.com/product/2571" target="_blank">Pololu's</a> DC-DC Boost Converters found no 18 V boost converters but I did find the U3V50 adjustable boost converters. These small module have a 5A input switch and adjustable output (9-30 V) for $17. Notice that these modules are offered in several fixed voltages (but not 18V) and two adjustable voltage ranges. Be sure to get the higher (30V) adjustable range, U3V50AHV. Perhaps Pololu will offer an 18V option in the future.<br />
<br />
<img height="185" src="https://a.pololu-files.com/picture/0J4882.1200.jpg?2c7ccead328606687d1060bf7cbeb47d" width="200" /><img height="216" src="https://a.pololu-files.com/picture/0J4879.1200.jpg?e0a331414b62555edb00fc1a6fcfca17" width="320" /><br />
<br />
<a href="https://www.pololu.com/product/2571">https://www.pololu.com/product/2571</a><br />
<br />
Once I received the module, I added some wires, powered it up and dialed the voltage to 18V. The product page at Pololu has some great information about the module's efficiency. There is even a chart showing efficiency when set for an 18V output with several input voltages.<br />
<br />
<img src="https://a.pololu-files.com/picture/0J4920.1200.png?74d31eb95b800fbd3652fb8251d00b39" /><br />
<br />
Looking at the chart we can see that a 5V input provides an 18V output at 1 amp at better than 80% efficiency. So our 6V nominal input should give us even higher output and higher efficiency. I tested the module with a USB car charger and a <a href="http://www.amazon.com/PortaPow-Monitor-Version-Multimeter-Chargers/dp/B00NTU18KY?ie=UTF8&keywords=PortaPow&qid=1465423790&ref_=sr_1_4&sr=8-4" target="_blank">PortaPow USB Power Meter</a>. The image below shows the unit providing over 10W while charging an iPad.<br />
<br />
The module got hot before the current started dropping off as the iPad reached full charge but the module never reached the high-temperature cut-off. The Pololu module is very robust but I would not try to draw more than 1 amp from the 12V power socket. So no high power stereos or ham radio rigs. But you should be able to charge your phone or run your GPS all day long.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-thTs75ePCNtfL8tYbvBOjOP2jhGKXEZClEiXiWn4Q8h5JqnB1MohwilgyVD1rXof8bfObeOJW563514niYldHCUa9zqnvStWKeRdibBH5RwyEIHlo1O-SO5c3lHqmYM-Adtn/s1600/USB+Power+Measurement.jpg" imageanchor="1"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-thTs75ePCNtfL8tYbvBOjOP2jhGKXEZClEiXiWn4Q8h5JqnB1MohwilgyVD1rXof8bfObeOJW563514niYldHCUa9zqnvStWKeRdibBH5RwyEIHlo1O-SO5c3lHqmYM-Adtn/s200/USB+Power+Measurement.jpg" width="200" /></a><br />
<br />
The Studebaker's existing lighter socket was power via a switched negative wire with a bullet connector on the socket center terminal and an empty spade terminal on the socket body (our positive chassis 6V power source). To make the installation easier, I added a different color wire to each of our module connections and a matching connector for each terminal. I also insulated the module with clear heat-shrink tubing.<br />
<div>
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKp_ZSKSdbLkZY_T-2kdAn1_o8L6KW-9lTNyr3akMvbcMhLTc2kfoh_ZIcPOi_5qb8cTFkwxSmwcnBnIHj8QUPpnTybh7ebcy-1YiXxXQKNoPWrIffAUl5o4ABPmpTyp3Q0L2H/s1600/IMG_4055.JPG" imageanchor="1"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiCRKF19nUv4oSlSzjRLe1WpfDrq0AIEu5T8fAtZVczEyunElJnOyseB2jSCgXwphihipwYc6PSGb9i2CGTAPH9zwYI_bOGL6PSb21lLsCaqa3vyvhp0mYF13XvXB3fNU5pgZm/s1600/IMG_4057.JPG" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiCRKF19nUv4oSlSzjRLe1WpfDrq0AIEu5T8fAtZVczEyunElJnOyseB2jSCgXwphihipwYc6PSGb9i2CGTAPH9zwYI_bOGL6PSb21lLsCaqa3vyvhp0mYF13XvXB3fNU5pgZm/s320/IMG_4057.JPG" style="cursor: move;" width="320" /></a><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKp_ZSKSdbLkZY_T-2kdAn1_o8L6KW-9lTNyr3akMvbcMhLTc2kfoh_ZIcPOi_5qb8cTFkwxSmwcnBnIHj8QUPpnTybh7ebcy-1YiXxXQKNoPWrIffAUl5o4ABPmpTyp3Q0L2H/s320/IMG_4055.JPG" width="320" /><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQ0JECdERZDL2EjiYPO5FNGxC-rk93xhsBlR7YEPVtu_xnFjxxxn6PzdDERSrCwnxA3eJop-OvB8TucyBlUWFDWOzj39vquH6LqTeTDj7okPUoTfqHZxXJ2QQVooxoxDauc3Pf/s1600/IMG_4059.JPG" imageanchor="1"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_GF5duhRneBNAsQ7vbXeEvX_vwr84CBAUdKikV8Rtr-iCjEDDtziU7NW8OGsu8F5x34OAeoiqZ1kjfzBD9iHgS8Ro8APZx9JPhrM6T5jnNs95U7TB2tnorcl7NFpuU0rUw8Ik/s1600/IMG_4052.JPG" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_GF5duhRneBNAsQ7vbXeEvX_vwr84CBAUdKikV8Rtr-iCjEDDtziU7NW8OGsu8F5x34OAeoiqZ1kjfzBD9iHgS8Ro8APZx9JPhrM6T5jnNs95U7TB2tnorcl7NFpuU0rUw8Ik/s320/IMG_4052.JPG" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGfOxeu2D_KtoAB9grUpwm_8tV1hhGNgSXl8ywpDTLuy5oNKIzIBZhxqhLzfPueGSu1U879H9PcSWy_GwBwQ5mkPI0_H4Zck4H_KaGDUBlnDJzkTpCz7QGL2LH-8EOh8V_4ik6/s1600/IMG_4059.JPG" imageanchor="1"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGfOxeu2D_KtoAB9grUpwm_8tV1hhGNgSXl8ywpDTLuy5oNKIzIBZhxqhLzfPueGSu1U879H9PcSWy_GwBwQ5mkPI0_H4Zck4H_KaGDUBlnDJzkTpCz7QGL2LH-8EOh8V_4ik6/s320/IMG_4059.JPG" width="320" /></a><br />
<br />
<b>Connections:</b><br />
<div>
Blue wire to the power socket center terminal (module Vout)<br />
Green wire to the power socket center terminal (module Vin)<br />
Black wire to switched negative terminal (module GND)<br />
<br />
Installing the new module was simple, requiring only unplugging the existing wires from the socket and connecting those wires to the module. So we unplugged the wire from the existing socket center bullet terminal and connected this to the module GND wire. Then we connected the body/chassis wire from the power module to the tab on the light socket (electrically connected to the chassis positive ground via the metal dash). Finally the output voltage wire (boosted to 18V) of the power module was connect the lighter socket center terminal.<br />
<br />
After inserting the connectors, the wires were bundled and zip-tied to the firewall. The install only took a couple of minutes. The interior appears stock other than a plastic socket cover that indicates that it is actually a 12V outlet.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvWJOepOk8Xe7PEkY1CdzabylKy0yltr_kNQfNtBzgc_eYGslkzLTGwd6WJXxPB35iIBueS9bOddz6QVg2MJby-ZbM27W-UuQolaOcILZLsVFWrVzqchj7zjyQrNPmpyhVeKVK/s1600/Installed+Module.jpg" imageanchor="1"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvWJOepOk8Xe7PEkY1CdzabylKy0yltr_kNQfNtBzgc_eYGslkzLTGwd6WJXxPB35iIBueS9bOddz6QVg2MJby-ZbM27W-UuQolaOcILZLsVFWrVzqchj7zjyQrNPmpyhVeKVK/s640/Installed+Module.jpg" width="520" /></a><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg78QieGUQDG6AmdHAAorpysMO53tgjA4OqAGyWptwYxUpSNG8QQoYAwH5gftpRdLiSdbVyO4OQ0zz5KNs9yx1O4suhFMKqYxS6GS2lABiqjPz1xZXYtbhvC_K0YPoihpQ-vcxI/s1600/IMG_1272.JPG" imageanchor="1"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg78QieGUQDG6AmdHAAorpysMO53tgjA4OqAGyWptwYxUpSNG8QQoYAwH5gftpRdLiSdbVyO4OQ0zz5KNs9yx1O4suhFMKqYxS6GS2lABiqjPz1xZXYtbhvC_K0YPoihpQ-vcxI/s640/IMG_1272.JPG" width="640" /></a><br />
<br />
The voltage of a conventional 12V automotive system actually vary over a wide range. Wikipedia says that "Equipment intended to be powered by the receptacle needs to account for intermittent contact, and voltages outside the nominal 12V DC, such as maximum voltage 9–16V continuously. To function in this environment, 12V automotive accessories are designed to operate over a wide range of input voltages. For example, the Amazon top selling <a href="https://www.amazon.com/SCOSCHE-USBC242M-Charger-Devices-Retail-Packaging-Black/dp/B00E1UWA4O/ref=as_sl_pc_tf_til?tag=fet0d-20&linkCode=w00&linkId=803a07634244891cb2ee5919c65198bd&creativeASIN=B00E1UWA4O" target="_blank">Schoche reVolt dual USB car charger</a> specifies an input voltage range of 10 to 16 volts.<br />
<br />
I measured the output voltage under different engine conditions to get a feel for the range produced by the boost converter on the Studebaker. At key on with the engine not running the socket put out 12.75V. The voltage varies once the engine is running though because the generator output varies with engine speed. The voltage varies because the socket output is actually 18V - generator output voltage. The socket voltage output dipped as low as 11 volts at some engine speeds. The module could be modified to produce a stable voltage difference of 12V but this appears to be unnecessary for the vast majority of applications.<br />
<br />
<b>Update</b><br />
<b><br /></b>
Sam upgraded the install with a matching cigarette lighter plug and socket. He removed the heating coil to keep it from being able to make electrical contact with the power socket voltage.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirlVcR9TmwPzHMKivhKGZidLbvZL0o3C4LN0cJ-90VgKRNpEYqNUKtzK5NWdeE9rC69IaIX-vRd8f4GL2P6xMGzqU5ZpmzqF_CkZx2SUhcperHihL772Z43e3da9JrwCYNLOdV/s1600/2017-06-09+17.49.14.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1600" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirlVcR9TmwPzHMKivhKGZidLbvZL0o3C4LN0cJ-90VgKRNpEYqNUKtzK5NWdeE9rC69IaIX-vRd8f4GL2P6xMGzqU5ZpmzqF_CkZx2SUhcperHihL772Z43e3da9JrwCYNLOdV/s400/2017-06-09+17.49.14.jpg" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The new lighter plug gives the dash a factory look while retaining the ability to power modern 12V electrical accessories. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZGYNGgUUTBP2XSUDkyxTeLLwLlUtERCvTOyxNoNI8gBr2pb2e0jNlYDHLxYEPA9sxytTwvrtybeiMHGCoTIZ11oxN1n9vOK-JXvJR17O4QlRArF4kg5krlyI6CSRkYbZg9JUH/s1600/2017-06-09+17.48.52.jpg" imageanchor="1" style="display: inline !important; margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" data-original-height="1200" data-original-width="1600" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZGYNGgUUTBP2XSUDkyxTeLLwLlUtERCvTOyxNoNI8gBr2pb2e0jNlYDHLxYEPA9sxytTwvrtybeiMHGCoTIZ11oxN1n9vOK-JXvJR17O4QlRArF4kg5krlyI6CSRkYbZg9JUH/s640/2017-06-09+17.48.52.jpg" width="640" /></a></div>
<br />
<b>Conclusion</b><br />
<br />
The module worked with every device tested and has been installed and working in the Studebaker for over four years now. If you want, it is simple to build your own 6V Positive Ground to 12V power socket converter.<br />
<br />
1 - Order the Pololu Module (<a href="https://www.pololu.com/product/2571" target="_blank">U3V50AHV</a>)<br />
2 - Adjust module to 18V<br />
3 - Add wires, terminals and insulate the module (tape or heat-shrink)<br />
4 - Install and enjoy!<br />
<br />
I was pleased with the look and performance of the project. I hope this approach can help you solve your own power system design problems!<br />
<br />
<br />
<br />
<br /></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com2tag:blogger.com,1999:blog-6265457.post-67009470763079580642017-02-22T14:34:00.004-05:002022-12-04T15:57:22.987-05:00Creating a Stencil from a Bitmap ImageI began searching online for a Minecraft stencil when my son 5th grade class had an assignment to create items they can sell in their school "market place" to earn money to donate to the Make a Wish Foundation. He wanted to use bleach to stencil tee-shirts with Minecraft artwork to sell to his friends at school. We purchased some shirts from the local variety store (Dollar Tree) and started testing.<br />
<div>
<br /></div>
<div>
We first tried cutting stencils using Freezer Paper and ironing that onto the shirt. Those worked for some shirts but the bleach had little impact on some colors. So back to the craft store for some fabric spray paint. The freezer paper stencils did not hold up well with fabric spray paint. The stencil wanted to peel off of the shirt, making some of the lines curved and or fuzzy.<br />
<br />
We needed a more substantial material to make a reusable stencil that would give us more detail and hold up better. I found some flexible thin plastic sheet that looks like a good candidate. This seemed like a great job for the laser cutter but I was not sure how to convert an image into a stencil. It took an an entire evening of working with a drawing program but I finally figured out a process that seems to work. Here are the steps I followed.</div>
<div>
<br /></div>
<div>
First, find a bitmap of the Minecraft item you want. A Google Image search led me to the image below. </div>
<div>
<br /></div>
<div>
<a href="http://orig14.deviantart.net/b95e/f/2012/180/e/0/minecraft_pickaxe__stone__by_satanssidekick-d55a486.png" target="_blank">http://orig14.deviantart.net/b95e/f/2012/180/e/0/minecraft_pickaxe__stone__by_satanssidekick-d55a486.png</a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufxmaGQfOEyyobP-TYwYo1KOx0rQonAfLi-Yc081coenw2mZ6nuHbSXexqBLwWxHqCoP3grfjLMBBlr4MkkJmA3kiq9_j5wuyOxBxxlzlXL3LKpXL5kLG8jHgkleG-TTdLGAf/s1600/minecraft_pickaxe__stone__by_satanssidekick-d55a486.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgufxmaGQfOEyyobP-TYwYo1KOx0rQonAfLi-Yc081coenw2mZ6nuHbSXexqBLwWxHqCoP3grfjLMBBlr4MkkJmA3kiq9_j5wuyOxBxxlzlXL3LKpXL5kLG8jHgkleG-TTdLGAf/s400/minecraft_pickaxe__stone__by_satanssidekick-d55a486.png" width="400" /></a></div>
<div>
<br /></div>
<div>
Here is how that image appears in CorelDraw. I will leave all of objects selected to make it more clear when we shift between a bitmap and objects. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5EksrBkxW902X9FscbW0_Y55S4Y72JbZi7F_qxIgzmvlWYFag_SPBGtXOW79-k63WvUExMF7lRB8MyfBCAs7U41qbgt7Tb73IVbr3EYKBemlhUk5sIK0x_fYQsT1B3-FojYNV/s1600/Minecraft+Pickaxe+to+be+traced.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="391" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5EksrBkxW902X9FscbW0_Y55S4Y72JbZi7F_qxIgzmvlWYFag_SPBGtXOW79-k63WvUExMF7lRB8MyfBCAs7U41qbgt7Tb73IVbr3EYKBemlhUk5sIK0x_fYQsT1B3-FojYNV/s400/Minecraft+Pickaxe+to+be+traced.gif" width="400" /></a></div>
<div>
<br /></div>
<div>
Next use your favorite drawing program to auto-trace the image. For CorelDraw you can get good results using Trace: Outline for High Quality Image. Move the Detail slider all the way to the right to ensure you get all of the squares. Smoothing did not seem to matter and I used 0 (slider all the way to the left) for Corner Smoothness. If the tracing went well you will get a group of objects that looks similar to the original image. Note the new selection handles for the newly created objects.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEVKIulgKN0KmqeTflNVvF2XvUDKCPeoWFiquPyNB0hZSfO13KwPUq1Z27TWmhThXepJj7_r5MB7wr8Fc4w2vsbcswYHTBKD1Id1rWOEwOlpG7MWZVc6Uk3ZHc1JH5H7SFmnhE/s1600/Traced+Minecraft+Pickaxe.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEVKIulgKN0KmqeTflNVvF2XvUDKCPeoWFiquPyNB0hZSfO13KwPUq1Z27TWmhThXepJj7_r5MB7wr8Fc4w2vsbcswYHTBKD1Id1rWOEwOlpG7MWZVc6Uk3ZHc1JH5H7SFmnhE/s320/Traced+Minecraft+Pickaxe.gif" width="313" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Next select all of the traced objects and apply a black fill.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDkZhe1WoXGgZEUyT401mBLodPdKHNOzMaXPrGSEbAP9yy401BMLRVNRjqPgzuB1Sdvb_oYpjvEMDbosmH3GUyo8PVqDqYHWmMxlBlKXBSkpztVUMyKCDJupyXu2A3Uu01wmgY/s1600/Traced+Minecraft+Pickaxe+with+black+fill.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="315" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDkZhe1WoXGgZEUyT401mBLodPdKHNOzMaXPrGSEbAP9yy401BMLRVNRjqPgzuB1Sdvb_oYpjvEMDbosmH3GUyo8PVqDqYHWmMxlBlKXBSkpztVUMyKCDJupyXu2A3Uu01wmgY/s320/Traced+Minecraft+Pickaxe+with+black+fill.gif" width="320" /></a></div>
<div><br /></div><br />
Now change the Outline to 8.0 pt, solid line, in white.<br /><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwwGxVT4YXgMz0dr5FU9cw9gmGxpgvqX8bnvkcZhHVj_H-yrDDvz-x3iNAtDqB26wZrHoIdaJ1NxISMlnqVxibvySfYuGpGc3oEzd4VTVwaEG3TH7mN8eGCUYhuxaCvGMdP9gs/s1600/Traced+Minecraft+Pickaxe+with+black+fill+and+white+outline.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="387" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwwGxVT4YXgMz0dr5FU9cw9gmGxpgvqX8bnvkcZhHVj_H-yrDDvz-x3iNAtDqB26wZrHoIdaJ1NxISMlnqVxibvySfYuGpGc3oEzd4VTVwaEG3TH7mN8eGCUYhuxaCvGMdP9gs/s400/Traced+Minecraft+Pickaxe+with+black+fill+and+white+outline.gif" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
This looks like a stencil and can be used if you want to print it and cut by hand. I read that you can get great results if you print on card-stock and laminate the card-stock before cutting the pattern out with an Xacto knife. But I want to use a laser cutter so there are still a few steps left. </div>
<div>
<br /></div>
<div>
The laser cutter wants lines showing where the beam should cut. So we want lines that define the outline of the black boxes in the image above. But those black boxes are actually the fill inside the boxes defined by the 8.0 pt white rectangles. So we need to convert the fill of each square into it's own object without the white outline. </div>
<div>
<br /></div>
<div>
I suspect there are easier ways to convert the black fill to objects but I did it by converting the objects to a bitmap (150 dpi, Black and White, 1-bit) and then tracing the new bitmap. Below is the bitmap produced when you convert the objects to bitmap. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy2f3pSsCsiU10F7Bpu5S18DePVayiVz52kJKqMmIp8TO5s8KYg9nIHZIbefaTdj_U6fTGbVYhLP1OD6Xv3ZxmaigOBzZsnYny0G2Zowi5z4APzFOjqw5N7ZoPVhJSFwEKS4bg/s1600/Pickaxe+objects+converted+to+BW+bitmap.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy2f3pSsCsiU10F7Bpu5S18DePVayiVz52kJKqMmIp8TO5s8KYg9nIHZIbefaTdj_U6fTGbVYhLP1OD6Xv3ZxmaigOBzZsnYny0G2Zowi5z4APzFOjqw5N7ZoPVhJSFwEKS4bg/s400/Pickaxe+objects+converted+to+BW+bitmap.gif" width="395" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Next we Trace Outline for High Quality Art. Set the Detail slider full right, and both Smoothing and Corner smoothness full left. You should get a group of objects like shown below. Again notice the selection handles for the new objects created by tracing.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjeZX_3tm6JdjyF3gFlUhJmnyu4C_eRx0CitX7ucscMlUpIuD0zOe8hvLnuXbfHo8IF1K8sxzjl3ULydkInlvYXeJ3oRG8tW85gHHHsehIHKNsh6MVtzKEtyluZsQrAXaRsdm7/s1600/Pickaxe+objects+converted+to+BW+bitmap+and+traced+back+to+objects.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="393" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjeZX_3tm6JdjyF3gFlUhJmnyu4C_eRx0CitX7ucscMlUpIuD0zOe8hvLnuXbfHo8IF1K8sxzjl3ULydkInlvYXeJ3oRG8tW85gHHHsehIHKNsh6MVtzKEtyluZsQrAXaRsdm7/s400/Pickaxe+objects+converted+to+BW+bitmap+and+traced+back+to+objects.gif" width="400" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Finally, we select all of the objects and set the Outline to Hairline, solid black line, set the fill to none and adjust the size to match the desired stencil size. You are limited only by the cutting bed size of your laser cutter. Here is the pickaxe on a letter size sheet. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ai9ylnlzNcmy5Jz6eM36SeA4yNFIZlt6xvBO0-Jh2nVEPfhJ5QtKo7tdu6MAbU8Cd1KUDmKB870RoMG7ULNG6SO7hjAfXoWPyySY3ofJJrFnEDZIs75zpx2xs1EurpaAfirW/s1600/Minecraft+Picaxe+Final+Stencil.gif" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ai9ylnlzNcmy5Jz6eM36SeA4yNFIZlt6xvBO0-Jh2nVEPfhJ5QtKo7tdu6MAbU8Cd1KUDmKB870RoMG7ULNG6SO7hjAfXoWPyySY3ofJJrFnEDZIs75zpx2xs1EurpaAfirW/s640/Minecraft+Picaxe+Final+Stencil.gif" width="499" /></a></div>
<div><br /></div><div>
Finally save in the preferred file format for your laser cutter, I used DXF, and you should be ready to cut the stencil on your laser cutter.<br />
<br />
The laser will cut along the lines, giving you a stencil. Below are the stencils, and samples of the shirts the kids made. The green images are fabric paint, lighter images are bleach on black fabric.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOc8cGI_IDsFeGr2F0hAq8iWMdgDAZ_F3Ge3GfUGQ2WceVMQsSvgupS_MOEKslt7lj6Gyy8zA4qsp5CjJoj51j5UNEgSjMCHQ-ZQtsm6UyhF-eAt12X1RHgfb-3kNBAh7Zr-Zc/s1600/Pickaxe+Cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="536" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOc8cGI_IDsFeGr2F0hAq8iWMdgDAZ_F3Ge3GfUGQ2WceVMQsSvgupS_MOEKslt7lj6Gyy8zA4qsp5CjJoj51j5UNEgSjMCHQ-ZQtsm6UyhF-eAt12X1RHgfb-3kNBAh7Zr-Zc/s640/Pickaxe+Cropped.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br /></div>
<div>
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmFUytYLmi6y3tWyn8AJ1yc6GmmlROlQz2FvvAVZFgEV_j-No2p0IwJ2fps-6jMC-FhZrdHCRG1U-2y4C8-WDxQranNtYZKsjgmidZsIsoqf3UPT_WO5fOC-6s8EKaXaebaCud/s1600/Pickaxe+shirt.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmFUytYLmi6y3tWyn8AJ1yc6GmmlROlQz2FvvAVZFgEV_j-No2p0IwJ2fps-6jMC-FhZrdHCRG1U-2y4C8-WDxQranNtYZKsjgmidZsIsoqf3UPT_WO5fOC-6s8EKaXaebaCud/s640/Pickaxe+shirt.jpg" width="608" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhlbd_bkOArv8yTxOAISpfFvqt1Mzxc4wAZikMgbr7gGmOaUmUA5yQYhtBBKaOINm6vklWcpXx56ijf44RR8jxt0BV7UgSApt0vVEMsHZ7FfG4sPgomwj-yOvjQ09HN-q07rqO/s1600/Sword+Cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="633" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhlbd_bkOArv8yTxOAISpfFvqt1Mzxc4wAZikMgbr7gGmOaUmUA5yQYhtBBKaOINm6vklWcpXx56ijf44RR8jxt0BV7UgSApt0vVEMsHZ7FfG4sPgomwj-yOvjQ09HN-q07rqO/s640/Sword+Cropped.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGxXmy7t_jgDofPKzEx9xEQ_1Lr5U_quMnlrWBPr0WgW_Yb5fOCarVgXKkSSBCxplz2ae6RTW1RTcEN5l4819b6L0geOdNlTLd13R1vB0JIrwL1sF6FFl9Rp7j6U5uqU2S9Fuj/s1600/Sword+shirt.jpg" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="497" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGxXmy7t_jgDofPKzEx9xEQ_1Lr5U_quMnlrWBPr0WgW_Yb5fOCarVgXKkSSBCxplz2ae6RTW1RTcEN5l4819b6L0geOdNlTLd13R1vB0JIrwL1sF6FFl9Rp7j6U5uqU2S9Fuj/s640/Sword+shirt.jpg" width="640" /></a><br />
<div style="text-align: center;">
<br /></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfucUwONsrtkoSganx5SUPBWbDkN9O5Fm8RLQTmuFNo-FggmwJypPXudh8ut9_NLpvGpX047wc-ZQ0ksBOltD4vLG4WxaECTcw1k98xficOxO6HBRlk9pSSVTpqqiUfumcQS36/s1600/Creeper+Cropped.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="532" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfucUwONsrtkoSganx5SUPBWbDkN9O5Fm8RLQTmuFNo-FggmwJypPXudh8ut9_NLpvGpX047wc-ZQ0ksBOltD4vLG4WxaECTcw1k98xficOxO6HBRlk9pSSVTpqqiUfumcQS36/s640/Creeper+Cropped.jpg" width="640" /></a></div>
<br /></div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK44ynhBp3aL_e84MKhA0uzh3JTxsrg6ajsLvEen4kl0FIehAIey4x9BURRooo7TehQ3nrAAPGsKilHPpcHG4IMSytDxr-RS35WZU5ad227Yy41qzFpQj4dc0PxbWP0GEMEEPy/s1600/creeper+paint.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhK44ynhBp3aL_e84MKhA0uzh3JTxsrg6ajsLvEen4kl0FIehAIey4x9BURRooo7TehQ3nrAAPGsKilHPpcHG4IMSytDxr-RS35WZU5ad227Yy41qzFpQj4dc0PxbWP0GEMEEPy/s640/creeper+paint.jpg" width="640" /></a></div>
<div style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVXRF2zzEqSuoF11Dh0-8QsGAzOqd-vqmz9dNDt44ODzrU1DLbGOD-KdApxLP-_FOP-EOstifoM_Gmo-_XhnFF7cJCEO2noUN3hBceB-OlC7NeEiV0pZubnTry1AFP6vX43Pyt/s1600/creeper+bleach.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="457" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVXRF2zzEqSuoF11Dh0-8QsGAzOqd-vqmz9dNDt44ODzrU1DLbGOD-KdApxLP-_FOP-EOstifoM_Gmo-_XhnFF7cJCEO2noUN3hBceB-OlC7NeEiV0pZubnTry1AFP6vX43Pyt/s640/creeper+bleach.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
We were pleased with the results. I hope this workflow can help you create your own stencils!</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-4394170270345939972017-02-12T20:31:00.006-05:002021-03-06T12:17:26.086-05:00Charging LEGO EV3 and NXT FLL Robots with a USB CableDiagnosing the performance of a robot when programming missions for a <a href="http://www.firstinspires.org/robotics/fll" target="_blank"><i>FIRST </i>LEGO League</a> challenge is always interesting. You think about tire slippage, did the robot move too far before a turn or should it turn a little more? Another variable that can come into play is the charge level on your robot's battery.<br />
<br />
A robot's performance is most consistent when operated from the same battery charge level each run. Some recommend using batteries at 80% charge for the ultimate uniformity but this seems to difficult to achieve in regular use. The lowest effort way to ensure consistent state of charge for a robot battery is to always keep them charged. But swapping batteries or getting a robot back to an AC charger between FLL rounds is not always convenient. I wanted an easy way to charge a robot between rounds and came up with this USB charging cable that I will show you how to build. Spoiler alert, there is a surprise ending.<br />
<br />
<h4>
Charging LEGO Batteries</h4>
All LEGO robot batteries have internal charge circuits that control the charging current and voltage. The external power adapter only supplies power to the charging circuit inside the battery pack. The official LEGO charger is listed on their website as a 9V charger but is actually labeled as having a 10V output with a capacity of 700 mA. The LEGO batteries I tested appear to draw around 600 mA during charging when powered from a 10V source. I suspect the 1V higher output voltage and 100mA higher output capacity on the charger are engineering margins select by LEGO to ensure the batteries and chargers work even under worst case conditions.<br />
<br />
So we should shoot for providing 10V and should be able to supply around 700 mA. We can also calculate that the 600 mA current observed during charging we should be able to return about 600 mAh back to the robot in the one hour between rounds. And I would like to be able to power the charger using a USB battery pack.<br />
<br />
<h4>
Designing the Charger</h4>
<div>
So I need to find a way to convert a 5V from a USB battery pack to 10V for the LEGO battery pack. My go to source for prototyping with DC-DC converts is Pololu.com and their model #799 Adjustable Boost Regulator seems like a good match and is only $12. There is another Pololu boost converter, the <a href="https://www.pololu.com/product/2116" target="_blank">U3V12F9</a> that is cheaper, only $4 but leaves little performance margin. I will pay a little extra for some extra operating margin since this is a prototype. You should always prototype first for function and optimize later after validating your operating envelope. For comparison, the 799 has a 2 amp input switch rather than the cheaper unit's 1.4 amp input switch. </div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilgO2s9Qf587atCAZO58jdyZoAO-GmPIVIhd_zL5XOwhzIEN2bcyTOWrZEXRcYCv0KYW-KG172Ybl1jlIKbKwTBzzzzSztnOsS5-S-s5VM0VX3orB4gFiwyJVtIlmkUzWIhFVT/s1600/2017-01-28+15.30.31.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilgO2s9Qf587atCAZO58jdyZoAO-GmPIVIhd_zL5XOwhzIEN2bcyTOWrZEXRcYCv0KYW-KG172Ybl1jlIKbKwTBzzzzSztnOsS5-S-s5VM0VX3orB4gFiwyJVtIlmkUzWIhFVT/s400/2017-01-28+15.30.31.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Pololu Pololu Adjustable Boost Regulator 4-25V</span></td></tr>
</tbody></table>
<a href="https://www.pololu.com/product/799" target="_blank">https://www.pololu.com/product/799</a></div>
<div>
<br /></div>
<div>
The 799 needs a minimum input voltage of only 1.5V and has an output that can be adjusted from 4V to 25V. The device has a 2A input switch (which means it can only draw in 2 amps of current and your output current capacity will drop the more you boost the output voltage). The performance chart below has a line for a 5V input and 12V output that indicates a peak output of around 700 mA (the green line). We will be boosting to only 10V so we will have an even higher current limit. </div>
<div>
<br /></div>
<div>
<img src="https://a.pololu-files.com/picture/0J2853.1200.png?7a7622ccc995c0dfa978fdcba991dbc8" /></div>
<div>
<br /></div>
<div>
Looking at the chart, we can see the efficiency improves as the input voltage gets closer to the output voltage. For a boost from 5V to 10V we can estimate an efficiency of 85% and an estimated output current of (5V/10V) * 0.85 or 850 mA. We only need 600 mA or so giving us a nice engineering margin. </div>
<div>
<br /></div>
<div>
So now I only need the small DC jack that plugs into the battery pack and a USB cable that I can use to splice everything together. I grabbed one of the micro USB cables that seems to come with everything these days and used my digital calipers to measure the LEGO battery pack power jack. It turns out the DC adapter is a 1.35 x 3.5 mm plug. Below is the link for the part at Digikey, my favorite source for parts due to their great online search engine and amazing shipping speed. </div>
<div>
<a href="https://www.blogger.com/goog_407904151"></a><br />
<a href="https://www.blogger.com/goog_407904151"></a></div>
<div>
<a href="http://www.digikey.com/products/en?keywords=cp3-1003" target="_blank">http://www.digikey.com/products/en?keywords=cp3-1003</a></div>
<div>
<br /></div>
<h4>
The Build</h4>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: justify;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvMfGLOq2TJdKf4VdIWsNziUG_jtm1OQAyhpRO8l1bM8jn79iLeTau__yc1T4hq2MlsYgkgQaaqt5GMS5SvkXVM1q_o1mgO_VUKHq09rHA74DMouhZ96PZNmz2D0T2rhslOFIg/s1600/2017-01-28+18.25.26.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvMfGLOq2TJdKf4VdIWsNziUG_jtm1OQAyhpRO8l1bM8jn79iLeTau__yc1T4hq2MlsYgkgQaaqt5GMS5SvkXVM1q_o1mgO_VUKHq09rHA74DMouhZ96PZNmz2D0T2rhslOFIg/s400/2017-01-28+18.25.26.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: justify;"><span style="font-size: small;">Incoming +5V from USB on right, 10V leaving to the charge plug on the left. Note that the wires were doubled up going to the connector on the battery pack end. The wires were already there, might as well use them. </span></td></tr>
</tbody></table>
<div style="text-align: justify;">
<br /></div>
</div>
<div>
<br /></div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjerjqAaEzDRCu-aFHcRvsBqycv8jd47SabORIVH4g1Je4jxj1Svp8-l6J5Zvuqh4hlePo-JhnYghuA1-1FMwqqvG-_2X6MYKlGrXSzavBuFlfKAs6leMhePMqYfHmQ-AhUmTTJ/s1600/2017-01-28+16.22.14.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjerjqAaEzDRCu-aFHcRvsBqycv8jd47SabORIVH4g1Je4jxj1Svp8-l6J5Zvuqh4hlePo-JhnYghuA1-1FMwqqvG-_2X6MYKlGrXSzavBuFlfKAs6leMhePMqYfHmQ-AhUmTTJ/s400/2017-01-28+16.22.14.jpg" width="300" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">Battery connector soldered up ready for finishing. </span></td></tr>
</tbody></table>
After adjusting the output voltage and verify everything worked, I applied epoxy to the terminals before adding the terminal cover. The epoxy helps spread the cable stress to prevent cracking the solder joint. I learned to use epoxy via multiple repairs of laptop power cords over the years. With epoxy it is a one time job rather than every 18 months. </div>
<div>
<br /></div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgloVdZIB9OUTPZrq9pR1eROTOL_53uxjVvW1Tg4tRIBlWBwGbWA53QIQt9tfri0qEdnN-nhem3FiY-vLrv9tm-tjeCLN6WeuDKqNnqtnBRsVwMR-8w0viKC12KOKvk5TzZrOJ9/s1600/2017-01-28+22.25.07.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgloVdZIB9OUTPZrq9pR1eROTOL_53uxjVvW1Tg4tRIBlWBwGbWA53QIQt9tfri0qEdnN-nhem3FiY-vLrv9tm-tjeCLN6WeuDKqNnqtnBRsVwMR-8w0viKC12KOKvk5TzZrOJ9/s400/2017-01-28+22.25.07.jpg" width="300" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">The adapter draws 1.41 amps when charging the LEGO EV3 battery pack. </span></td></tr>
</tbody></table>
I used a <a href="https://smile.amazon.com/gp/product/B00NTU18KY/ref=oh_aui_search_detailpage?ie=UTF8&psc=1" target="_blank">PortaPow USB Power Monitor</a> to measure the current draw when charging a LEGO EV3 battery pack. Note that the current draw of 1.41 amps is under 1,500 mA which is the minimum current spec for a port meeting the USB dedicated charger port (DCP). Most tablet USB chargers can provide the current needed to power this charger.<br />
<br />
Measurements taken when charging the same battery pack at the same state of charge compared to the power draw from a bench top power supply indicate that the Pololu 799 boost-converter was around 84% efficient when charging the battery pack at 600 mA. This number is very close to our earlier estimated 85% efficient from the performance chart. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br /></div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAhyphenhyphenbPTJ1UxOepoD2QQcvVThRTT6ud80cu8VR-tlg3Fu3gP8cG3FsSQ8TEOryAqlLQ9V2GLcMZmwOuHGw3azBUpIriNPtHDoLbnd1hGb1RSDU19Pkhqqn2WBX58nhk0Kk8phor/s1600/2017-01-28+18.32.36.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAhyphenhyphenbPTJ1UxOepoD2QQcvVThRTT6ud80cu8VR-tlg3Fu3gP8cG3FsSQ8TEOryAqlLQ9V2GLcMZmwOuHGw3azBUpIriNPtHDoLbnd1hGb1RSDU19Pkhqqn2WBX58nhk0Kk8phor/s400/2017-01-28+18.32.36.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">I added black hot melt glue to insulate and provide strain relief for the module.</span></td></tr>
</tbody></table>
<br /></div>
<div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsa__Py8nWmHzAM9aYVsjQvXGri3a-_NPpYHEMfzSZST9_NzrK81awcf9s-cFTMtLZZYklF00bRdIlyilSbkxBjnjZJzkaG6Dj7V0khiI-8Lhs35h2BOBqppFAPPJ4YDVL_d2n/s1600/2017-01-28+18.37.43.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsa__Py8nWmHzAM9aYVsjQvXGri3a-_NPpYHEMfzSZST9_NzrK81awcf9s-cFTMtLZZYklF00bRdIlyilSbkxBjnjZJzkaG6Dj7V0khiI-8Lhs35h2BOBqppFAPPJ4YDVL_d2n/s400/2017-01-28+18.37.43.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">After adding black hot melt glue to the other side.</span></td></tr>
</tbody></table>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-piQcLCS__5UnApiQn73f2mQDemp-WUjI-T2hARhjWDcs8EDFIA3XrPZ_rWhVAf4g-LBZIpl3D-LBBB_3hW1OtefmlOA5MwrBhbd0w3Rq_EK2zXA28j-drV4iUTlH2VLuSYvw/s1600/2017-01-29+09.20.57.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-piQcLCS__5UnApiQn73f2mQDemp-WUjI-T2hARhjWDcs8EDFIA3XrPZ_rWhVAf4g-LBZIpl3D-LBBB_3hW1OtefmlOA5MwrBhbd0w3Rq_EK2zXA28j-drV4iUTlH2VLuSYvw/s400/2017-01-29+09.20.57.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small;">After trimming one side. </span></td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: left;">
I applied big globs of black hot-melt glue to the final assembly (after calibration and testing) to protect the electronics and provide strain-relief for the cables. I use a silicon mat under the device when applying the hot-glue and fold the mat over and press down on the just applied glue to get it to flatten out. I had a nice thick barrier after a few turns of applying to one side then the other. I trimmed the edge of the glue with a small hand-plane to flatten them. I did not get a photo of the module after trimming the second side. It was still not a work of art but it was well protected by the hot melt glue. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Other options include covering with <a href="https://smile.amazon.com/Sugru-Moldable-Glue-Black-Pack/dp/B007VXJM58/ref=sr_1_6?ie=UTF8&qid=1486761648&sr=8-6&keywords=sugru" target="_blank">Sugru</a> or epoxy or even some adhesive lined heat-shrink tubing. But you do need to protect the electronics and keep the cables from applying stress to the solder joints. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
</div>
<h4>
How Battery Capacity is Measured</h4>
The battery capacities mentioned here are milliamp hours (mAh). Generally a mAh rating tells you how much energy that battery can deliver to a load. So a 1400 mAh battery could deliver a current of around 140 milliamps for around 10 hours. The usable amount of charge in battery drops when you discharge them a higher currents do to internal losses. For example, the same 1400 mAh battery providing 1.4 amps (1400 milliamps) to a load would be expected to last less than an hour, probably less than 30 minutes.<br />
<br />
LEGO has two different battery chargers for use with NXT batteries. The older gray batteries (1400 mAh) use a charger with a larger tip that outputs 10V AC, while the newer white batteries (2100 mAh) use a smaller tip that outputs 10V DC. The EV3 uses a new battery (2050 mAh) that is compatible with the LEGO charger with the small tip and DC output. I am going to show you how to build a charge cable that will let you use a high-current (at least 1.4 amp capable) USB port to charge your LEGO battery that accepts a DC input.<br />
<div>
<br /></div>
<div>
Why would a USB charger cable be useful for a LEGO robot? A battery's output voltage dips when load draw current. The larger the load the greater the current drop (measuring the drop in terminal voltage can even be used to measure the load). The drop in voltage gets greater as the battery capacity drops during discharge and can cause undesirable robot behavior.<br />
<br />
You can start seeing odd behavior,when the battery is at a low state of charge and motor loads are applied. One reason is that motors typically have a moment of high current (and large voltage drop) right before the start to move. Under the right conditions, high load and battery that has only 1/3 of a charge left, the voltage can drop enough to change the motor's strength and response time. In some systems the voltage drop can also cause problems with the robot's controller and sensors. So anytime you see new problems or something that was working starts not working you should ask yourself if you are seeing performance issues due to low battery.<br />
<div>
</div>
<br />
This high current condition is described as the motor's Locked Rotor Current (because the rotating parts of the motor have not started turning). A general rule of thumb is that a motor's locked rotor current will be about 5 times its normal running current. The chart below has data for EV3 motors and shows that the Locked current for the motors is around 5 times the free run motor current.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAbFnF_NVoU3raHofTaCKe7fCL4eP94AF6YZqK7vYZIzzrEfK4Jwo0NJpSKG9pYd-JqPpIpIuc1uwd_T26K-T1woLI1OhP2Uon4QekdD-nK4jjIny0-Fm_2X3j9z-VFB-kj-a8/" style="margin-left: 1em; margin-right: 1em;"><img alt="" data-original-height="590" data-original-width="646" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjAbFnF_NVoU3raHofTaCKe7fCL4eP94AF6YZqK7vYZIzzrEfK4Jwo0NJpSKG9pYd-JqPpIpIuc1uwd_T26K-T1woLI1OhP2Uon4QekdD-nK4jjIny0-Fm_2X3j9z-VFB-kj-a8/w526-h480/image.png" width="526" /></a></div><br /><a href="https://www.dexterindustries.com/ev3-current-consumption-measurement/" target="_blank">https://www.dexterindustries.com/ev3-current-consumption-measurement/</a></div><div>
<br />The chart above helps us figure out if charging between rounds would be enough to top off the robot's battery. First we need to calculate a worst case value for the power consumed during a round. Looking at the chart, a fully charged battery would be around 8.2 volts so we will use the 8.2V column of data. We can round the 1 Motor, 100%, Locked current from 0.955 amp up to 1 amp. Since the EV3 has 4 motor ports, we multiply that current by 4 to get a maximum of 4 amps. The table lists a running EV3 with sensors as drawing 0.123 amps. Let's round that up to 0.2 amps. So we have a total worst case current draw of 4.2 amps during a match.<br />
<br />
An FLL performance run last 2.5 minutes, which is about 0.042 of an hour (2.5/60). So the energy used during the match is (2.5/60) hrs * 4.2 amps or around 0.176 amp hours or 176 milliamp hours (mAh). So to fully charge the battery we would need to be able to return 176 mAh of charge to the battery in the roughly one hour between rounds.<br />
<br />
The battery charges at around 600 mA and even subtracting our worst case 200 mA for power the EV3 between rounds, we should be able to charge the battery at 400mA. If you can charge the robot for 50 minutes, in theory you could return (50/60) * 400mA or 333 mAh which is close to twice our worst case drain of 176 mAh. So we should have plenty of time to top off the battery.<br />
<br />
Note that you will likely operate your robot at less than 100% charge because charging slows as the battery approaches full charged. But you will be operating in the upper ranges of the battery state of charge and should start each match at similar conditions.</div><div><br />
<h4>
Usage Notes</h4>
It has been handy to charge the robot from a USB port. I expect the actual impact on the robot's FLL performance is minimal. I expect you would get more benefit from cleaning the robots tires. It is also easy to toss the USB charging cable in the box with the robot and always have it. I never kept a charger in the box before. Once, early the morning of a scrimmage, I realized that we forgot to plug up the robot after our previous practice. So we charged the robot battery from a USB battery pack while the robot was boxed up in the trunk as we drove to the event.<br />
<br />
Often we use a USB battery pack with a display that shows the amount of charge on the battery (similar to below). Note you need to be sure to use only the 2 amp port with the USB charger adapter. The display let us measure how much charge the battery needed before reaching full. This raises another issue though.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA46RghAZD81uRoMwIfiHCm5GIC6KbqLKTbKnnTcp5i1A5f6paLVt2MFVlcyb9njqs0tN5sFvpU1NwD5mEAnWBXrzvtYppzd4rJQMj1shremjABVSV-E4y7qrrtHBt41JOFSVi/s1600/USB+Battery+pack.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="239" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjA46RghAZD81uRoMwIfiHCm5GIC6KbqLKTbKnnTcp5i1A5f6paLVt2MFVlcyb9njqs0tN5sFvpU1NwD5mEAnWBXrzvtYppzd4rJQMj1shremjABVSV-E4y7qrrtHBt41JOFSVi/s320/USB+Battery+pack.jpg" width="320" /></a></div>
<br />
<br />
<a href="https://smile.amazon.com/1byone-Portable-Charger-External-Smartphones/dp/B01BXMZGTS/ref=sr_1_1?ie=UTF8&qid=1485531230&sr=8-1&keywords=usb+battery+pack+display" target="_blank">https://smile.amazon.com/1byone-Portable-Charger-External-Smartphones/dp/B01BXMZGTS/ref=sr_1_1?ie=UTF8&qid=1485531230&sr=8-1&keywords=usb+battery+pack+display</a><br />
<br />
The problem with amp hours as a measure of battery capacity is that it neglects the battery voltage. The battery pack above lists a capacity of 6,000 mAh so you would think it could charge an EV3 battery pack (2050 mAr) around 3 times on a single charge. But the USB battery pack probably has a single 3.7V battery where the EV3 battery pack has two 3.7V batteries.<br />
<br />
In reality the battery pack has a 3000 mAh capacity at the same voltage as the battery pack. And the battery back is stepping the 3.7V internal battery up to 5V, our USB cable is stepping the 5V up to 10V and then the battery pack is stepping the 10V back down to the battery's charge voltage. In reality we could expect this pack to provide a little more that one full charge for a fully discharged EV3 battery pack, But using our very conservative estimate of charge used during a performance run, the pack could keep the EV3 battery pack fully charged through at least 4 performance runs (2050 mAh / 420 mAh).<br />
<br />
This is the reason that most larger battery packs are quoted in Watt Hours (or at least list the Watt Hours). Watt hours is just the amp hour rating multiplied by the voltage. So the 3.7V battery with 6000 mAh capacity is 22.2 Watt hours. And our 7.4V (nominal) EV3 battery pack is 15.2 Watt hours. Watt hours lets you accurately compare the energy storage capacity of battery packs with different voltages.<br />
<br />
Here is a nifty little tool that will let you measure the amount of energy put into the charging system. This is useful information with two caveats. First, the Amp-hours reported will be larger than the actual battery capacity due to the power loss in the USB-Boost conversion and in the charging circuit inside the LEGO battery pack. Second, the only time the battery needs a full charge, allowing you to get a measure of the actual capacity, is when the battery is fully discharged before you charge it. But if you use your battery down to when you start seeing issues with your robot, you can get a feel for the usable capacity of the battery. And you have a great way to compare two batteries when you are concerned that one might have an issue.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQIaDnUr1SHILHU1V6053mcs5TPjUpnCwzI47OHGTUsieppNRVmbJuRl0JcNVLJhcU5PRHCrZ6_WcDhlCd8G8UzDBnOIAAONRj8BCTW7_x_Qy7PnPN1CT3BFjFFtHwgSYB0M7R/s1600/USB+Charge+Monitor.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQIaDnUr1SHILHU1V6053mcs5TPjUpnCwzI47OHGTUsieppNRVmbJuRl0JcNVLJhcU5PRHCrZ6_WcDhlCd8G8UzDBnOIAAONRj8BCTW7_x_Qy7PnPN1CT3BFjFFtHwgSYB0M7R/s320/USB+Charge+Monitor.jpg" width="320" /></a></div>
<br />
<br />
<a href="https://smile.amazon.com/gp/product/B01D9Y6ZFW/ref=oh_aui_detailpage_o00_s02?ie=UTF8&psc=1" target="_blank">https://smile.amazon.com/gp/product/B01D9Y6ZFW/ref=oh_aui_detailpage_o00_s02?ie=UTF8&psc=1</a><br />
<br />
<h4>
</h4>
<h4>
Or Just Order One From Amazon for $12!</h4>
I contemplated ways to make it easier to build the chargers and started searching for USB voltage boost converters and cables with the correct plug. Eventually I found the item below at Amazon. For $12 you get a USB to power jack boost converter. Mine even came with an adapter that fit the LEGO battery pack. There are 9V and 12V version of the cable and both appeared to work equally well for charging the LEGO EV3 and NXT white battery packs. You can order extra <a href="https://smile.amazon.com/Converter-Conwork-Adapter-Connector-Chargers/dp/B01DRQFCH4/ref=sr_1_1?ie=UTF8&qid=1486761863&sr=8-1&keywords=1.35mm" target="_blank">1.35mm power jack adapters</a> just in case your converter does not include an one (or if you want to have a spare incase you lose one).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9CxcDG4X0RcbavJ_jWnki-Pn7XU8Cc-UnAouuTJ9mHNARvnjb9f5iwj7IeSNVu4fkMhAisg9-cJTJqM7lh4FlIYtUFZRaMBHNEHFIhT_3zveLZ8REw-b9DoR5wc_TIdHLCLpb/s1600/Charger+Adapter.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9CxcDG4X0RcbavJ_jWnki-Pn7XU8Cc-UnAouuTJ9mHNARvnjb9f5iwj7IeSNVu4fkMhAisg9-cJTJqM7lh4FlIYtUFZRaMBHNEHFIhT_3zveLZ8REw-b9DoR5wc_TIdHLCLpb/s320/Charger+Adapter.jpg" width="320" /></a></div>
<a href="https://smile.amazon.com/Converter-Conwork-Adapter-Connector-Chargers/dp/B01DRQFCH4/ref=sr_1_1?ie=UTF8&qid=1486761863&sr=8-1&keywords=1.35mm" target="_blank">https://smile.amazon.com/Converter-Conwork-Adapter-Connector-Chargers/dp/B01DRQFCH4/ref=sr_1_1?ie=UTF8&qid=1486761863&sr=8-1&keywords=1.35mm</a><br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSOSnIjNCxkPkH46wRO3KcQGQ75aptkmXfOQEZy0-E9f8MQLYdycs8d5hUt4qNQ7GD7MqtTIklBQVCTKF2hjcVY1JwDFDTHn_-4d-geTXbwHV9YkrDh02tzNDIN_6RV8BBQTGz/s1600/Amazon+Charger.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSOSnIjNCxkPkH46wRO3KcQGQ75aptkmXfOQEZy0-E9f8MQLYdycs8d5hUt4qNQ7GD7MqtTIklBQVCTKF2hjcVY1JwDFDTHn_-4d-geTXbwHV9YkrDh02tzNDIN_6RV8BBQTGz/s320/Amazon+Charger.jpg" width="320" /></a></div>
<br />
<br />
<a href="https://smile.amazon.com/gp/product/B01ID90K4A/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1" target="_blank">https://smile.amazon.com/gp/product/B01ID90K4A/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1</a><br />
<br />
I hope you find a USB charger a useful accessory to help keep your LEGO robot charged and ready for action!</div>
<div>
<br /></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com4tag:blogger.com,1999:blog-6265457.post-15731612345876037312017-02-10T14:19:00.002-05:002020-01-08T11:33:37.184-05:00FIRST LEGO League Jr. - Teaching Engineering to 2nd Graders<i>FIRST</i> LEGO League Jr is a non-competitive LEGO-based program for kids in kindergarten through 3rd grade. Each year a challenge topic is announced and the team comes up with an idea to address the topic problem. They then build a model with at least one simple machine to illustrate their proposed solution to the challenge and a poster to explain their solution. FLL Jr. is a great introduction to the <i>FIRST</i> organization, which provides a framework and programs to promote engineering concepts for kids of all ages.<br />
<a href="https://www.blogger.com/goog_144441808"><br /></a>
<a href="http://www.firstinspires.org/robotics/flljr" target="_blank">http://www.firstinspires.org/robotics/flljr</a><br />
<br />
I got started in FIRST when I mentored my son's FLL Jr. team at Triangle Math and Science Academy when he was in 1st and 2nd grade (2012-2014). My hope was that I could help the kids learn some engineering skills while designing and building with LEGOs. I knew very little about working with kids and leaned heavily on the program materials and local resources.<br />
<br />
<h4>
<i>
FIRST</i> LEGO League Jr. Season</h4>
My son's team's idea was a fire-fighting robot that could put out fires in areas too dangerous for human fire-fighters. They called their robot the LSV for Life Saving Vehicle and their team name was Fire Destroyers. Their model used a LEGO WeDo program running on a laptop to drive a motor attached to a geared turntable that would sweep the fire suppressant nozzle back and forth.<br />
<br />
At the end of the season, events are held where teams share their projects with other teams, exchange buttons and present their projects to judges. The FLL Jr. event may be a stand-alone event or may be paired with an FLL event where older kids compete. The judges at our event included Sam Last, FLL Head Ref for North Carolina, and Fiona Last-Powel, the FLL Head Project Judge for North Carolina. Below are some photos of our team's event.<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoC9i_5EY1tb5FHKmqqWMvt209boCIbQiGO2LQrIrlKHUv89Ds2q5KOo78y0WqRUo41LaQr52drBFifaepjH1apKDyJ6JdZcL3Cop32wbJha9TOY8gyACYcqITdh5SNT7HRLGT/s1600/_MG_0362+cropped.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoC9i_5EY1tb5FHKmqqWMvt209boCIbQiGO2LQrIrlKHUv89Ds2q5KOo78y0WqRUo41LaQr52drBFifaepjH1apKDyJ6JdZcL3Cop32wbJha9TOY8gyACYcqITdh5SNT7HRLGT/s400/_MG_0362+cropped.jpg" width="385" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><i>FIRST </i>LEGO League Jr. Poster and Model.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDwyIQF2V4EiPWRSd5k15AXNJ9uNzavQB7upK8yXBMeKQpLUc-VrvXYLH7T4mt_p-FXagE622080-29mwiIMdgmr2N_kogtYg_rmUdqTil40phFHP_2_4MNs12DYvdZ3HwfDjJ/s1600/_MG_0321.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="265" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDwyIQF2V4EiPWRSd5k15AXNJ9uNzavQB7upK8yXBMeKQpLUc-VrvXYLH7T4mt_p-FXagE622080-29mwiIMdgmr2N_kogtYg_rmUdqTil40phFHP_2_4MNs12DYvdZ3HwfDjJ/s400/_MG_0321.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">There always seem to be last minute program changes. </td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOZnqd4sWPwNDBi_SFzjfyGx-O6iM8j-Zr-iV4wEizg-EydWbwzFZbQWbPN5-q7lGsNjU48EzuqsN-0FJWXuhd7_qlN0OsW6Q9e7sgE3FFmZlFxuW5ySouycW6VTri51UCNesI/s1600/_MG_0319.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOZnqd4sWPwNDBi_SFzjfyGx-O6iM8j-Zr-iV4wEizg-EydWbwzFZbQWbPN5-q7lGsNjU48EzuqsN-0FJWXuhd7_qlN0OsW6Q9e7sgE3FFmZlFxuW5ySouycW6VTri51UCNesI/s400/_MG_0319.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Working out the last of the kinks in the flow programming!</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBaezObOAaVflCBWq-cqigHECwTHwruxNMBBcGsx2JWrSEjF16syj9oWMzL2aXUcYhDfxFHLR8Zp6mcVsMjz2V-hZY3JETjLpDrZ-LivIlHJ59SD1WY7Viyr0b0bfJKHjmXKMB/s1600/_MG_0345.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBaezObOAaVflCBWq-cqigHECwTHwruxNMBBcGsx2JWrSEjF16syj9oWMzL2aXUcYhDfxFHLR8Zp6mcVsMjz2V-hZY3JETjLpDrZ-LivIlHJ59SD1WY7Viyr0b0bfJKHjmXKMB/s400/_MG_0345.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Explaining their model to Sam Last, FLL Head Referee for NC.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiILgOkFCzx-VnxH0kOrE8XP972aCCT5zstCNEm1s4fT068jzZzuu6pH18-WUd4kz3civylpCM9SiYmM_lxpVEsIWCn87MNJs5FlwNKMmDOUOr4-aWQks9t3f12nI2Mtm1bN8HF/s1600/_MG_0401.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiILgOkFCzx-VnxH0kOrE8XP972aCCT5zstCNEm1s4fT068jzZzuu6pH18-WUd4kz3civylpCM9SiYmM_lxpVEsIWCn87MNJs5FlwNKMmDOUOr4-aWQks9t3f12nI2Mtm1bN8HF/s400/_MG_0401.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">In FLL Jr. everyone gets recognized for their effort.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6eo8Ss7qX69Yuym39cHpqlppvfvyRRZubAMD3KKZQdSnXHBTlzITcJ603jfl6GzUZDX_KdbLHMHFrwbIwbc-J7810H27PwE_WX0MoUq8dZVKK0O3GR6w6bKALmef_5m8uXO4b/s1600/_MG_0417.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6eo8Ss7qX69Yuym39cHpqlppvfvyRRZubAMD3KKZQdSnXHBTlzITcJ603jfl6GzUZDX_KdbLHMHFrwbIwbc-J7810H27PwE_WX0MoUq8dZVKK0O3GR6w6bKALmef_5m8uXO4b/s400/_MG_0417.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">And a run through the high-five line with Sam and Fiona and the other judges. </td></tr>
</tbody></table>
<br />
<h4>
What Can I Teach These Kids</h4>
<span style="font-family: "georgia" , "times new roman" , serif;">There were easy lessons at first, do not grab things from other people and take turns. I had them practice leading build projects following LEGO instructions and they quickly learned that they have to listen and help when someone else is in charge if they want people to listen to them when they are in charge, a huge lesson! And we did experiments to compare the strength of beams of LEGOs in tension and compression. But soon I felt like I was running out of ways to teach them skills that would useful in an engineering career. </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">It was a constant struggle to keep the 12 first and second graders on task (I had help from two other volunteers that allowed us to support three teams of 4 students each during the season). If you spend too much time with one group, the others were quickly building cars and trying to see which was faster. There were also frequent crashes from cafeteria tables when a car veered off track. </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">After our regular season had finished, near the end of our 2nd year I noticed that the kids were very excited when an older <i>FIRST</i> LEGO League </span><span style="font-family: "georgia" , "times new roman" , serif;">team demonstrated their competitive robot. And the team had the same excitement when we attended a local LEGO Sumobot competition that Spring. There was something about robots competing head to head that got the kids excited. But how can I do this with young kids without getting bogged down with robot controllers and programming?</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">A possible solution occurred to me when my son and I were playing with the LEGO Power Functions Kit. (This kit includes an Infrared Remote and IR receiver along with battery pack, motor, lights, switch, and accessories. It is great value at $30! </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;"><a href="https://www.blogger.com/goog_2063375835"><br /></a></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;"><a href="http://shop.lego.com/en-US/LEGO-Power-Functions-Motor-Set-8293" target="_blank">http://shop.lego.com/en-US/LEGO-Power-Functions-Motor-Set-8293</a> </span></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;">Note that you need to select the option to the right side of the page for "Shop". For some reason, you can't link straight to the product at the moment. </span></span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;">My son and I used the kit to build remote control cars at home and it dawned on me that if I added a second IR receiver and set both to the same channel I could use the remote to start two cars at the same time. Having a non-contact method to start multiple cars would allow us to have the kids race cars side-by-side to see which was faster. Drag racing! I bet the kids will love this!</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;"><a href="http://shop.lego.com/en-US/LEGO-Power-Functions-IR-Receiver-8884" target="_blank">http://shop.lego.com/en-US/LEGO-Power-Functions-IR-Receiver-8884</a></span></span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">So I pitched the idea of racing cars to the whole group (six 1st graders and six 2nd graders) and they wanted to start right then! </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<h4>
<span style="font-family: "georgia" , "times new roman" , serif;">Applied Engineering Lessons</span></h4>
<span style="font-family: "georgia" , "times new roman" , serif;">Having the kids design and build a car each week provides the opportunity to explain and explore many facets of engineering in terms the kids can understand and observe. </span><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Documenting Your Ideas</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Public Speaking and Presentations</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Collaboration and Persuasion</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Building and Deadlines</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Prototype Idea, Test the Design and Update the Design</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Feedback and Optimization</span><br />
<div>
<br /></div>
<span style="font-family: "georgia" , "times new roman" , serif;">We started the process by explaining that when you are working on an engineering team it is important not just to have a good idea but you must be able to communicate your idea to others in a way they can understand. So we began by passing out pencils and paper and asking every student to draw something about their idea for a car. After 20 minutes we asked each child to stand up in front of the group and tell us about their idea and answer questions from the group. </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><span class="" style="font-size: 10pt;"><br /></span></span>
<span style="font-family: "georgia" , "times new roman" , serif;">The rules of the presentations were simple, everyone's ideas are good, no one will criticize anyone else's idea or drawing and EVERYONE gets a round of applause after their 30-90 seconds of presentation. I was surprised how many of the outgoing (loud) kids were scared at the idea of sharing an idea with the group. It took some encouragement but everyone made it through the process of their first technical design presentation! And the oldest kids were in 2nd grade! This was awesome!</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">Next, we divided the kids into two groups and told them to discuss their car ideas, select the design features they like and build a car</span><span style="font-family: "georgia" , "times new roman" , serif;"> (we changed the mix of kids each week). The teams had 30 minutes to build a car that we would race between two tape stripes on the floor, a distance around 4 feet. Exact distance and time were not a factor since we wanted only an A vs B comparison of who reached the line first. It was fascinating watching the kids promote their ideas and debate with their teammates over the benefit of one design feature over another. Doubly so after a few weeks and they began to build a knowledge base from their previous efforts. </span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">As the deadline loomed (5-minute warning, 2-minute warning) the stress of delivering an engineering prototype started to show (teams with a complex design got frustrated). The first races were often won by the only team to bring a working car to the starting line! Amazing engineering lesson! Done beats not done every time!</span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">After the race, the teams got another 15 minutes to update their cars before racing again. The kids quickly learned that complex designs with lots of gears and multiple motors can be difficult to get working. Simple is better. Another great engineering lesson!</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span><span style="font-family: "georgia" , "times new roman" , serif;">In the following meetings, we repeated the process and changed the grouping of the kids. In those last few weeks of school, the kids had fun, experienced the thrill of competition and improved their building skills. They learned to build the cars not too tight or friction would slow them down, they learned about adjusting gear ratios to match wheel sizes and they compared direct motor drive, gears, and belt drives and practiced working under the pressure of a deadline. They learned the importance of working as part of a group and how to negotiate features and quickly accomplish goals. They were practicing agile prototyping!</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<br />
<h4>
<span style="font-family: "georgia" , "times new roman" , serif;">Conclusion and Recommendations</span></h4>
<span style="font-family: "georgia" , "times new roman" , serif;">The new drag racing program was a success. The kids embraced the challenge, improved their problem-solving skills and became considerate collaborators. T</span><span style="font-family: "georgia" , "times new roman" , serif;">hey quickly learned</span><span style="font-family: "georgia" , "times new roman" , serif;"> many engineering lessons that I didn't figure out until after I had an engineering degree.</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">A great idea does little good if you can't explain it to others. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">You need to be able to promote your idea to your team. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">You must work with your team even if your idea was not selected.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Finished beats not finished every time.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Simple is better than complex.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Loose is better than tight when it comes to speed.</span><br />
<div>
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span></div>
<span style="font-family: "georgia" , "times new roman" , serif;">I feel that changing the mix of kids each week and only competing within our group helped avoid an "Us versus Them" mentality and helped each student learn to work with their current team. This helped the students focus on the task at hand rather than worrying over rivalry with another school or another team within our larger group.</span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">We specifically disassembled cars after each meeting. The kids wanted to get attached to the cars and save them between meetings. But the goal was not to have the kids hold on to their creations but to help them learn and believe that they can and will build a great car again at the next meeting. Disassembly also avoided the issue of "ownership" when the teams were mixed again the following week. The point was to teach them to come up with ideas that they can prototype, evaluate and iterate. And their designs improved as they internalized the lessons learned. Real engineering!</span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">Teams of 3-4 may work better. We only had enough parts on hand to build two cars and limited time left in the school year so we worked with what we had and used larger groups. With enough battery packs, motors and IR kits you can support racing more cars at one time. </span><br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>
<span style="font-family: "georgia" , "times new roman" , serif;">There are plenty of untapped options for this framework. The cars could tow a box of books to teach the kids to design for torque rather than speed. Or use an inclined board and see which car can climb the steepest angle. Or tow a box of books up an incline. This could open up the discussion of gearing and using other LEGO motors. And a</span><span style="font-family: "georgia" , "times new roman" , serif;">dvanced options could include comparing motors for speed versus gearing and even motor datasheets for efficiency versus maximum power output.</span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;">I hope that some of the ideas here can help you get your kids excited about engineering!</span><br />
<br />
<span style="font-family: "georgia" , "times new roman" , serif;"><br /></span>Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-72524171502848494342017-02-07T21:58:00.000-05:002019-07-01T22:19:53.274-04:00LEGO EV3 Minimal Proportional Line FollowerThe LEGO EV3 is a great development platform for learning about sensors, feedback and control systems. The EV3 system allows us to build a working line following program using only 4 blocks. Here we will walk through how to build and understand this minimal proportional line follower.<br />
<br />
<h4>
A Line Follower Track</h4>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqp-u_xSlryVLQmowvX7ydspz3vDMkgmaXdKZWzv1QMwpMwzWZ58CxKyyiuFQEoG_FFhhnrZcrl_bw9st4Pn2Be7A5R9hg1WN5E5-X2-3JjtvTUeImLjLGr_YlGmWFI7TTdnq5/s1600/1basic.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="197" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqp-u_xSlryVLQmowvX7ydspz3vDMkgmaXdKZWzv1QMwpMwzWZ58CxKyyiuFQEoG_FFhhnrZcrl_bw9st4Pn2Be7A5R9hg1WN5E5-X2-3JjtvTUeImLjLGr_YlGmWFI7TTdnq5/s200/1basic.png" width="200" /></a>You will need some kind of track. There are several options. You can purchase a cardboard tri-fold board at Dollar Tree and make your own test track using electrical tape or a black marker. Or foam core, poster board or even cardboard. The link below has a pdf file of track parts that you can print and combine to make your own track. Print the tracks you want and tape them down.<br />
<br />
If you draw the line you need to make the lines wide. The width of the line determines how long the robot has to recover before losing the line. If the robot veers toward the line enough to reach the white on the other side the robot will not recover and will lose the line. Systems with multiple sensors can follow more narrow lines but that is an advanced topic.<br />
<br />
<a href="http://robotsquare.com/2012/11/28/line-following/">http://robotsquare.com/2012/11/28/line-following/</a><br />
<br />
<b><br /></b>
<b>The Robot</b><br />
<h4>
<span style="font-weight: normal;">To use the code as written below you will need a simple robot with motors on ports B & C and an EV3 Color Sensor (on port 3) with the Color Sensor mounted in front of the robot (centered) about 3/8" of an inch above the mat (6mm to 8mm). Hot tip, the Color Sensor height is great if you can just slide a LEGO beam between the sensor and the mat. Mounting the Color Sensor on the center-line of the robot makes the programming much more simple. Having the Color Sensor mounted off-center (closer to either the right or left side of the robot) means that turning left and turning right will not move the sensor by the same amount over the line. The imbalance between the effectiveness of left and right turns can be addressed in software but requires a different gain for left and right turns. Please mount your Color Sensor along the center-line of your robot to avoid this issue. </span></h4>
<div>
<span style="font-weight: normal;"><br /></span></div>
<h4>
<span style="font-weight: normal;">If you are using older NXT Light Sensors or NXT Color Sensors then shielding the bottom of the sensors from external light using LEGO bricks or beams can help but be sure to use dark colors, red and yellow LEGO are very reflective and often seen as white by the sensor. The EV3 Color Sensors have much better rejection of external light interference and rarely need extra shielding. </span></h4>
<div>
<span style="font-weight: normal;"><br /></span></div>
<h4>
<span style="font-weight: normal;">Calibrating your Color Sensor will make the process easier but there are notes on how to use the same program with an uncalibrated sensor. The link below has a great tutorial on how to calibrate the sensor.</span></h4>
<div>
<span style="font-weight: normal;"><a href="http://ev3lessons.com/translations/en-us/intermediate/Calibrate.pdf">http://ev3lessons.com/translations/en-us/intermediate/Calibrate.pdf</a></span></div>
<div>
</div>
<div>
<br /></div>
<h4>
Programming</h4>
In particular the EV3 development environment's Move Steering block makes it easy to separately control the power setting of the drive motors and the power distribution. That is we can set a the Power input to 25 and then use the Steering input to vary how that power is divided between the motors. With a Steering input of 0, each motor runs at 25. But with a Steering input of 100, the left motor receives full power (25) while the right motor receive no power (0), turning the robot to the right. And the opposite is true when the Steering input is set to -100.<br />
<br />
<h4>
What Does Proportional Mean?</h4>
A proportional control system measures the error (the difference between the system setpoint and the current state) in a system and then either increases or decreases the system output by enough to minimize the error. Proportional refers to the system's ability to make small changes for small errors and large changes to respond to large errors. This means the system response is proportional to the measured error.<br />
<br />
For this example, the error will be measured using a calibrated Color Sensor in Reflected Intensity Mode and the Move Steering block allows us to use this error to steer the robot to follow the line. A calibrated color sensor in reflected intensity mode will return 0 when over a wide black line and 100 when over a white portion of the board. When centered on the edge of wide black line the sensor should return 50. The program below shows how we can use the information from the sensor to control a robot's steering to create a proportional line follower.<br />
<h4>
<br />Minimal Proportional Line Follower</h4>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyflDeu3N-mcaNIOgcW21PXEj4nx2rXvcNdgtKQ-nti4MBdEhZI1LqiVCAfnpaQFPRyn_Y6GXdXz6qbtN0dSnzuUp0kHtl4qGXwl29vE7VaJv-KEHHu41pAOLxMJblyMNsIAyU/s1600/Minimal+Proportional+Line+Follower.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="221" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyflDeu3N-mcaNIOgcW21PXEj4nx2rXvcNdgtKQ-nti4MBdEhZI1LqiVCAfnpaQFPRyn_Y6GXdXz6qbtN0dSnzuUp0kHtl4qGXwl29vE7VaJv-KEHHu41pAOLxMJblyMNsIAyU/s640/Minimal+Proportional+Line+Follower.jpg" width="640" /></a></div>
<br />
Configure the Color Sensor for Measure -> Reflected Intensity. Set the Math Block to Subtract and type 50 for the value of "a". Set the Move Steering Block to ON and the Loop Block to Motor Rotations -> Rotations and Greater than (>) and set the limit to 10.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9GrXKNkqscWYAt09CjXYxYJhLoAcMppP0WWkNoIAi2Tjdyc26EJm6h-Y3XAohcULFKjZMaGXP5VPJi0lUPUFeS2l6z_OVJFZ1MhKzQ2Lo2Cwpqw45nY2Dga5uFBSYE44g0NWl/s1600/Color+Sensor+Setup.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="272" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9GrXKNkqscWYAt09CjXYxYJhLoAcMppP0WWkNoIAi2Tjdyc26EJm6h-Y3XAohcULFKjZMaGXP5VPJi0lUPUFeS2l6z_OVJFZ1MhKzQ2Lo2Cwpqw45nY2Dga5uFBSYE44g0NWl/s640/Color+Sensor+Setup.jpg" width="640" /></a><br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim2GEAwBP7cuPrxwzn9ZuykgEdX87aCnGhCas2D0QaICmoEcLuDN5mTMDbDR0W2dYupv4Hh5IwEvqtq41rbf0WxWQJqBQC_zOC9xwfqE6_4NqsFmmMUgwV916tSxbSWBrJxKrg/s1600/Configure+Math+Block.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="358" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim2GEAwBP7cuPrxwzn9ZuykgEdX87aCnGhCas2D0QaICmoEcLuDN5mTMDbDR0W2dYupv4Hh5IwEvqtq41rbf0WxWQJqBQC_zOC9xwfqE6_4NqsFmmMUgwV916tSxbSWBrJxKrg/s640/Configure+Math+Block.jpg" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWNyWQU9exwc8BoW-YfzSX3PMOxgKdvlvRbzDobUijpEP0GKA0bm7QO_T4zFFWnVrZx07ZVrDTW3h0Ac2OFvwausLt37IeHlVYMi-MbOx36L_vhCQRC1F3XD7_Lo3D__KMvh1C/s1600/Configure+Move+Steering+Block.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWNyWQU9exwc8BoW-YfzSX3PMOxgKdvlvRbzDobUijpEP0GKA0bm7QO_T4zFFWnVrZx07ZVrDTW3h0Ac2OFvwausLt37IeHlVYMi-MbOx36L_vhCQRC1F3XD7_Lo3D__KMvh1C/s640/Configure+Move+Steering+Block.jpg" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpGAcyOdMnugWHSPYvTUNUBNUu7ZC4MmpxARSnOQA3bWODyjIv28sgsLUHo1WYY8CosZ6awPrJrvkeOjGVeRxuL8aHZiM15PIlKa1ZuvJ1sRrzIz55-nlOqjTWtrhlaVVXXReq/s1600/Configure+Loop+Block.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="422" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpGAcyOdMnugWHSPYvTUNUBNUu7ZC4MmpxARSnOQA3bWODyjIv28sgsLUHo1WYY8CosZ6awPrJrvkeOjGVeRxuL8aHZiM15PIlKa1ZuvJ1sRrzIz55-nlOqjTWtrhlaVVXXReq/s640/Configure+Loop+Block.jpg" width="640" /></a></div>
<h4>
</h4>
<h4>
</h4>
<h4>
How it Works</h4>
First, the Color Sensor returns a number indicating the average brightness of the area illuminated by the internal LED (the sensor returns 0 for all black, 100 for all white and 50 if halfway between black and white). Then the Math Block takes our set point (50 when the Color Sensor is centered on the edge of the line) and subtracts the Color Sensor reading. The result of that calculation is the system Error. Next the Error is applied to set the Steering input of the Mover Steering block. We set the Power to 25 on the Move Steering block. Finally, the Loop block runs the from the time you start the program until the B motor has turned for more than 10 rotations.<br />
<br />
Some examples. We can see that when the Color Sensor is over the edge of the line, the measured value is 50. We calculate the Error with the Math Block, Error = Set Point (50) - Measured Value (50) = 0. So our Error is 0 and the Steering input is set to 0, telling the robot to drive straight and the robot stays on the edge of the line.<br />
<br />
If the Color Sensor drifts to the right, away from the black line toward the white background, the Color Sensor will return a higher number, for example 60. The Math Block calculates: Error = Setpoint(50) - Measured Value (60) = -10. So the Error is -10 and the Steering input is set to -10 or run the left motor 10 percent slower than the right motor, turning the robot left toward the black line. The opposite happens if the robot drifts left and the sensor is more over the black line and returns a lower number.<br />
<br />
Place your robot so that the light sensor is on the right edge of the black line. Then have your robot try to follow the line and see how it does. If the robot runs off of the line, turn the robot around and have it follow the line in the other direction (your robot may do better for left turns or right turns so give each a try). If your Color Sensor is mounted off-center the robot will need a different gain for turning left and turning right. That approach is called asymmetrical gain and is common in temperature control systems that may heat and cool at different rates. We will discuss using a Switch Block to apply asymmetrical gain at a later date.<br />
<br />
<h4>
Behind the Curtain</h4>
Note that we are using some shortcuts in this simple implementation. First we count on the Color Sensor being calibrated, allowing us to use 50 as our setpoint or target value. You can use the same program with an uncalibrated Color Sensor but you must look at the values returned from the sensor for all black and all white and select a target value halfway between those two values. We found an uncalibrated NXT sensor that returned 36 for white and 6 for black. So we would use a target value of 21 (halfway between 6 and 36).<br />
<br />
The program also never actually multiplies our Error by a gain. We just use the Error as is, so there was an implicit multiplication by a gain of one. This works because our expected Error range from the calibrated sensor is -50 to +50 which maps well into a Steering input for the Move Steering block. If you use an uncalibrated sensor you are likely to get a smaller range of numbers that does not map as well to Steering Angle. For our uncalibrated example the Error would range from -15 (21-36) to +15 (21-6). This Error range is much lower than that seen from our calibrated sensor and may not be enough change to steer the robot back on track. So you may need to a gain of 50/15 or around 3.3 to give the same steering feedback over the Error range as a calibrated sensor. This can be done by multiplying the output of the uncalibrated sensor by 3.3 using a Math Block.<br />
<br />
<h4>
Moving Forward (Advanced Exercises)</h4>
A good next step after you have the line follower working with a calibrated sensor is to reset your calibration and get the program to work with the uncalibrated sensor. You will need to select the mid-point between black and white for your target value and calculate a gain to scale your maximum and minimum reflected light values to 50 and -50 respectively. This is a great time to use your EV3's Port View to look at the sensor value when you move the sensor back and forth between the white board and the center of the black line. When you are finished remember to calibrate your sensor for future use.<br />
<br />
Next add a math multiply block (or select ADV on your error calculation block) to multiply your error by a gain and test the robot with lower and lower gain until the robot fails to follow the line. How did the robot behave? Now increase the gain until the robot fails to follow the line. How did the high gain failure look different from the low gain failure? Try different motor powers and adjust the gain. You may find that the robot moves more smoothly with different gains at different speeds.<br />
<br />
Try adding new features. How about lighting up the EV3 front panel in one color for a left turn and another color for a right turn? Or add an Ultrasonic Sensor pointing straight up and program the robot so you can move your hand closer to the top of the robot to make it drive faster. How about making the robot automatically drive faster when the error value is low (which means the robot is driving straight or almost straight).<br />
<br />
Or you could replace the Color Sensor with a Gyro Sensor in Angle Mode and create a robot that will drive straight, even if the wheels slip or gets nudged. Be sure to have the robot setting on the floor when you power up the robot to ensure the Gyro Sensor starts up with no drift (look at the Gyro Sensor in Port View and make sure the value is stable when the robot is setting still). If the Gyro Sensor is drifting you can un-plug and reconnect the sensor's cable or restart the EV3. The number for "a" in the Math Block following the sensor sets the heading. Modify the program to have the robot drive straight in the direction the robot is pointing when you start the program.<br />
<br />
I hope this has helped you understand how a proportional line follower works on the LEGO EV3 platform and how this simple approach can be used as a starting point for further exploration of using proportional control.<br />
<div>
<br /></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-87128736768040004642016-05-15T14:30:00.002-04:002016-05-15T21:06:40.415-04:00Diagnostics: But Everything is the Same, Almost.Here is how asking the right questions and looking for what changed can help you diagnosis a system issue.<br />
<br />
I had recently joined a company that designs and builds industrial test systems and their largest client had just outfitted a new test lab with 20 of our automated life-test systems (testing DeWalt power tools) when they called with an issue. The client was getting erratic data speed data during tool testing.<br />
<br />
The first step for us was to duplicate the problem. We pulled a development unit back into the test area and tried to match the customer set up but could not duplicate the issue. Back on the phone with the customer to ask if anything had changed since they signed off on the design prior to the production build. The customer did finally mention that that they found a better price for rotary encoders for the test benches and had just standardized on the new model. So we asked them to send us one of the new encoders next-day air.<br />
<br />
We installed the new encoder and were able to duplicate the erratic speed data. Now we were getting somewhere! Next I put a scope probe (older analog Tek) on the signal. At first glance the encoder signals looked clean (looked at both A and B outputs but only monitoring one with the single counter/timer input) but a closer inspection showed an irregular narrow ghost of a 900-1200 mv glitch when the signal was in the Low state. I verified that the National Instruments data acquisition card's counter/timer channel had a TTL input and took a quick look at the TTL and CMOS voltage limits.<br />
<br />
<a href="http://en.wikipedia.org/wiki/Logic_level">http://en.wikipedia.org/wiki/Logic_level</a><br />
<table class="wikitable" style="background-color: #f9f9f9; border-collapse: collapse; border: 1px solid rgb(170, 170, 170); color: black; font-family: sans-serif; font-size: 14px; line-height: 22.4px; margin: 1em 0px;"><caption style="font-weight: bold;">Examples of binary logic levels</caption><tbody>
<tr><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em; text-align: center;">Technology</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em; text-align: center;">L voltage</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em; text-align: center;">H voltage</th><th style="background-color: #f2f2f2; border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em; text-align: center;">Notes</th></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a href="https://en.wikipedia.org/wiki/CMOS" style="background: none; color: #0b0080; text-decoration: none;" title="CMOS">CMOS</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">0 V to 1/3 V<sub style="font-size: 11.2px; line-height: 1;">DD</sub></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">2/3 V<sub style="font-size: 11.2px; line-height: 1;">DD</sub> to V<sub style="font-size: 11.2px; line-height: 1;">DD</sub></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">V<sub style="font-size: 11.2px; line-height: 1;">DD</sub> = <a class="mw-redirect" href="https://en.wikipedia.org/wiki/IC_power_supply_pin" style="background: none; color: #0b0080; text-decoration: none;" title="IC power supply pin">supply voltage</a></td></tr>
<tr><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;"><a class="mw-redirect" href="https://en.wikipedia.org/wiki/Transistor-transistor_logic" style="background: none; color: #0b0080; text-decoration: none;" title="Transistor-transistor logic">TTL</a></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">0 V to 0.8 V</td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">2 V to V<sub style="font-size: 11.2px; line-height: 1;">CC</sub></td><td style="border: 1px solid rgb(170, 170, 170); padding: 0.2em 0.4em;">V<sub style="font-size: 11.2px; line-height: 1;">CC</sub> = 5 V ±10%</td></tr>
</tbody></table>
<br />
I looks like the signal bounce is close to the voltage difference between a TTL low and TTL high and could be causing the problem. From looking at the chart we can see that changing to a CMOS input would increase the noise margin from 1.2V for TTL up to 1.5V for CMOS. The noise margin improvement might be enough to improve the speed readings but I needed a way to test the theory.<br />
<br />
Now how to get my hands on a CMOS buffer? A quick search of the parts bin turned up a box of CMOS Quad NAND chips. So I wired up two NAND gates as inverters and put them in series to give us a buffer that we can run from 5V that will duplicate the incoming TTL. I may have been able to use a single CMOS inverter but I was not sure if the system performed any duty cycle measurements so I wanted to keep the buffered output in-phase with the original encoder output. The signal coming from the NAND chip was clean and the rpm measurement glitch disappeared.<br />
<br />
Being an engineer by nature, I quickly design a small circuit board that could attach to the back of the tach connector on the test system and use the existing wiring to provide the additional signal conditioning needed to clean up the signal from the cheap encoders. I got a quote for 40 boards (pcbs are cheap, always order extras) to update the systems and called our client to share the results.<br />
<br />
In the end the customer elected to go back to their previous encoders in the new lab rather than implement a fix to make the cheaper encoders work. A good decision since the the cheaper encoders would have problems if installed on other units in their installed base of test systems.<br />
<br />
I hope this information can help you ask the right questions and find the clues you need during your next diagnostic adventure!<br />
<br />
<br />
<br />Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.comtag:blogger.com,1999:blog-6265457.post-70318353206396716682015-06-23T11:17:00.004-04:002015-06-23T21:05:20.048-04:00Prototype Friendly SMD Logic-Level MOSFETs<div style="color: #222222; font-family: arial, sans-serif; font-size: small;">
<h3>
<span style="background-color: white;">Surface Mount</span></h3>
<span style="background-color: white;">Recently I received several request for recommendations for good logic-level MOSFETs to use for prototyping. I hit the search engine at Digikey and looked for both N-FET and P-FET transistors in 8-SOIC packages without a thermal pad. This package is friendly to hand-soldering, allowing you to solder wires directly to the pins and mount it "dead-bug" style if needed for quick prototyping.</span><br />
<div>
<br /></div>
<div>
These transistor look like a good bang for the buck at a little over $1 each in quantity 10. </div>
<div>
<div>
<br /></div>
<div>
N-FET, 20V, 27A, Rds = 2.45 mOhm (Vgs=4.5V), $10.36 for 10.</div>
<div>
<a href="http://www.digikey.com/product-detail/en/IRF6201TRPBF/IRF6201TRPBFCT-ND/2354193" target="_blank">http://www.digikey.com/product-detail/en/IRF6201TRPBF/IRF6201TRPBFCT-ND/2354193</a></div>
<div>
<br /></div>
<div>
P-FET, 30V, 20A, Rds = 4.6mOhm (Vgs=10V), $10.91 for 10.</div>
<div>
<a href="http://www.digikey.com/product-detail/en/IRF9310PBF/IRF9310PBF-ND/2206034" target="_blank">http://www.digikey.com/product-detail/en/IRF9310PBF/IRF9310PBF-ND/2206034</a></div>
<div>
<br /></div>
<div>
These should have plenty of performance margin for applications of a few amps (watch your wire size and current rating). Once you get above a couple of amps your wiring and PCB layout become more critical but these devices can handle the current. A couple of details about these transistors. </div>
<div>
<br /></div>
<div>
The N-FET is a great part for low voltage systems with an Rds of 2.75 mOhms at Vgs=2.5V! So this would work well the Raspberry Pi's 3.3V logic (or your favorite low voltage microcontroller). But be sure to keep the gate voltage below the 12V limit (not a problem when you are driving it from a logic output).</div>
<div>
<br /></div>
<div>
The P-FET is a 30V part because the 20V parts had a maximum gate voltage rating of 12V which would necessitate a Zener diode to protect the gate if used for high-side switching in many "12V" systems. Many "12V" battery based applications operate at up to 14V and automotive "12V" inputs are usually specified up to 16V. This P-FET can tolerate a Vgs up to 20 volts so should be fine for high-side switching of "12V" circuits.</div>
<div>
<br /></div>
<div>
Remember to shop around for inventory and price if you are going to be placing a large order. I love the search engine at <a href="http://digikey.com/" target="_blank">Digikey.com</a> but they do not always have the best price on every part. My second stop when shopping for project parts is usually <a href="http://mouser.com/" target="_blank">Mouser.com</a>. I need more practice with the search engine at Mouser but I am getting better.<br />
<br />
<h3>
Through-Hole</h3>
Someone requested similar options for through-hole logic-level MOSFETs for use with breadboards so I went back to th<span style="background-color: white; font-size: 12.8000001907349px;">e Digikey search engine and found these parts.</span><br />
<span style="background-color: white; font-size: 12.8000001907349px;"><br /></span>
<span style="background-color: white; font-size: 12.8000001907349px;">This was the lowest Rds (100 mOhm at Fgs=5V) N-FET in a 4-pin DIP package ($1 for 1). At the rated 2.5 amps it would be dissipating 0.63 Watts which sounds like a challenge on a breadboard but feasible on a PCB with some extra copper for spreading the heat. </span><br />
<div style="background-color: white; font-size: 12.8000001907349px;">
<a href="http://www.digikey.com/product-detail/en/IRLD024PBF/IRLD024PBF-ND/812492" style="color: #1155cc;" target="_blank">http://www.digikey.com/<wbr></wbr>product-detail/en/IRLD024PBF/<wbr></wbr>IRLD024PBF-ND/812492</a></div>
<div style="background-color: white; font-size: 12.8000001907349px;">
<br /></div>
<div style="background-color: white; font-size: 12.8000001907349px;">
You can also use TO-220 or other SIP type packages on a breadboard. The Digikey search engine found this TO-251A 30V N-FET with an Rds of 3.2 mOhms at Vgs=4.5V, $0.81 for 1. The power dissipation should be very low until you have well exceeded the current carrying capacity of your breadboard (0.08W at 5 amps).</div>
<div style="background-color: white; font-size: 12.8000001907349px;">
<a href="http://www.digikey.com/product-detail/en/AOI510/785-1487-1-ND/3603498" style="color: #1155cc;" target="_blank">http://www.digikey.com/<wbr></wbr>product-detail/en/AOI510/785-<wbr></wbr>1487-1-ND/3603498</a></div>
<div style="background-color: white; font-size: 12.8000001907349px;">
<br /></div>
<div style="background-color: white; font-size: 12.8000001907349px;">
Super low Rds in through-hole P-FET is much tougher. They get pricey fast. This is the best bang for the buck P-FET I could find, -30V part, Rds = 10 mOhms at Vgs=-5V, $2.90 for 1. (0.25 Watts at 5 amps). </div>
<div style="background-color: white; font-size: 12.8000001907349px;">
<a href="http://www.digikey.com/product-detail/en/SUP53P06-20-E3/SUP53P06-20-E3-ND/2623103" style="color: #1155cc;" target="_blank">http://www.digikey.com/<wbr></wbr>product-detail/en/SUP53P06-20-<wbr></wbr>E3/SUP53P06-20-E3-ND/2623103</a></div>
<div style="background-color: white; font-size: 12.8000001907349px;">
<br /></div>
<div style="background-color: white; font-size: 12.8000001907349px;">
Generally at TO-220 can dissipate around 1W without a heat-sink in free-air without damage.</div>
</div>
<div style="background-color: white; font-size: 12.8000001907349px;">
<br /></div>
<div>
<br /></div>
<div>
I hope this information is helpful with your projects!</div>
<div>
<br /></div>
<div>
Shane</div>
</div>
</div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-53366753076176623942015-06-20T22:48:00.002-04:002015-06-20T22:49:26.645-04:00Sugru Good After 3 Years in the Freezer!<div class="separator" style="clear: both; text-align: center;">
</div>
I recently needed to repair an Apple 30-pin to Lighting adapter cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4lDHE6omS8Zioo-XKeH4TN5ad9pc_et83a3MyfbfOAEb-Mjr9njzYl5uCLSLNsilzLWXkOJo-GQAL_bpOnk6SO-TPrF7lbLhD4MyxrvUnCXkmd3OXibvOjZnCWW9N5jnIS1kq/s1600/IMG_1390.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4lDHE6omS8Zioo-XKeH4TN5ad9pc_et83a3MyfbfOAEb-Mjr9njzYl5uCLSLNsilzLWXkOJo-GQAL_bpOnk6SO-TPrF7lbLhD4MyxrvUnCXkmd3OXibvOjZnCWW9N5jnIS1kq/s320/IMG_1390.JPG" width="320" /></a></div>
I think the cable got caught in the seat-rail when I was adjusting my car seat. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9OOQJ8TYloo0vyUOFtb3Wgr9jHiGaz491q8kZ1dmMxd9qVC-I227gNH7obNnzLEReVcMTS63cdMJwI8SCAfoPsi9cQdDHAKKB8fYIAIBcjQ-Paj5PSZlVK29_JBJqf-dgAzy7/s1600/IMG_1391.JPG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9OOQJ8TYloo0vyUOFtb3Wgr9jHiGaz491q8kZ1dmMxd9qVC-I227gNH7obNnzLEReVcMTS63cdMJwI8SCAfoPsi9cQdDHAKKB8fYIAIBcjQ-Paj5PSZlVK29_JBJqf-dgAzy7/s320/IMG_1391.JPG" width="320" /></a></div>
<br />
<br />
As you can see it is pretty mangled.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSPzNWzGRbwZ7dMgwOHB_HiO3As3RreYyW_reNCiaCh6afqt2AuB57WE1lZcA0d40Xhasg843w9NPjxOMJioXP7Vh2fgFi9v1GkaVecNhP35s8qf0LzX9JeUggU_EdkupMHZvl/s1600/IMG_1409.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSPzNWzGRbwZ7dMgwOHB_HiO3As3RreYyW_reNCiaCh6afqt2AuB57WE1lZcA0d40Xhasg843w9NPjxOMJioXP7Vh2fgFi9v1GkaVecNhP35s8qf0LzX9JeUggU_EdkupMHZvl/s320/IMG_1409.JPG" width="320" /></a><a href="https://sugru.com/" target="_blank">Sugru </a>is my go to for cable repair. And I might have some in the freezer. I had a few packets left over from a pack a while back and I divided them between the refrigerator and freezer to see how long they would keep.<br />
<br />
I cannot recall when I tried the last refrigerator sample but it was a solid piece of rubber when I opened the packet. I found a packet of blue in the freezer!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVGZ26TZ8O5NiM-4PeRZiqgguqPoK-g8YQZAA3NQkqPW4783S8C-32YpExRaibVmL0IorEm5nu72QsXY9B5QMBs8pHnEObsUrc_FTJEHG9Pkp9LilbA0fpZwuGKhGbCaZxrROi/s1600/IMG_1408.JPG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVGZ26TZ8O5NiM-4PeRZiqgguqPoK-g8YQZAA3NQkqPW4783S8C-32YpExRaibVmL0IorEm5nu72QsXY9B5QMBs8pHnEObsUrc_FTJEHG9Pkp9LilbA0fpZwuGKhGbCaZxrROi/s320/IMG_1408.JPG" width="320" /></a></div>
And the use by date passed three years ago, July 9th, 2012. But what is the worst that could happen? So I decided to give the old Sugru a shot and tried to repair the damaged cable.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-taBMk7wMh62SJVFqhPJ-CZVhgCWvprfiRSG1PrsdvZ8cBPv-v9gcc1mz9S60dxkn8FdKUgEKHggfN9zNBqDGuHaiD18dZDFGm4dApGmtqkG29sZJsE8UBUHj6JyjRhg_MTHB/s1600/IMG_1399.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-taBMk7wMh62SJVFqhPJ-CZVhgCWvprfiRSG1PrsdvZ8cBPv-v9gcc1mz9S60dxkn8FdKUgEKHggfN9zNBqDGuHaiD18dZDFGm4dApGmtqkG29sZJsE8UBUHj6JyjRhg_MTHB/s320/IMG_1399.JPG" width="320" /></a></div>
The texture felt the same when I opened the packet and it seemed to work like new. The repair set up overnight and seemed fine. The repair isn't the prettiest, but I can't blame that on the Sugru.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd2WmXppAQUW2lHRbRtRbjKXzZ4zWv1K6IKwVC1V6LMbSGQ1xmae3F36-Fwulc2jXyKA5-ACAVrU5YBHobauqa0RlwMWYAWTbmL78m2eZzrbfq3tBq6ov_1W3Tha3xWHzI9DLl/s1600/IMG_1400.JPG" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjd2WmXppAQUW2lHRbRtRbjKXzZ4zWv1K6IKwVC1V6LMbSGQ1xmae3F36-Fwulc2jXyKA5-ACAVrU5YBHobauqa0RlwMWYAWTbmL78m2eZzrbfq3tBq6ov_1W3Tha3xWHzI9DLl/s320/IMG_1400.JPG" width="320" /></a></div>
So it looks like the freezer is the place to store your unopened Sugru!<br />
<br />
And if you live in the UK you have 16 more days to buy stock in the Sugru company via their <span id="goog_839534549"></span><a href="https://www.crowdcube.com/investment/sugru-19593" target="_blank">Equity Crowdfunding campaign<span id="goog_839534550"></span>! </a>Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com1tag:blogger.com,1999:blog-6265457.post-45307143872926027832015-06-16T22:03:00.005-04:002021-02-28T16:15:22.318-05:00Substitue Battery Charger for Generac Generator<br />
<div style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;">
</div>
<br />
<h3>
Generator Starter Battery Charger Problems </h3>
My wife's parents have a 15kW Generac generator, model 0046753, that has a problem keeping the starting battery charged. After charging the battery the weekly auto-start would work for a month or two and then fail to start. The unit has been serviced and tested and the battery replaced without resolving the issue. I wanted to see if I could figure out how to fix the problem.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBNsC-_2YnahRlB-WgB2forlNhLHgb8md6UD1nupBjm2ggadjzvHSPcCfWAB3kIoemRyKywiGf6VXAQf2i83sGzsPjB0fyvxWhvU-Ykok0EDjHmo9dKTkI5Z1FTGxYZxk2O3mU/s1600/Generator+Front.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="345" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBNsC-_2YnahRlB-WgB2forlNhLHgb8md6UD1nupBjm2ggadjzvHSPcCfWAB3kIoemRyKywiGf6VXAQf2i83sGzsPjB0fyvxWhvU-Ykok0EDjHmo9dKTkI5Z1FTGxYZxk2O3mU/s400/Generator+Front.jpg" width="400" /></a></div>
<br />
<br />
A quick Google search reveals that battery charger issues seem to be common with Generac generators (not to pick on Generac, this may be a common issue). I found a system schematic in the owner's manual and began studying the battery charger wiring.<div><br /></div><div><a href="https://www.generac.com/service-support/product-support-lookup/product-manuals?modelNo=0046753&lang=es-mx?lang=es-mx" target="_blank">Generac Generator page</a><br />
<br />
<a href="https://soa.generac.com/manuals/3981591/0F3983" target="_blank">Generac Owner's Manual</a><br />
<br />
It appears there are two configurations, both using a dedicated battery charging module. One configuration receives power via a pair of contactors that selects power from either a transformer when utility power is available or a dedicated BATTERY CHARGE WINDING when the generator is running. The other configuration has the battery charger labeled (UTILITY) which appears to indicate that the charger runs only from utility power and not while the generator is running<br />
<br />
Why would the generator not run the battery charger from the generator's output rather than adding a separate winding and a set of contactors? I found several posts that mention that the Generac battery charger does not charge while the generator is running, so utility only charging appears to be common.<br />
<br />
Replacement battery charger modules are available at prices starting round $120. Below is a link and photo of a charger module similar to the one in generator I was working on.<br />
<br />
<a href="http://www.partsfortechs.com/asapcart/index.php?main_page=popup_image&pID=594&zenid=e45c30487622665c2ae544073ec6cd8f" target="_blank">Replacement Generac battery charger module</a><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/proxy/AVvXsEjCdTSLi-jnSjfKoQ9MuKRPRaBKrWt6IvON1RlENIcniG5pfSiVTlf_BVWWr9pu4XsBayc13hin6t0HbyFdnv4-oEBe09ztvvwx4ANCwIfJKaEPnIcTZKOPaKiF3-OmcwxYiu3MPUpNuKhpiTyZaWCkk996v5OrXFP4F6X6V4MxgNV6lGDZJuODbuzbbPP2RgCCfws0h_6CDc1Ymgaz8oc=" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="0A18010SRV GENERAC BATTERY CHARGER A1801" border="0" height="251" src="https://www.partsfortechs.com/asapcart/bmz_cache/1/1e9bedc7bc3d473b6e6436d279c12a99.image.335x251.JPG" title="0A18010SRV GENERAC BATTERY CHARGER A1801" width="335" /></a></div>
It is not my intent to cast stones at another engineer's design, but the module looks a little kludgy with the mix of internal and external parts, most encapsulated but several not. I do understand that the orange overcurrent protection devices must be able to expand to function properly.<br />
<br />
Given the number of complaints I found online about Generac battery charging, I was reluctant to recommend another service call to replace the OEM charger module.<br />
<br />
I suspect the core issue is that designing battery chargers is not Generac's primary focus so the battery charger was not seen as a high engineering priority. Perhaps a battery charger designed by people who are in the business of designing and selling battery chargers might be more reliable in keeping the generator starter battery topped off and ready to go.<br />
<br />
<h3>
Charger Options. </h3>
I wanted a charger with a few specific features:<br />
- designed to be left connected to the battery <br />
- waterproof for outdoor mounting<br />
- can be powered by the generator<br />
- good brand reputation<br />
<br />
There are several chargers on the market designed for continuous charging of the battery during storage but the list narrows quickly once you focus on chargers that are designed for outdoor mounting. I ended up selecting the Battery Tender 800.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaA4UB1sd7Ej44suahQAdrC01RK8TR_dfhvC3fg2ypRT_lbVyBKanVHEvhzSALHY7nbcEEv89TeCV5x3mepH5F4QNMdcFULC9MajOw7vr6kssKc8t8b1xKP3NvCQX4mpjaI6VA/s1600/Charger+BT+800+CA.jpg" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="305" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaA4UB1sd7Ej44suahQAdrC01RK8TR_dfhvC3fg2ypRT_lbVyBKanVHEvhzSALHY7nbcEEv89TeCV5x3mepH5F4QNMdcFULC9MajOw7vr6kssKc8t8b1xKP3NvCQX4mpjaI6VA/s400/Charger+BT+800+CA.jpg" width="400" /></a></div>
<a href="http://smile.amazon.com/Battery-Tender-022-0150-DL-WH-800-Charger/dp/B000CITKCE/ref=sr_1_1?ie=UTF8&qid=1434387397&sr=8-1&keywords=battery+tender+800&pebp=1434387401346&perid=4F30680B0A9D4A2C84DD" target="_blank">Battery Tender 800, $40 at Amazon</a><br />
<br />
This unit is epoxy encapsulated with an IP67 rating (which means the unit is dust tight and can tolerate submersion in water to 1 meter). It is also highly rated on Amazon (most complaints were that warranty replacement requires $10 for processing and you pay shipping).<br />
<br />
The ability to operate on 240 VAC was a plus simply because it let me use convenient screw terminals for power attachment in the generator. Using a 120 VAC powered unit would require a large ring terminal to fit the larger Neutral terminal. The Battery Tender 800 has two mounting holes and comes with mounting screws (not used here but handy if you want to mount it in a convenient spot near your motorcycle, boat, lawnmower, et cetera). And at this price you can replace it 3 times before reaching the price of the OEM charger module.<br />
<br />
<a href="http://www.gen-tech.net/fullpanel/uploads/files/product-info-waterproof-800.pdf" target="_blank">Battery Tender 800 Owner's Manual</a><br />
<br />
<h3>
Danger, Will Robinson!</h3>
There are so many dangerous parts to a generator that it is hard to know where to start with warnings. You can get burned, mangled or just plain dead. You should not work on your generator unless you are confident you know what you are doing. Bet your life on it confident. Even then, it's not a good idea. Have a generator service technician install the battery charger for you. If you are so foolish as to proceed, here is what I did.<br />
<br />
Note that while I am an electrical engineer, I have little relevant experience with 240 VAC and generators and you should not think for a minute that I know what I am doing. I know that there must be a more elegant way to accomplish the task at hand. My overriding goal was not efficiency but rather not killing myself or blowing up something.<br />
<br />
First I went through the house shutting down sensitive electronics like the PC and TV's since I was going to turn off the power. Then I went to the generator and turned off the generator's breaker. Then I used the transfer switch to disconnect the utility power (the generator and house were now without power). Then I removed the top panel from the generator electronics board and removed the front panel of the generator to provide access to the battery bay.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_XUYSsndk_l9mgX5vZMI2PxXjT2LyKyDwzzpFq3_FUxPHYNh7Ki2WjQfaTEhiOM7E1WE-EK9L7RiuvG7o7nIUSrXSIuWyrf3pmxWX9pOn-XaAz3B4Nj_EbP63iUsMnSabqj7k/s1600/panel+with+N1+and+N2.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_XUYSsndk_l9mgX5vZMI2PxXjT2LyKyDwzzpFq3_FUxPHYNh7Ki2WjQfaTEhiOM7E1WE-EK9L7RiuvG7o7nIUSrXSIuWyrf3pmxWX9pOn-XaAz3B4Nj_EbP63iUsMnSabqj7k/s400/panel+with+N1+and+N2.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">240 VAC is available on terminals N1 and N1 near the bottom center of the photo. Note notch in top left of photo where I will route the power cable. The large terminal with the cable wrapped in white appears to be the NEUTRAL terminal.</td></tr>
</tbody></table>
<br />
Then I checked the battery voltage with my multi-meter and install the battery charger on the battery using the ring terminals. I placed the charger on top of the battery positioned so I could see the status LED.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3f2pArFzZYGwu2kaUuG3dvGFUhnIAeqbMuJNHdonTIZ3yImwexrzdPC2oEvYMIWvyXhj_6BhSA3NRhaEvUMqAZyHPY_RBDVwr47P7M42iKwZslTIReY9jT8m-9Va-zG9Rz_ju/s1600/charger+on+battery.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="266" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3f2pArFzZYGwu2kaUuG3dvGFUhnIAeqbMuJNHdonTIZ3yImwexrzdPC2oEvYMIWvyXhj_6BhSA3NRhaEvUMqAZyHPY_RBDVwr47P7M42iKwZslTIReY9jT8m-9Va-zG9Rz_ju/s400/charger+on+battery.jpg" width="400" /></a></div>
<br />
<br />
The 240 VAC input was available on screw terminals labeled N1 and N2. Next I cut the 120 VAC plug from the cord and crimped terminals on the wires. I could have used 120 VAC by connecting one terminal to N1 or N2 and the other to the NEUTRAL terminal (it looks like a large ring terminal would be needed). I could also have wired a short extension cord for 120 VAC and not removed the plug from the charger in case I needed to have it replaced under warranty. I will try that approach if I have to replace this charger.<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi87AhMlLUym17BHSxxCAjUj-kIXs8O3XvbwEqoGa74FMC2cmQE0ppgWV4VLegLVWfG2Xd7WoXvNVoEMHfwqp0vIHQvoyu4yCUrvJYMnCG_FTyVjpLCoB9YOcoB1-CC_aJ1U1Lv/s1600/Terminals.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="189" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi87AhMlLUym17BHSxxCAjUj-kIXs8O3XvbwEqoGa74FMC2cmQE0ppgWV4VLegLVWfG2Xd7WoXvNVoEMHfwqp0vIHQvoyu4yCUrvJYMnCG_FTyVjpLCoB9YOcoB1-CC_aJ1U1Lv/s200/Terminals.jpg" width="200" /></a></div>
<br />
Then I ran the power input lead to the back of the battery bay and through a vent at the left rear of bay. This brought the cable into the rightmost side of the engine bay where it can be routed up and into the back left corner of the electronics bay. There is a notch that allowed the electronics bay cover to be replaced without conflicting with the wire. Here is a blurry photo (how did I not see how blurry this was when I was taking the pictures).<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvftxSbvgD2KJVoYyCKVQu6cJG6D0kv8t-wujJ45ZBntdZaQFBeaZA_FvS2D_xRflt7LpHY1ZqKs2gymhV51PC7Mk6W6wXa_wLE7sbZZl5F5DwCBH74MVgVNfXSSXBxxqjzqMK/s1600/wire+rear+access.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="261" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvftxSbvgD2KJVoYyCKVQu6cJG6D0kv8t-wujJ45ZBntdZaQFBeaZA_FvS2D_xRflt7LpHY1ZqKs2gymhV51PC7Mk6W6wXa_wLE7sbZZl5F5DwCBH74MVgVNfXSSXBxxqjzqMK/s400/wire+rear+access.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I ran the charger cable to the back of the battery bay and through a small vent to the engine compartment and then up through a notch in the sheet metal to reach the electronics control area. It's the lamp cord looking cable just beneath the hinge.</td></tr>
</tbody></table>
<br />
I wanted to connect the battery charger power lead to terminals N1 and N2. First I carefully used my multi-meter and verified that there is no voltage on the terminals. Next I pretended the terminals still had lethal voltage levels and carefully placed one terminal at a time on the screw terminals (this meant two spade terminals on the terminal so I went slowly and made sure everything looked clean).<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZEuAzFOlUfohyphenhyphengKnYNWWWTaukh-idI7XGMWWee1F279pWia33LQzg4S0oFZ6YeBMDJrVwNqjotHuuwSWY_CCDrwaAvJSh40hsA9g77-J5FNvQCTFNw1advbqQ_mwJQpTbDQIK/s1600/_MG_9871.jpg" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZEuAzFOlUfohyphenhyphengKnYNWWWTaukh-idI7XGMWWee1F279pWia33LQzg4S0oFZ6YeBMDJrVwNqjotHuuwSWY_CCDrwaAvJSh40hsA9g77-J5FNvQCTFNw1advbqQ_mwJQpTbDQIK/s320/_MG_9871.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Charger terminals installed on N1 and N2.</td></tr>
</tbody></table>
Once the terminals were snug, I reversed the process, putting the cover back over the electronics bay (I kept the breaker off for the moment) and used the transfer switch to restore power to the house. Now I turned on the breaker on the generator and checked the status LED on the charger. The LED indicated the battery was being charged (yellow) but could have been green if the battery was already fully charged. I measured the battery voltage and verified that the voltage was increasing (if the LED indicates the battery is charging). Then I used the manual switch to start the generator.<br />
<br />
The generator started without a problem. Finally I turned off the generator, placed the red safety cover back over the battery positive terminal and replaced the front panel on the generator. The charger has been working well for 6 months.<br />
<br />
As of March, 2017, the generator battery charger has been working well for almost two years.<br />
<br />
<h3>
<span style="color: red;">Update 1</span></h3>
<i>The manufacturer has updated the design of the selected charger (for higher efficiency and 4-stage charging) and the input voltage range was reduced to 100 - 130 VAC. The new model has a red LED to indicate charging status and has a red and green battery icon to the left of the LED. The new models retain their awesome IP67 rating. Always verify the voltage range marked on the charger!</i><br />
<i><br /></i>
<i>The reduced operating voltage range means you must simply have your electrician or generator service technician connect one terminal of the charger's power cable to EITHER N1 or N2 and the other to the large NEUTRAL terminal (bolt with the cable wrapped in white tape).</i><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrma0pWNDNfxwK-hgR9OGyFoYg5QQKNh5mQQr9HRSCwTzCK_JwkHhssn5XbuGULlTZN2NVz4N2CFZfufmX9pN6v75cHHEg8Xs7pnztZBXVRlhAfiKiRlpqJ1CTt6E2WaEUFD-C/s1600/2e3240c3-d89d-468f-b4bb-0ae9a2667822.jpg._CB327434705_.jpg" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrma0pWNDNfxwK-hgR9OGyFoYg5QQKNh5mQQr9HRSCwTzCK_JwkHhssn5XbuGULlTZN2NVz4N2CFZfufmX9pN6v75cHHEg8Xs7pnztZBXVRlhAfiKiRlpqJ1CTt6E2WaEUFD-C/s320/2e3240c3-d89d-468f-b4bb-0ae9a2667822.jpg._CB327434705_.jpg" width="301" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em;"><tbody>
<tr><td class="tr-caption" style="font-size: 12.8px; text-align: center;"><i>New design with red LED and 100-130 VAC input voltage.</i></td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<i><br /></i>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZDDjUWgr_ileSuKWAjT92PXZoo9Lqd0uDhlj9WTgWq2WlfuijHooMmndYYX9GZKgZfa3hihNO04aEtBSy6U9wm_7FzZv92n-l46P39-w2tgbgzF6ClljyFvXRYv6DmRpCJ3yw/s1600/old+Battery+Tender+WP800.jpg" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><i><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZDDjUWgr_ileSuKWAjT92PXZoo9Lqd0uDhlj9WTgWq2WlfuijHooMmndYYX9GZKgZfa3hihNO04aEtBSy6U9wm_7FzZv92n-l46P39-w2tgbgzF6ClljyFvXRYv6DmRpCJ3yw/s200/old+Battery+Tender+WP800.jpg" width="200" /></i></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px; text-align: center;"><i style="font-size: medium; text-align: start;">Older design with a yellow LED and yellow and green battery<br /> icon to the left of the LED and 100-240 VAC input voltage.</i></td></tr>
</tbody></table>
<br /><div>
<h3>
<span style="color: red;">Update 2</span></h3>
</div>
<div>
<i>Following a thunderstorm, the generator failed the first weekly exercise with an OVER SPEED error on the control panel. The post below describes how I diagnosed and corrected the issue. </i></div>
<div>
<i><br /></i></div>
<div>
<a href="https://fettricks.blogspot.com/2019/07/repair-over-speed-error-on-generac-15.html">https://fettricks.blogspot.com/2019/07/repair-over-speed-error-on-generac-15.html</a></div>
</div>
<!-- Blogger automated replacement: "https://images-blogger-opensocial.googleusercontent.com/gadgets/proxy?url=http%3A%2F%2Fwww.partsfortechs.com%2Fasapcart%2Fbmz_cache%2F1%2F1e9bedc7bc3d473b6e6436d279c12a99.image.335x251.JPG&container=blogger&gadget=a&rewriteMime=image%2F*" with "https://blogger.googleusercontent.com/img/proxy/AVvXsEjCdTSLi-jnSjfKoQ9MuKRPRaBKrWt6IvON1RlENIcniG5pfSiVTlf_BVWWr9pu4XsBayc13hin6t0HbyFdnv4-oEBe09ztvvwx4ANCwIfJKaEPnIcTZKOPaKiF3-OmcwxYiu3MPUpNuKhpiTyZaWCkk996v5OrXFP4F6X6V4MxgNV6lGDZJuODbuzbbPP2RgCCfws0h_6CDc1Ymgaz8oc=" -->Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com51tag:blogger.com,1999:blog-6265457.post-2175473979505105952015-06-05T14:18:00.002-04:002019-08-27T23:04:10.164-04:00Bluemix, the Internet of Things and Node-RED<h2>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span><b><span style="font-family: "arial" , "helvetica" , sans-serif;">RTP Internet of Things Design Challenge</span></b></h2>
<div>
The Internet of Things (IoT) is all the rage these days. I have a basic understanding of the concept but wanted to learn more about the development of IoT devices. So I was excited when I heard about the <a href="http://cloudmobilechallenge.mybluemix.net/" target="_blank">RTP Internet of Things Design Challenge</a> because it seemed like a great way to learn about IBM's Bluemix cloud tools. The link below has information about the challenge (links for information about the sponsors are at the end of this article). </div>
<div>
<br /></div>
<div>
<div>
<a href="http://cloudmobilechallenge.mybluemix.net/" target="_blank">IoT Design Challenge</a> - <span style="background-color: white; font-family: "times new roman" , serif; font-size: 16px;">sponsored by The Research Triangle Park, IBM, TiE Carolinas, BKon.</span><br />
<span style="background-color: white; font-family: "times new roman" , serif; font-size: 16px;"><br /></span></div>
<div>
<h3>
<b><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">Kickoff </span></b></h3>
</div>
</div>
<div>
The first event in the Design Challenge provided an overview of IBM's Bluemix platform and how the IBM Internet of Things Foundation let's you interact with the real-world devices that make up the Internet of Things. Several hardware devices and services were demonstrated. The Bluemix platform has a free tier of service that allows you build entire IoT applications at no charge. But you do have to enter a credit card after you complete a 30 day free trail.</div>
<div>
<br /></div>
<div>
<a href="https://internetofthings.ibmcloud.com/" target="_blank">IBM Internet of Things Foundation</a></div>
<div>
<br /></div>
<div>
The IoT Foundation Service acts as the gateway for data flowing between the Bluemix cloud and your device. There are examples for several common devices (Arduino, Raspberry Pi, etc.) and instructions on how to set up a generic device if you are using another kind of device. The system also offers a device simulator that runs in a browser tab and sends information to the cloud like a real device.</div>
<div>
<br /></div>
<div>
<h3>
<b><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">Workshop </span></b></h3>
</div>
<div>
The second event was a workshop showing the nuts and bolts of how the devices communicate with the Bluemix cloud introduced <a href="http://nodered.org/" target="_blank">Node-RED</a> and how it is used to process and respond to the data coming form the devices. </div>
<div>
<br /></div>
<div>
Node-RED runs on Linux/OS X and allows drag-and-drop elements to provide processing functions without requiring text based programming. Node-RED lowers the barrier of entry to provide access to programming to people who come from non-programming backgrounds. Node-RED runs not only in the cloud but also directly on hardware platforms like the <a href="http://nodered.org/docs/hardware/raspberrypi.html" target="_blank">Raspberry Pi</a>.<br />
<br />
Node-RED opened with an example program (or flow) that received temperature from your device and sends a message to the debug tab of the IDE indicating if the temperature exceeds a preset threshold. This is basically the "Hello World!" of the Internet of Things, or should that be "Blink"?<br />
<br /></div>
<div>
This workshop is also where information was provided about project submission for the Challenge. They told us that you needed a team to submit and application for the challenge. I went to the event solo with the goal of just learning the tools, so I had no team and no project to implement. A few of us in the same situation coalesced after the session and joined efforts. Our team became "The Observers" as a tongue in cheek reference to our initial intend to just watch and not enter a project in the competition. </div>
<div>
<br /></div>
<div>
<h3>
<b><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">The Observers</span></b></h3>
</div>
<div>
Our team (LaVern Witherspoon, Gunes Yucel, Mike Liu and me) had a great range of backrounds. Interestingly there was very little overlap between our specific skills. LaVern (@LaVernOWithersp on Twitter) is a software engineer with experience in IP telephony, data networking, protocols and database applications for embedded platforms. Gunes (<a href="http://www.linkedin.com/in/gunesyucel/" style="background-color: white; color: #1155cc; font-family: arial, sans-serif; font-size: 12.8000001907349px;" target="_blank">www.linkedin.com/in/<wbr></wbr>gunesyucel/</a> on LinkedIn) is a cognitive neuroscientist with interest in UX research and mobile development. Mike is a software engineer and science researcher with a decade of experience in teaching, research and design. Which leaves me, the hardware and microcontroller guy. We had a great set of skills and tools at our disposal and looked forward to building... something.</div>
<div>
<br />
Finding a project to do was a little daunting. Staring at a blank canvas of unlimited possibilities is daunting. We finally settled on an actual real-word problem, an internet connected door lock control for the Raleigh MakerSpace that can be controlled from your smart-phone.<br />
<br />
<div style="line-height: 18.3999996185303px;">
</div>
<h4>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif; vertical-align: baseline; white-space: pre-wrap;"><b>The Challenge</b></span></span></h4>
<span style="background-color: white; vertical-align: baseline;"><span style="color: #222222; line-height: 18.3999996185303px; white-space: pre-wrap;">The p</span><span style="color: #222222; font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;">roblem to solve is how to provide convenient electronic lock control for members of the </span></span></span><a href="http://www.raleighmakerspace.com/" style="background-color: white; font-family: inherit; line-height: 1.15; white-space: pre-wrap;" target="_blank">Raleigh MakerSpace</a>. <span style="color: #222222; font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;">The Raleigh MakerSpace has a </span></span><span style="color: #222222;"><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">work-space</span></span><span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"> with a CNC milling machine and Laser Cutter that can be used by members on an as needed basis. The most convenient access is via an industrial overhead door with an electronic solenoid lock currently access via individual RF </span></span><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">key-fob</span><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"> transmitters.</span></span></span><br />
<div style="line-height: 18.3999996185303px;">
<span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"><br /></span></span></span></div>
</div>
<div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; vertical-align: baseline;"><span style="color: #222222; font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;">The current RF </span></span><span style="color: #222222;"><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">key-fob</span></span><span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"> approach has many limitations including, requiring a new fob for each member, the lock must be trained to recognize each fob, the lock supports a limited number of fobs requiring </span></span><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">operating</span><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"> the fob while lifting the door and extended operation of the fob can and has burned out the solenoid.</span></span></span></span></span><br />
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; vertical-align: baseline;"><span style="color: #222222;"><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"><br /></span></span></span></span></span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<h4>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
<span style="background-color: white; color: #222222; font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif; vertical-align: baseline; white-space: pre-wrap;"><b>The Solution</b></span></span></h4>
</div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span style="color: #222222;"><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">The proposed solution requires the inter-operation of three components, a smartphone to send an unlock request, a cloud service to receive and process the request and network connected hardware controller that can control the lock.
The rapid prototyping tools in Bluemix allowed us to quickly build a proof-of-concept solution that allows members to unlock the door using any smartphone that can send e-mail. This project was built by modifying existing IBM example flows in Node-RED and existing source code examples on the Arduino Yun.
A member can unlock the door by sending an e-mail containing their Access Code to a gmail address. A Node-RED flow on Bluemix monitors the incoming e-mail address for the presence of the Access Code. Once a valid Access Code is received, the Node-RED flow uses the IBM IoT Service to send a message to an Arduino Yun to unlock the door.
This solution is superior to the previous RF key fobs because new members do not need a RF key fob, only an Access Code. The lock does not need to be trained to recognize each RF Key-fob. Access is no longer limited by the number of RF key fobs that can be remembered by the lock. In addition, the new system allows the facility to disable a user’s Access Code without requiring keys or a key fob to be track down and returned.</span></span></div>
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; vertical-align: baseline;"><span style="color: #222222; font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"><br /></span></span></span></span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<h4>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
<span style="color: #222222; font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;"><span style="background-color: white; white-space: pre-wrap;">Results</span></span></span></h4>
</div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; vertical-align: baseline;"><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;">The final date of the event was </span></span><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">presentation</span><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;"> of the projects at The Frontier in RTP (a great facility with frequent events for local </span></span><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">entrepreneurs</span><span style="font-family: inherit;"><span style="line-height: 1.15; white-space: pre-wrap;">, check them out). </span></span></span><span style="color: #222222;"><span style="line-height: 18.3999996185303px; white-space: pre-wrap;">Below is photo of The Observers team holding our our check after we placed 2nd in the competition! </span></span></span><br />
<div style="line-height: 1.15;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span></div>
<div class="separator" style="clear: both; line-height: 1.15; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqD7l0ZRLyMQR0Ln0M7v-XXKxQu86Dc90EkEMHZnjaUQStPNTo55B0ztX8a-UiBRFtPi1KfOuAKCmjyhniE1rBmbyR3TUPjt9iJtqzuWTDSWruLEgGGBpA1aDlhhczY_VtE2FA/s1600/Bluemix+Observers+Team+edited.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqD7l0ZRLyMQR0Ln0M7v-XXKxQu86Dc90EkEMHZnjaUQStPNTo55B0ztX8a-UiBRFtPi1KfOuAKCmjyhniE1rBmbyR3TUPjt9iJtqzuWTDSWruLEgGGBpA1aDlhhczY_VtE2FA/s640/Bluemix+Observers+Team+edited.jpg" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="color: #222222; font-size: xx-small; line-height: 18.3999996185303px; white-space: pre-wrap;">I had a great time, thank you LaVern, Gunes and Mike!
I am the one rocking the Maker Faire North Carolina shirt.</span></td></tr>
</tbody></table>
<div style="line-height: 1.15;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; line-height: 18.3999996185303px; white-space: pre-wrap;"><br /></span>
</span><br />
<h4>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
<span style="background-color: white; color: #222222; line-height: 18.3999996185303px; white-space: pre-wrap;"><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">Lessons Learned</span></span></span></h4>
</div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">There were several factors that played a roll in our success. First, we focused on an existing problem that allowed us to narrow the scope of our effort. Although stalked by feature creep, we were diligent in dropping features if it became clear we were not going to be able to have it working to our satisfaction by the submission deadline. We focused on optimizing and explaining the benefits of the features we were able to implement. Finally, our presentation provided the information listed in the judging criteria in the order listed in the judging criteria. (This last one is like a secret super power. Do not surprise the people reviewing your project or proposal. Give them what they ask for in the order they specified. This makes it easier for them to like your product.)</span><br />
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">Preparation also paid off in our presentation. We presented 2nd and our demo did not work because we were unable to get our Arduino Yun connected to the guest WiFi. Fortunately our next slide was Risk Factors and the first risk listed was "Adding device to WiFi network". So we demonstrated to the judges (including two IBM Fellows!) that we understood the real-world risk factors involved in rolling out an IoT device and service. It turns out most of the team demos failed due to WiFi connection issues but few if any other teams list this as a risk factor.</span><br />
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">Given IBM's planned huge investment in the Internet of Things, it looks like Bluemix will be a player in shaping the future of IoT. I recommend checking out Bluemix and it's every growing roster of resources. I had a great time. Thank you to Research Triangle Park and the other event sponsors!Shane</span><br />
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; line-height: 18.3999996185303px; white-space: pre-wrap;"><br /></span>
</span><br />
<h4 style="line-height: 1.15;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
<span style="background-color: white; color: #222222; font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif; vertical-align: baseline; white-space: pre-wrap;">Files</span></span></h4>
<div style="line-height: 1.15;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;">Here are links to the slides from our presentation and the source code on GitHub.</span></span></span></div>
<div style="line-height: 1.15;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;"><a href="https://docs.google.com/presentation/d/1k2RvAAHSIoK3_8Hd12Y4tdCH8NHqE3_H3-ivEI0H5-4/pub?start=false&loop=false&delayms=5000" target="_blank">IBM IoT - Cloud Lock Presentation</a></span></span></span></div>
</div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; vertical-align: baseline; white-space: pre-wrap;"><a href="https://github.com/sdtrent/bluemixcloudlock" style="line-height: normal; white-space: normal;" target="_blank">https://github.com/sdtrent/bluemixcloudlock</a></span></span><br />
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; color: #222222; vertical-align: baseline; white-space: pre-wrap;"><span style="font-family: inherit;"><b><br /></b></span></span></span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="line-height: 1.15; margin-bottom: 0pt; margin-top: 0pt;">
<h3>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
<b><span style="font-family: "helvetica neue" , "arial" , "helvetica" , sans-serif;">RTP Internet of Things Design Challenge Sponsors</span></b></span></h3>
</div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div dir="ltr" style="margin-bottom: 0pt; margin-top: 0pt;">
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><span style="background-color: white; font-family: "times new roman" , serif; font-size: 16px; line-height: 1.15;"><a href="http://www.rtp.org/" target="_blank">The Research Triangle Park</a> - </span><span style="font-family: "times new roman" , serif;"><span style="line-height: 1.15;">a not for profit that is committed to supporting education, serving our partner universities, creating knowledge-based jobs across the state and improving the quality of life for all North </span><span style="line-height: 18.3999996185303px;">Carolinian's</span><span style="line-height: 1.15;">.</span></span></span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<br />
<div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><br /></span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
</span>
<div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69"><a href="https://console.ng.bluemix.net/?cm_mmc=IBMBlueMixMarketing-_-Redirect-_-Perm-_-ibmcom-bluemix" target="_blank">IBM</a> - Bluemix is an open-standards, cloud-based platform for building, managing, and running apps of all types, such as web, mobile, big data, and smart devices. </span></div>
<span id="docs-internal-guid-0fd04955-534b-2f0c-151a-682981dc6b69">
<div>
<br /></div>
<div>
<a href="https://carolinas.tie.org/" target="_blank">TiE Carolinas</a> - a not-for-profit organization with a mission to foster and support entrepreneurship in the Carolinas.</div>
<div>
<br /></div>
<div>
<a href="http://www.bkon.com/" target="_blank">BKON</a> - We make beacons and the software that makes them smarter.</div>
<div>
<br /></div>
<div>
<span style="background-color: white; color: #222222; font-family: "arial"; font-size: 13px; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
</span></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-19726432774148076372015-03-12T20:30:00.004-04:002022-11-02T15:53:43.920-04:00Adding a GUI to a PowerShell Script to Fix Folder Dates<br />
This is a follow up to my original <a href="http://fettricks.blogspot.com/2014/08/useful-folder-modification-dates-via.html" target="_blank">post </a>about building a single-line Windows PowerShell script to change folder modification dates (the Folder Modification Dates are updated to reflect the newest file in the folder). PowerShell is a scripting language for Windows that provides access to a wide range of system resources for automating and managing local and network resources. It is worth a quick read to get an overview of PowerShell.<br />
<br />
<a href="http://en.wikipedia.org/wiki/Windows_PowerShell" target="_blank">http://en.wikipedia.org/wiki/Windows_PowerShell</a><br />
<div>
<br /></div>
To my knowledge PowerShell is the <a href="http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/26/how-can-i-change-the-last-accessed-date-of-a-file-to-match-its-last-modified-date.aspx" target="_blank">only</a> way to to modify the LastWriteTime of a folder in Windows. It seems that other programming languages that implement this feature must do so with a call to a PowerShell object. So I thought, let's just do it in PowerShell to start with!<br />
<br />
The single-line script works but requires hard-coding the path to the directory to be processed and provides no feedback while the script is running. The single-line script also has a tiny hiccup with empty folders but we will talk more about that shortly. I want to make the script more friendly by providing a dialog box to select the folder to be processed and showing a progress bar while the folders are being processed.<br />
<br />
<h4>
<span face=""arial" , "helvetica" , sans-serif">PowerShell User Interface Elements</span></h4>
As always, my first stop was a search on Google. I started looking for ways to implement user interface elements in PowerShell. It took a few days of a couple of hours here and there to find what I wanted. Most dialog boxes have several options and much of my effort was just getting the correct options or buttons present (or hidden) in the user prompts.<br />
<br />
When searching for code examples I found that similar tasks were often approached in very different ways. I kept searching until I felt I was not seeing new approaches for a particular element. I then worked to select the code fragments that implemented the feature I wanted in the fewest steps or in the way that was easiest to understand. At times I removed features I did not want and only re-used the minimum code needed for my goals.<br />
<br />
I also used the O'Reilly book, "Windows PowerShell Pocket Reference" when implementing a couple of details and cleaning up my code. I avoided breaking lines to make the code easier to read. I feel that while distracting, long lines make the code easier to follow once opened in a window large enough to avoid wrapping the lines.<br />
<br />
<h4>
<span face=""arial" , "helvetica" , sans-serif">The Power of PowerShell</span></h4>
One of the most powerful aspects of PowerShell is the ability to use Get- cmdlets to generate a collection of objects that can be piped to another cmdlet, like Where-Object or ForEach-Object, for additional processing. These two combined with the recursion built into PowerShell with the -recurse switch provide an amazing level of flexibly.<br />
<br />
My goal was the most readable code, not the shortest or fastest. I intentionally avoided using shortcut names for the cmdlets in the strip to make it more clear what was being done.<br />
<br />
<h4>
<span face=""arial" , "helvetica" , sans-serif">The Result</span></h4>
The final version of the script prompts the user to select a folder to be processed and then asks you to verify the target folder before starting. Then a progress bar appears but does not respond for a few seconds to several (many?) seconds. (The delay is due to the initial recursion of the folder and sub-folders). I would like to make the progress bar responsive during the initial folder scan but could not find an easy way to show progress while doing the initial folder recursion. After the initial recursion we know how many folders need to be processed so we can easily reflect our progress.) Once all of the folders are processed a dialog box tells you how many folders were processed.<br />
<br />
<h4>
<span face=""arial" , "helvetica" , sans-serif">The Script</span></h4>
Here is a link to the project on <a href="https://github.com/sdtrent/SetFolderDates" target="_blank">GitHub</a>. Just grab the file FolderDateFixGUI.ps1 and run it from within the WindowPowerShell ISE. Adjust your <a href="http://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts" target="_blank">Execution Policy </a>if needed.<br />
<br />
<a href="https://github.com/sdtrent/SetFolderDates" target="_blank">SetFolderDates</a><br />
<br />
Below is a copy of the code for your browsing pleasure. But it looks ugly in the browser with the line breaks. It is much easier to read if you pull the file from GitHub and view in the PowerShell ISE or Notepad++.<br />
<div style="background: rgb(248, 248, 248); border-width: .1em .1em .1em .6em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre 110="" console="" line-height:="" lucida="" monaco="" monospace="" style="font-size: 9.75px;"><span style="color: #408080; font-style: italic;">
<code style="overflow-wrap: normal; word-wrap: normal;"></code><span style="color: #408080;">#Change Folder Modification Dates to the date of the newest file in each folder.</span>
<span style="color: #408080;">#To use this you must first run powershell.exe as admin and update the Execution Policy using the command below.</span>
<span style="color: #408080;">#> Set-ExecutionPolicy RemoteSigned</span>
<span style="color: #408080;">#Confirm that you want to make the change when prompted</span>
<span style="color: #408080;">#You can then run the script from the Windows PowerShell ISE</span>
<span style="color: #408080;">#Shane Trent, shanedtrent@gmail.com, fettricks.blogspot.com</span>
Clear <span style="color: #408080;">#clear console text</span>
<span style="color: #19177c;">$FolderNav</span> = <span style="color: green;">New-Object</span> -com Shell.Application <span style="color: #408080;"># Create application object to be used to display navigation box</span>
<span style="color: #19177c;">$BrowseFolderOptions</span> = 513 <span style="color: #408080;">#Options, &h200 (512, no New Folder Button) + &h1 (1, File system directories only)</span>
<span style="color: #19177c;">$folder</span> = <span style="color: #19177c;">$FolderNav</span>.BrowseForFolder(0, <span style="color: #ba2121;">"Select Folder for processing."</span>, <span style="color: #19177c;">$BrowseFolderOptions</span>, <span style="color: #ba2121;">""</span>) <span style="color: #408080;">#Display nav box and get folder to process</span>
<span style="color: green; font-weight: bold;">if</span> (<span style="color: #19177c;">$folder</span>.Self.Path) <span style="color: #408080;">#Proceed only if a folder was selected, exit if cancelled</span>
{
<span style="color: #19177c;">$ConfirmPath</span>=<span style="color: #880000;">[System.Windows.Forms.MessageBox]</span>::Show(<span style="color: #19177c;">$folder</span>.Self.Path,<span style="color: #ba2121;">"Confirm Folder to be processed."</span>,<span style="color: #880000;">[System.Windows.Forms.MessageBoxButtons]</span>::OKCancel)
<span style="color: green; font-weight: bold;">switch</span> (<span style="color: #19177c;">$ConfirmPath</span>) <span style="color: #408080;">#Have the user to confirm the path to the folder to be processed</span>
{
<span style="color: #ba2121;">"OK"</span>
{
<span style="color: green;">Write-Host</span> <span style="color: #ba2121;">"Folder Path Selected - "</span> <span style="color: #19177c;">$folder</span>.Self.Path <span style="color: #408080;">#Print the selected folder to the console</span>
<span style="color: green;">Set-Location</span> <span style="color: #19177c;">$folder</span>.Self.Path <span style="color: #408080;">#Set the path to the folder to be processed</span>
<span style="color: green;">Write-Progress</span> -Activity <span style="color: #ba2121;">"Scanning Folder..."</span> -Status <span style="color: #ba2121;">"Please wait."</span> <span style="color: #408080;">#Show static status bar before scanning the folder tree</span>
<span style="color: #19177c;">$FolderArray</span> = <span style="color: green;">Get-ChildItem</span> -recurse | <span style="color: green;">Where-Object</span> {<span style="color: #19177c;">$_</span>.PsIsContainer} <span style="color: #408080;">#Scan tree to generate an array of all folders</span>
<span style="color: green; font-weight: bold;">for</span> (<span style="color: #19177c;">$i</span>=0;> <span style="color: #19177c;">$i</span> <span style="color: #666666;">-lt</span> <span style="color: #19177c;">$FolderArray</span>.count; <span style="color: #19177c;">$i</span>++) <span style="color: #408080;">#Process each folder</span>
{
<span style="color: #19177c;">$NewestFile</span> = (<span style="color: #19177c;">$FolderArray</span>[<span style="color: #19177c;">$i</span>] | <span style="color: green;">Get-ChildItem</span> -recurse | <span style="color: green;">Where-Object</span> {!<span style="color: #19177c;">$_</span>.PsIsContainer} | <span style="color: green;">Sort-Object</span> LastWriteTime | <span style="color: green;">Select-Object</span> -last 1) <span style="color: #408080;"># Find newest file in the tree</span>
<span style="color: green; font-weight: bold;">if</span> (<span style="color: #19177c;">$NewestFile</span>) {<span style="color: #19177c;">$FolderArray</span>[<span style="color: #19177c;">$i</span>].LastWriteTime = <span style="color: #19177c;">$NewestFile</span>.LastWriteTime} <span style="color: #408080;">#If there is a file, update the folder date</span>
<span style="color: #19177c;">$d</span> = <span style="color: #880000;">[decimal]</span>::>round((<span style="color: #19177c;">$i</span> /<span style="color: #19177c;">$FolderArray</span>.count) * 100) <span style="color: #408080;">#Calculate the percentage of folders processed for bar and status text</span>
<span style="color: green;">Write-Progress</span> -Activity <span style="color: #ba2121;">"Processing.."</span> -PercentComplete <span style="color: #19177c;">$d</span> -CurrentOperation <span style="color: #ba2121;">"$d% complete"</span> -Status <span style="color: #ba2121;">"Please wait."</span> <span style="color: #408080;">#Update progress bar</span>
}
<span style="color: green;">Write-Host</span> <span style="color: #ba2121;">"Processing Completed."</span> <span style="color: #ba2121;">"Processed"</span> (<span style="color: #19177c;">$FolderArray</span>.count) <span style="color: #ba2121;">"folders!"</span> <span style="color: #408080;">#We are done, write stats to console</span>
<span style="color: green;">Write-Progress</span> <span style="color: #ba2121;">"Done"</span> <span style="color: #ba2121;">"Done"</span> -completed <span style="color: #408080;">#Close the progress bar</span>
<span style="color: #19177c;">$message</span> = (<span style="color: #19177c;">$FolderArray</span>.count) , <span style="color: #ba2121;">" Folders were processed."</span> <span style="color: #408080;">#Build message for final message box</span>
<span style="color: #880000;">[System.Windows.Forms.MessageBox]</span>::Show(<span style="color: #19177c;">$message</span> , <span style="color: #ba2121;">"Processing Completed!"</span>) <span style="color: #408080;">#Display message box with number of folders processed</span>
}
<span style="color: #ba2121;">"Cancel"</span>
{
<span style="color: green;">Write-Host</span> <span style="color: #ba2121;">"You cancelled the selected folder path"</span> <span style="color: #408080;">#We land here if the user cancelled the path confirmation message box </span>
}
}
}
<span style="color: green; font-weight: bold;">else</span> {<span style="color: green;">Write-Host</span> <span style="color: #ba2121;">"You cancelled the folder selection."</span>} <span style="color: #408080;">#And we land here if the user cancelled the folder navigation box</span></span></pre>
<h4>
</h4>
</div>
<h4>
<span face=""arial" , "helvetica" , sans-serif"><br /></span></h4>
<h4>
<span face=""arial" , "helvetica" , sans-serif">Testing</span> </h4>
The best, and safest, way to test the script is to make a test copy of your target folder (Projects, Photos, etc). I recommend making a backup copy anyway. Burn a copy to optical disk while you are thinking about it.<br />
<br />
Now open the new test folder that you just created and select detailed view and sort by date. On my Windows 7 system all of the just created files still have their correct original modification dates but the folders in the new copy will have the current date and time for the Date Modified field. So viewing the folders by date provides no useful information! But we can fix this!<br />
<br />
Now run the script from the PowerShell ISE and select the your new test folder as the target folder. After processing refresh your view of the folder and the folders should now be sorted by the date of the most recently modified file in each folder! This allows you to tell at a glance when you last worked on the project in each folder.<br />
<br />
<h4>
<span face=""arial" , "helvetica" , sans-serif">Walk Through</span></h4>
I decided to add a code walk-though to provide a little more detail on a few of the steps. I initally wanted to skip a walk through, it is very dull if you just want to use the script as is. And after working with PowerShell for a little while the code starts to seem self explanatory. But PowerShell can be a little confusing when you are getting started so I added this walk through.<br />
<br />
The first active line of the script on line 8 clears the console<br />
<br />
Next we create anew Shell.Application object that we will use to let the user select the folder.<br />
<br />
Then we set the folder options to show the desired options in the dialog box to select the folder. This was one of the harder items to get set just the way I wanted. For one thing, I did not want the user to be able to create a new folder.<br />
<br />
On line 11 the user select the target folder and the path to that folder is stored in $folder. The user may cancel the folder selection which would store a null in $folder.<br />
<br />
Now we are down to line 12 in the PowerShell ISE listing and we start doing some data checking. First we check $folder to see that the user did select a folder. If a folder was selected, we proceed to line 14. If the user canceled the folder selection we jump to line 41 and we are done.<br />
<br />
Next is line 14 where we present the user with a MessageBox with two buttons (OK and Cancel) and ask them to confirm the path to the target folder. I wanted to make sure we work on the correct folder! This line returns either "OK or "Cancel".<br />
<br />
Line 15 uses a Switch statement to see if the user confirmed the path, if so continue to line 19. If the user cancels the path we exit to line 35.<br />
<br />
On line 19 we write the path to the console just to leave a paper trail.<br />
<br />
Then we set the current working directory to the desired path with Set-Location.<br />
<br />
Line 21 sets up a progress bar with the desired text.<br />
<br />
We start the heavy lifting on line 22 with the Get-ChildItem -recurse that generates a list of every folder and file in the entire folder tree for the target folder. That list of files and folders is piped via the "|" to the cmdlet Where-Object {$.PsIsContainer} that returns only the objects that are containers (folders).<br />
<br />
The magic starts on line 23 where we set up a For loop to process each folder.<br />
<br />
On line 25 we start processing the folders one at a time. There is a lot going on in this line that allows us to find the newest file in the current folder. We start with the current folder, $FolderArray[$i] and do a recursive Get-ChildItem to get a list of all folders and files. The list of files and folders is filtered to exclude folders, leaving only files. The list of file is sorted from oldest to newest and finally the last object, the newest file is selected. So now $NewestFile is set equal to the the newest file.<br />
<br />
Line 26 addresses the one glitch from the single line script. If you recall, the single-line script worked with empty folders but would write an error to the console for each empty folder. The new script avoids this problem by checking first to see if a newest file exists in the folder! If there are no files in the folder then $NewestFile will be a null and the IF will be false. If $NewestFile is not a null, then we set the LastWriteTime of the current folder equal to the LastWriteTime of the $NewestFile.<br />
<br />
Line 27 calculates the percent of folders that we have finished processing.<br />
<br />
Line 28 updates the progress bar with our current percent completion. This is the end of the For loop so the we return to line 23 where the index is incremented and we process the next folder!<br />
<br />
We reach line 30 when we have processed all of the folders. Here we write a note to the console recording the number of folders processed.<br />
<br />
Line 31 updates and closes the progress bar.<br />
<br />
Line 32 builds a message box with the number of folders processed.<br />
<br />
Line 33 displays the message box and declares the processing complete!<br />
<br />
The remaining lines are reached only when the user has canceled the folder selection or canceled the specified folder path. Each writes a line to the console to indicate why processing was halted.<br />
<br />
<h4>
<span face=""arial" , "helvetica" , sans-serif">Wrap</span></h4>
I hope you find the script useful for processing folder dates or just seeing how to set some of the user interface options in PowerShell!<br />
<br />
Thanks for reading!<br />
<br />
Shane<br />
<div>
<br /></div>
<div>
</div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-89592025061386539662015-01-16T10:39:00.000-05:002015-01-16T10:39:00.637-05:00MacGyver Fix for Phone Charger Power!A few years ago I was driving a rental on a business trip and needed to charge my phone but the charger outlet had a blown fuse. It was late and I had little hope of finding a place to buy fuses. The moment brought to mind one of my favorite quotes.<br />
<div style="text-align: center;">
<i><span style="font-size: large;"><br /></span></i></div>
<div style="text-align: center;">
<i><span style="font-size: large;">'Do what you can, with what you have, where you are."</span></i></div>
<div style="text-align: center;">
<span style="font-size: large; font-style: italic;">- Theodore Roosevelt </span></div>
<br />
So in the spirit of Teddy Roosevelt, I found a place to park, surveyed my tools and went to work. The task was to find another source of 12V power that I could reach and use.<br />
<br />
I quickly targeted the dome light as a candidate, I knew there had to be a way to change the bulb so there had to be a way to pull it down and access the wiring. Once the light was down the challenge was figuring out how to connect to the harness without killing my charger or blowing the fuse for the dome light (and everything else on that circuit). Just one of the many reasons to keep a multimeter in your travel kit!<br />
<br />
Paperclips fit the harness connector and could be bent to connect to the charger but had two drawbacks. Guessing wrong on the polarity would kill my charger and if the paperclips touched, I would blow the fuse for the dome light. I realized that using chassis ground for my negative terminal would solve the polarity issue as well as separate my positive and negative power connections. Sometimes having at least one known reference point can make all the difference.<br />
<br />
As you can see from the photo, I used a hole in the metal frame to hang my Swiss Army Knife using the knife's scissors. I used another accessory on the knife to make the negative connection to the charger and support the charger. I was pleased with the my <a href="http://en.wikipedia.org/wiki/MacGyver" target="_blank">MacGyver</a> solution and the fix got me through the rest of my drive and left me with a full charge by the time I reached my destination.<br />
<br />
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSsawDAuGeZhlZwaiMdJNk7WxU3z2rNSblsMcVpsLFTaDXbqK7q5keD7pkDMGse3xWsYOmDi63YcUq8vzAPr0_FogRVZCrYChcsgzip4ENjCOeRCE8xwKCEkIpfbXUeNmH_stx/s1600/Charger+from+Paperclip+and+Swiss+Army+Knife.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSsawDAuGeZhlZwaiMdJNk7WxU3z2rNSblsMcVpsLFTaDXbqK7q5keD7pkDMGse3xWsYOmDi63YcUq8vzAPr0_FogRVZCrYChcsgzip4ENjCOeRCE8xwKCEkIpfbXUeNmH_stx/s1600/Charger+from+Paperclip+and+Swiss+Army+Knife.jpg" height="640" width="428" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Note the gravity assisted connection to chassis ground via the scissors.</td></tr>
</tbody></table>
<br />
<br />Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-38241403260578141042015-01-08T10:08:00.000-05:002015-01-08T10:49:36.080-05:00Build an "Invisible" Wii Sensor Bar for Your TV!What is the best way to use a Wii Sensor Bar with a wall mounted TV? We tried setting the factory sensor at the bottom of the TV but that left a long cable draping down the wall over to the electronics cabinet. We tried a battery powered sensor bar but it had to be turned on and off when you use it (and got a loud beeping when you forgot to turn it off) and had to be changed periodically or leave the charger plugged in (another cable).<br />
<br />
My solution is the "Invisible" Wii Sensor Bar that works well from the couch, turns on and off automatically with the TV and takes up no space under the TV. And by invisible, I mean it is hard to notice from more than a couple of feet away. If you can find a donor USB cable, you only need to add a few inexpensive parts from Radio Shack and do a little bit of soldering. You should be able to complete the project in a couple of hours or less once you have the parts.<br />
<br />
(1) USB cable, 1 m (almost any USB cable that will plug into a PC style port)<br />
(2) IR LED diodes<br />
(1) 33 ohm resistor<br />
<br />
The Wii Sensor Bar is equipped with Infra-Red (IR) Light-Emitting-Diodes (LED's) to allow the Wii remote to orient itself when you point the remote at the TV (with the sensor bar setting on or under the TV). The image below from Wikipedia shows the IR LED's in the Wii sensor bar as seen by an IR sensitive camera. You may be able to see IR LED's using the camera on your cellphone, try both the front facing and rear facing cameras. The Wii Sensor Bar's LED's provide reference points for the IR camera in the remote to determine the orientation of the Wii Remote. It turns out that Sensor Bar is a misleading name as the bar does not actually have any sensors. All of the sensors are actually in the Wii remote.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="http://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Nintendo_Wii_Sensor_Bar.jpg/798px-Nintendo_Wii_Sensor_Bar.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="File:Nintendo Wii Sensor Bar.jpg" border="0" src="http://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Nintendo_Wii_Sensor_Bar.jpg/798px-Nintendo_Wii_Sensor_Bar.jpg" height="68" width="400" /></a></div>
<br />
I tried a battery operated sensor bar but go tired of turning it on and off (there was a loud beeper if you forgot to turn it off) and recharging the battery. It also did not work well from our couch with is about 12 feet from the TV. (Note, do not plug your new DIY sensor bar cable into your TV until you verify the IR LED's light up using some kind of camera. This is covered under Testing below.)<br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Design</b></span><br />
Here is how we make the idea work. A quick web-search reveals that a standard low-power USB devices can draw up to 100mA without requiring any negotiation with the USB host. So to meet the USB spec, a TV's USB port must be able to supply 5V at a minimum of 100mA. So we can treat the TV's USB port as a 5V power supply that can put out 100mA to use to power our project! My next step was a trip to Radio Shack where I looked through the parts bin and found the High-output IR LED's below.<br />
<br />
Note that here are many IR LED's that will work well. I would look for 940nm output and avoid anything with a very narrow viewing angle. You set the current with the bias resistor so you can use LED's with higher maximum current but make sure your LED can work at the 100mA range used here or use a larger resistor to set a lower current.<br />
<br />
Infrared LED, High-Output, 5mm, (Vf = 1.2v, Imax = 100mA, 940nm, 45-degree)<br />
<a href="http://www.radioshack.com/product/index.jsp?productId=2062565">http://www.radioshack.com/product/index.jsp?productId=2062565</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDd46Hv8NAU4q9y9zIxaNWVVed8Sbayn-ILA9gbsmNiGcQR-IA3S7ZA05HDr_RG-mxRj5Nv48ulHDHjhaVvHHo9ik-D-CVf7LVW1tu6tazi90ra5txZAh07X84EMZP-UVVbRRc/s1600/LED+pack.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDd46Hv8NAU4q9y9zIxaNWVVed8Sbayn-ILA9gbsmNiGcQR-IA3S7ZA05HDr_RG-mxRj5Nv48ulHDHjhaVvHHo9ik-D-CVf7LVW1tu6tazi90ra5txZAh07X84EMZP-UVVbRRc/s320/LED+pack.jpg" height="320" width="187" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPApQuBVF2h0t9IvBh3JbH9pmX3UPDRGAv4m2OrorI_PUpjpY_eQ8vScWyzlfy1wy6y0dHfMO6LPZuEqkW9deuuAnk8F6rP6QkvPhr5iwGWmEeWQEYbgu7n2jzAkBLBjyiImw/s1600/LED+pack+back.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPApQuBVF2h0t9IvBh3JbH9pmX3UPDRGAv4m2OrorI_PUpjpY_eQ8vScWyzlfy1wy6y0dHfMO6LPZuEqkW9deuuAnk8F6rP6QkvPhr5iwGWmEeWQEYbgu7n2jzAkBLBjyiImw/s320/LED+pack+back.jpg" height="320" width="181" /></a></div>
<br />
<br />
The IR LED's require a forward voltage of 1.2V to turn them on and can handle up to 100 mA. This means I can connect two (for a left and right for the sensor bar) in series for a forward voltage of 2.4 volts. Note that the Wii remote looks for and reports back the 4 brightest spots (LED's) but I found 2 LED's worked fine in my setup. Now I just need to pick a bias resistor to limit the current. <br />
<br />
I want a safety margin versus the 100 mA current limit of both the LED's and the USB port. I picked 80 mA as a good starting point and used an LED resistor calculator to determine the best resistor value for the application. <a href="http://ledcalc.com/">http://ledcalc.com/</a><br />
<br />
<div style="text-align: right;">
</div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt9VCGVb5NlrIt_XkHMjoRg31uMLBYvS3LSA8qKGuxTI884N3GFyTVT77TaX-jkfZbLI_yYbs-rk222so5BEknE3Y8F2gyDGlf08hnb4MmRrmQxGPHpycZXhcoJF47jujh2D4h/s1600/LED+and+Resistor.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt9VCGVb5NlrIt_XkHMjoRg31uMLBYvS3LSA8qKGuxTI884N3GFyTVT77TaX-jkfZbLI_yYbs-rk222so5BEknE3Y8F2gyDGlf08hnb4MmRrmQxGPHpycZXhcoJF47jujh2D4h/s320/LED+and+Resistor.jpg" height="320" width="242" /></a>The calculation shows 33 ohms (producing 78.8 mA) is the closest standard value (and I picked up a pack at RadioShack,<span style="font-size: x-small;"> </span><a href="http://www.ittybittyurl.com/2AZx" target="_blank">http://www.ittybittyurl.com/2AZx</a>) as well as a nice diagram showing how the LED's will be connected. (I like to connect the bias resistor to the positive supply terminal to limit the short circuit current should any thing below the resistor accidentally short to ground.)<br />
<br />
The last part I need is a USB cable that I can plug into the TV and use to get power to the IR LED's. You could use almost any standard USB cable. If the cable is too short, you will simply need extra wire to reach the LED's. I had a very long USB cable from <a href="http://www.partsexpress.com/" target="_blank">PartsExpress</a> that fit the bill nicely.<br />
<br />
<b><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Build</span></b><br />
First, estimate how long the cable needs to be to reach the LED furthest from the USB port. You may need to search for images of the back of your TV to see where the USB port is located, I know I did. Next strip and prep the far end of the cable for soldering. <br />
<br />
I recommend making the black and red wires 3 to 4 inches long and connecting the LED here. I added solid copper extension wires (the green and yellow wires) to my LED's so I could bend the wire to aim them and have the solid wire hold the bend. After installing the finished cable I believe extension wires did not provide any benefit and can be omitted.<br />
<br />
You need extra length on the red and black wire to provide room for the heat-shrink tubing to be moved way from the LED terminals when they are soldered. Don't worry, you will know if you get this wrong. Just back up and repeat the soldering.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGORklN5UCQGlP1t1TH6OTi2b3oACKR-MksCJuGPGNwXCmsQwT8YBi8b8d2E1VG4s_NcrHqV9vcFN3B2GP6Kq4j2FeOBqhwPmY-YwcV0oDwdpT2r_c5TeiCZI8vwr1ko0PgqQI/s1600/IMG_3093.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGORklN5UCQGlP1t1TH6OTi2b3oACKR-MksCJuGPGNwXCmsQwT8YBi8b8d2E1VG4s_NcrHqV9vcFN3B2GP6Kq4j2FeOBqhwPmY-YwcV0oDwdpT2r_c5TeiCZI8vwr1ko0PgqQI/s320/IMG_3093.JPG" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjbs9P76ldhVyh68M8tzgis31Fb18a6la9q1KtQs4RCZanLG68tX_q2s4KZ3nhvdxreI8A-EcVTnS5fTnc2AOUG1a1O4vOZd04B2Utf3ruq88uBth3dLBtsISIodZr4TKqsNRY/s1600/IMG_3097.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjbs9P76ldhVyh68M8tzgis31Fb18a6la9q1KtQs4RCZanLG68tX_q2s4KZ3nhvdxreI8A-EcVTnS5fTnc2AOUG1a1O4vOZd04B2Utf3ruq88uBth3dLBtsISIodZr4TKqsNRY/s320/IMG_3097.JPG" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2PypcksLLXmzVCBV3dsy9PqdlhmdnVpO1vC-KKt16WOTKp6kKKBA0Fvp-KO4AQnJnrMsjeStDEp4AwZfwx7KZX0x7WB7pdIA8rfzG1NO_PHBCw0kBssqU6ib0y1FvDfIiUOb-/s1600/IMG_3101.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2PypcksLLXmzVCBV3dsy9PqdlhmdnVpO1vC-KKt16WOTKp6kKKBA0Fvp-KO4AQnJnrMsjeStDEp4AwZfwx7KZX0x7WB7pdIA8rfzG1NO_PHBCw0kBssqU6ib0y1FvDfIiUOb-/s320/IMG_3101.JPG" height="240" width="320" /></a></div>
<br />
<br />
<br />
Note that the yellow wire is connected to the LED has a flat edge on the side where the yellow wire connects. The flat marks the cathode or negative terminal of the LED. So you should connect the black wire to the flat side of the LED and connect the red wire to the other side (where I have the green wire). And then cover the wire with heat-shrink tubing.<br />
<br />
So here you will see an LED connected to your red and black wires at the far end of your USB cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pRoDhw4KFcZw_U1qxMaWhWMyvTmJihQOI5gePDOFNre1AWufWHrt_lyXLrB9j57Gbixa2ri-b9yn9D6jGfP5M1qCBej4UMF2Re-bMRvsFHKKoVFz8Q8lmbvBMZkBuISP25yg/s1600/soldered+IR+LED.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pRoDhw4KFcZw_U1qxMaWhWMyvTmJihQOI5gePDOFNre1AWufWHrt_lyXLrB9j57Gbixa2ri-b9yn9D6jGfP5M1qCBej4UMF2Re-bMRvsFHKKoVFz8Q8lmbvBMZkBuISP25yg/s320/soldered+IR+LED.jpg" height="320" width="240" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFE7BJQPgLsYif51rdCfCCg44hjtfBqsIemlQ34-1znIqt75jjuhz2kxFj0Zos-Bp9Agc-b2cck_cyfWxpG-vhVfR6npLENVEyjuY_CsXv68-Fo_7NKff1YJbrY65-gMGD1GJc/s1600/LED+at+end+of+cable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFE7BJQPgLsYif51rdCfCCg44hjtfBqsIemlQ34-1znIqt75jjuhz2kxFj0Zos-Bp9Agc-b2cck_cyfWxpG-vhVfR6npLENVEyjuY_CsXv68-Fo_7NKff1YJbrY65-gMGD1GJc/s320/LED+at+end+of+cable.jpg" height="320" width="87" /></a></div>
<br />
<br />
Next we will decide where to connect the second LED and the current limiting resistor. Now is a good time to shorten the cable to your desired length (do leave a little extra though). I did not trim enough length from the cable and ended up need to take up the slack when I installed the finished project. Decide where you want to put the second LED and cut the cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0MtCDpEDMvlaTbTYcK-WS8PngMtXapkHoYa3sfv4NnzwqU_tqsO-6joj19A64idhQ2rHzKHk7BusG-4p7Vqj-6V1AsKbSbuqeHiUX9nD6oHwVs2KCNPYx_ENO6M2N0UCb1DjB/s1600/cable+cut.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0MtCDpEDMvlaTbTYcK-WS8PngMtXapkHoYa3sfv4NnzwqU_tqsO-6joj19A64idhQ2rHzKHk7BusG-4p7Vqj-6V1AsKbSbuqeHiUX9nD6oHwVs2KCNPYx_ENO6M2N0UCb1DjB/s320/cable+cut.jpg" height="240" width="320" /></a></div>
<br />
<br />
Here I have tried to maintain the convention that the USB end of the cable is to the left side of the image and the LED end of the cable is to the the right side of the image. Note, I recommend stripping the cable so the wires are 3 inches or so and avoiding the extension wires that I used.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcuRp1oKaI6tcUabzQxf-_xVO8dQSM7gmV8c3SBS8owBr6n5qJszMVedCWNhNLqVHi86j9-I4aBRseiS70-VYg3Fj6DUIumMeke0a6wpa_XZMR5fZYe5i2RjEdQ72Kl_PngKqO/s1600/USB+cable+end+stripped.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcuRp1oKaI6tcUabzQxf-_xVO8dQSM7gmV8c3SBS8owBr6n5qJszMVedCWNhNLqVHi86j9-I4aBRseiS70-VYg3Fj6DUIumMeke0a6wpa_XZMR5fZYe5i2RjEdQ72Kl_PngKqO/s320/USB+cable+end+stripped.jpg" height="168" width="320" /></a></div>
<br />
<br />
Next, twist the stripped end of the red wire (incoming 5V from the USB port) around the resistor lead as close to the resistor as possible. Then solder the wire and trim the excess resistor lead. Then trim and form the other lead of the resistor and add a piece of heat-shrink tubing. I like a hook on the trimmed lead to make it easier to physically attach the wire before soldering.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBFQB6-wxDh0ORztBqQ_CY3xnmeoa9Jl_FrBdIvQVLNTyh817RJDispiGPxecHbjsD_nL5AuKiwkbhMn2hIhfylWGAOqBmZP5iyV6TC7Ps9puZtR5F2iN24WsetEc5oeSu5AjF/s1600/IMG_3149.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBFQB6-wxDh0ORztBqQ_CY3xnmeoa9Jl_FrBdIvQVLNTyh817RJDispiGPxecHbjsD_nL5AuKiwkbhMn2hIhfylWGAOqBmZP5iyV6TC7Ps9puZtR5F2iN24WsetEc5oeSu5AjF/s320/IMG_3149.JPG" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigJmCQfyeiDT5pHEsi2hZXbFUae5h8oDGJaj_1qJK_QJa_JM038oHJbh41PKlYBifExqBzXPP4XVzznfHj0sZyjdY8rXE0iQaJMheLrqSERAAUUaWLOd6SVg9xdB0Bnt2APT0Y/s1600/IMG_3151.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigJmCQfyeiDT5pHEsi2hZXbFUae5h8oDGJaj_1qJK_QJa_JM038oHJbh41PKlYBifExqBzXPP4XVzznfHj0sZyjdY8rXE0iQaJMheLrqSERAAUUaWLOd6SVg9xdB0Bnt2APT0Y/s320/IMG_3151.JPG" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis5xyjLDbWVyvSHUqILd7iiE3QcCReW_qt1fVaQZcUw4Dck1FoVDhPQbpx5bni5FEe3lyYAtqp4GPBWOX9LJF89acYgv1Eht_EsGiMpIi3mWuy2Ad4RT4iDnwrh6c3Pq3YXf8o/s1600/IMG_3153.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEis5xyjLDbWVyvSHUqILd7iiE3QcCReW_qt1fVaQZcUw4Dck1FoVDhPQbpx5bni5FEe3lyYAtqp4GPBWOX9LJF89acYgv1Eht_EsGiMpIi3mWuy2Ad4RT4iDnwrh6c3Pq3YXf8o/s320/IMG_3153.JPG" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuHf5aohciQ36RDR0lRW5th91louZxUsO12Z8TocvXjK8yPqZE8h3rsNdcgSonup38faPd8-7wj9vKwZO_Ir37TkTSEfi0fnKxnBHSKKD7A0PH0u2FXCAP04DKf0zGwUmhJ9-v/s1600/IMG_3154.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuHf5aohciQ36RDR0lRW5th91louZxUsO12Z8TocvXjK8yPqZE8h3rsNdcgSonup38faPd8-7wj9vKwZO_Ir37TkTSEfi0fnKxnBHSKKD7A0PH0u2FXCAP04DKf0zGwUmhJ9-v/s320/IMG_3154.JPG" height="240" width="320" /></a></div>
<br />
<br />
Now, strip the other cut-end of the cable attached to the first LED and solder the red wire to the remaining resistor lead and cover with heat-shrink. Remember to strip a longer section if you want to avoid using extension wires.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimt7VsJpsv7wyN3ZuXwfUUiKxVvzekYHrgR_t5YON393EcxV4Zc6WcnHs13IjqZ_T1l8WwMFGh6-NmDMF8bNUXjVCP51zFz0NC8sAtk4Xf2KLFamy6BGC9eDD9H8zfWceAph-F/s1600/2nd+Red+read.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimt7VsJpsv7wyN3ZuXwfUUiKxVvzekYHrgR_t5YON393EcxV4Zc6WcnHs13IjqZ_T1l8WwMFGh6-NmDMF8bNUXjVCP51zFz0NC8sAtk4Xf2KLFamy6BGC9eDD9H8zfWceAph-F/s320/2nd+Red+read.jpg" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Xqq38yhv6Eukt1FBnVhaGlDCNq3eVVMdIEq6qJC2y8ToNf2MhrfzWH5w85IULCBoXZj_WVHbuxYM_zDg3tYgNOPUN4FjGsENExeXhvCEP9sWE6coULvYQ-ASWNJ5qkK64C5G/s1600/2nd+Red+twisted.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6Xqq38yhv6Eukt1FBnVhaGlDCNq3eVVMdIEq6qJC2y8ToNf2MhrfzWH5w85IULCBoXZj_WVHbuxYM_zDg3tYgNOPUN4FjGsENExeXhvCEP9sWE6coULvYQ-ASWNJ5qkK64C5G/s320/2nd+Red+twisted.jpg" height="240" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZUlQ7qKelDZ5b0Vde-oLDvtfuyxL8JhIvbX7qiOjcn5sn8cBN04zLAoLf3azQBMMV-UeJGbGr-pl8b811yAaY5Cf6oS5cH4RZeK9F_Bhn465gPwEwVMAbqHzLpPEcQn_QayYQ/s1600/2nd+Red+soldered.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZUlQ7qKelDZ5b0Vde-oLDvtfuyxL8JhIvbX7qiOjcn5sn8cBN04zLAoLf3azQBMMV-UeJGbGr-pl8b811yAaY5Cf6oS5cH4RZeK9F_Bhn465gPwEwVMAbqHzLpPEcQn_QayYQ/s320/2nd+Red+soldered.jpg" height="207" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhag_LCqmPyDnsTmzdaomBbEjRs3YEK0Aj9DnmE_p_7hV94XcNz2sV08Uxexa7HUmi805KYdZCfLeMFmxuPCxJoQKO0UWrsBTIshWKpAIDpAeHqvS6Uc9y0_08_EgQmbJ58C3cZ/s1600/2nd+Red+shrink.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhag_LCqmPyDnsTmzdaomBbEjRs3YEK0Aj9DnmE_p_7hV94XcNz2sV08Uxexa7HUmi805KYdZCfLeMFmxuPCxJoQKO0UWrsBTIshWKpAIDpAeHqvS6Uc9y0_08_EgQmbJ58C3cZ/s320/2nd+Red+shrink.jpg" height="161" width="320" /></a></div>
<br />
<br />
Next, fold the cable back on itself and tape or zip-tie the cable together. The tape or zip-tie acts as a strain-relief to prevent stress on the solder joints. Here the black wire on the left connects to the USB ground. This will connect to the LED flat (cathode). The black wire on the right connects to the cathode of the LED we previously soldered.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0D-xsOcPYyGFowwxj5FOFR1jr0uI1-tnszWGRzBXckvOdngfY6NODZECGV5YLAPEP0-v4dlEXXiJF1u4Hpr71n_IEJRBHDSTaS80qVAM2ufNpr9rR5Ws1YuCHIsCnTq_ehQo_/s1600/Prep+for+2nd+LED.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0D-xsOcPYyGFowwxj5FOFR1jr0uI1-tnszWGRzBXckvOdngfY6NODZECGV5YLAPEP0-v4dlEXXiJF1u4Hpr71n_IEJRBHDSTaS80qVAM2ufNpr9rR5Ws1YuCHIsCnTq_ehQo_/s320/Prep+for+2nd+LED.jpg" height="320" width="240" /></a></div>
<br />
<br />
Again, I used solid-copper yellow and green extension wires to allow me to pose the LED but feel that there was little benefit. If you stripped enough cable, you can use your longer black wires to connect to the LED. Otherwise you will need to add extension wires. <br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPDbZmEgUEbPJ1lhBh_CD-l9-3_KfJIlAb6xIULC7wCCYvdpbMoW_uF37-TBenRoPSf6vpMudMio1gSAHwCi1R6JCDALUw6uoehTt1jx5FC5dqiEJgKT_qimfqfJeS2pdF-NZS/s1600/2nd+LED.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPDbZmEgUEbPJ1lhBh_CD-l9-3_KfJIlAb6xIULC7wCCYvdpbMoW_uF37-TBenRoPSf6vpMudMio1gSAHwCi1R6JCDALUw6uoehTt1jx5FC5dqiEJgKT_qimfqfJeS2pdF-NZS/s400/2nd+LED.jpg" height="331" width="400" /></a></div>
<b><span style="font-size: large;"><br /></span></b>
<br />
You should test your cable before adding additional heat-shrink over the bias resistor. It will be easier to debug before the extra heat-shrink. The heat-shrink tubing added after testing will act as a strain-relief and protect your solder joints when installing or adjusting the cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB6DJjFZ6OHmg-oAB6ddgK_v_pJX6fG430IxxHK4mibqHcPOTYrAZg9q4SzzZA-EvIK8MtdlR88SH9dqBYoHus9bLAy2PIpxQhsqvaZwQ17EgDCk7Tn8518sAJrBhBpzDH2U9h/s1600/2nd+LED+with+shrink.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhB6DJjFZ6OHmg-oAB6ddgK_v_pJX6fG430IxxHK4mibqHcPOTYrAZg9q4SzzZA-EvIK8MtdlR88SH9dqBYoHus9bLAy2PIpxQhsqvaZwQ17EgDCk7Tn8518sAJrBhBpzDH2U9h/s320/2nd+LED+with+shrink.jpg" height="276" width="320" /></a></div>
<b><span style="font-size: large;"><br /></span></b>
<br />
<b><span style="font-family: Arial, Helvetica, sans-serif; font-size: large;">Testing</span></b><br />
You should verify your cable works BEFORE plugging it into your TV. Use a remote control that you know works (for your TV perhaps!) and find a cellphone camera or digital camera camcorder that will allow you to see the IR LED flicker when you push a button on your remote. On my iPhone the rear facing camera is sensitive to the LED but the forward facing camera is not. Now use a cellphone or other wall mounted USB charger (better to burn up your charger rather than your TV) to power the cable and verify the LED's light up. I know that the USB spec calls for short-circuit protection but I would rather test first with an expendable USB charger. Here is one of my installed LED's as seen by a small point-and-shoot digital camera.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1NizWRvvZOW6O8hfSJaHEC1fkJO5iv72JkHKrL2TZJGGPamswYeiWMRO1cOcuEe10AgtW9Jx7VdXw64XH2aMbyCM469vYzA9fSjKACHza2lq3zApy6_NOvmND8cSY_UMzO9Wf/s1600/LED+on.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1NizWRvvZOW6O8hfSJaHEC1fkJO5iv72JkHKrL2TZJGGPamswYeiWMRO1cOcuEe10AgtW9Jx7VdXw64XH2aMbyCM469vYzA9fSjKACHza2lq3zApy6_NOvmND8cSY_UMzO9Wf/s320/LED+on.jpg" height="255" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
If you see only one LED light up, you probably have a short on the wiring of the OTHER LED. If you see no LED's on, just go back and check for shorts and verify the the polarity on your LED's. Note that getting one LED backwards will prevent either LED from illuminating. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
I wanted to measure the current to make sure I was below 100mA so I did more detailed testing. I used a USB extension cable between my USB wall charger and the connector on my DIY sensor bar cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZsskIqCiz_IBdO9lHAFBUVahPgNpp2aFyNLKNk2jH1831ODoyMRZGRckaic9qqO_CuYP-UD8XT2KomKLhAsq6E7CX1sNzIH8vV3poMxForskG4qXTYgJ83zS6hOtV-SYLTtyU/s1600/USB+extension+cable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZsskIqCiz_IBdO9lHAFBUVahPgNpp2aFyNLKNk2jH1831ODoyMRZGRckaic9qqO_CuYP-UD8XT2KomKLhAsq6E7CX1sNzIH8vV3poMxForskG4qXTYgJ83zS6hOtV-SYLTtyU/s400/USB+extension+cable.jpg" height="236" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
I stripped the extension cable in the middle to allow me to access the power wires. I broke the connection in one power conductor so I could insert a meter and measure current flowing through the cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBiUGrH5aTspkTr-i9omtQbIICpLFZeGXODmxLTKWa90Yzv50wV4aw9mbWVV5mZbBn9JiXo0226a9qh5Cq0Z-mxLKNlv-9Igz92HvYk-xRbJtSrgjmIQlyzzU1z3XynxJ_mPCN/s1600/USB+charger+testing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBiUGrH5aTspkTr-i9omtQbIICpLFZeGXODmxLTKWa90Yzv50wV4aw9mbWVV5mZbBn9JiXo0226a9qh5Cq0Z-mxLKNlv-9Igz92HvYk-xRbJtSrgjmIQlyzzU1z3XynxJ_mPCN/s400/USB+charger+testing.jpg" height="400" width="283" /></a></div>
<br />
Note that I split the ground wire rather than the 5 volt red wire because and accidental short of the black wire to the cable shield or ground would not cause a problem. An accidental short of the red wire would short the 5 volts to ground and depend on internal protection of the USB port to limit the current. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkIrMhIxvRr0bpWr4wuZeADRUD_9fVEvQ-GZaswt-Uv4Yf8dKqn6-pAZkNT5RpCDF-jWR9fBF-Qtb0YbXUNn3uD8OiRUBS4G3YKKoKAAuNhBDXm8Xw85RjtCkj0DUVabH3n9h/s1600/USB+extension+cable+hacked.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkIrMhIxvRr0bpWr4wuZeADRUD_9fVEvQ-GZaswt-Uv4Yf8dKqn6-pAZkNT5RpCDF-jWR9fBF-Qtb0YbXUNn3uD8OiRUBS4G3YKKoKAAuNhBDXm8Xw85RjtCkj0DUVabH3n9h/s400/USB+extension+cable+hacked.jpg" height="228" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
I measured 66 mA, well under our 100 mA current limit. A short-circuit would have shown current higher than expected and an open circuit or reversed diode would have caused no current to flow. The current is lower than the 78.8 mA expected. So there is clearly some combination of higher diode forward voltage drop, more than 33 ohms in our resistor or a slightly lower USB voltage. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8dzGct-L4JX7BISkakgahVfo3iFyHGugWsUljy0UW5bl3Rx_c4Dy7fuqsdv9eL9nDsnVHPSy1sbMvuBlkMPlV4lpZ1anllVo2S9_PXgUQM5G3kaaR3XrCy6a0NQ1TmW9TJK7/s1600/Measured+Current.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA8dzGct-L4JX7BISkakgahVfo3iFyHGugWsUljy0UW5bl3Rx_c4Dy7fuqsdv9eL9nDsnVHPSy1sbMvuBlkMPlV4lpZ1anllVo2S9_PXgUQM5G3kaaR3XrCy6a0NQ1TmW9TJK7/s640/Measured+Current.jpg" height="640" width="379" /></a></div>
<br />
<br />
Here is the finished cable. Clearly I could have trimmed out much more extra cable. Initially I expected that having extra distance between the IR LED's would improve the performance at greater distance from the TV. Increased space between the LED's did not help. It appears the original Wii bar LED spacing is near optimal. My desire to experiment with mounting is one of the reasons I left in the extra cable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy99hHLikuW5cU3Jk6Dq_FdM1iKGZal00eIbc4bwR-2u_af8FUDZ4veSBaxr1Mo46BdCLQIoC8JmD2eN1cXqhAT0b92sOH70ElO1L3pjHQAEG37t6HuRhMz16I3JXpFErv9qtQ/s1600/Finished+Cable.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy99hHLikuW5cU3Jk6Dq_FdM1iKGZal00eIbc4bwR-2u_af8FUDZ4veSBaxr1Mo46BdCLQIoC8JmD2eN1cXqhAT0b92sOH70ElO1L3pjHQAEG37t6HuRhMz16I3JXpFErv9qtQ/s400/Finished+Cable.jpg" height="290" width="400" /></a></div>
<br />
<b><span style="font-size: large;"><br /></span></b>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"><b>Install</b></span><br />
Getting the sensor bar to work is easy. Getting it work work well requires a little set-up time. The key steps for my installation and setup were:<br />
<br />
- mount the LED's on the edge (top or bottom) of the TV that is closest to the player<br />
- mount the LED about as far apart as the Wii Sensor Bar that came with the Wii<br />
- tilt the LED's slightly to point at the furthest place you will use the Wii remote<br />
- adjust the sensitivity to the highest value that works well at the CLOSEST distance<br />
<br />
I used blue painter's tape (removable paper masking tape) to mount the LED's to the bottom of my my TV. I tried several types of tape with poor results. I also I tried top mounting but was not please with the performance. The tape is much harder to see than you would expect. Electrical tape was the next best performing tape.<br />
<br />
The LED's worked best when mounted closer together than I expected, close to the spacing of the original sensor bar. The closer you mount the LED's the closer you can stand to the TV and still use the Wii remote. Greater distance between the LED's may be beneficial at distances greater than 12 feet but I did not have the space to test this theory. I mounted the LED's as close together as possible, about 14 inches apart (the limiting factor for me was a center channel speaker sitting directly below the TV). <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjakVK0hndBh8ny-IWJXl4mhAVLEQm6ja50YjBVmpJsN8tXNkxqD5rNDQieIfkM9AqQTa8d2gVl3_1sYtcpVhSwraA691tNUfXwbns2nnrIY1LhFN1MGUbltAT4dOBMgTx_jPeB/s1600/LED+mounted.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjakVK0hndBh8ny-IWJXl4mhAVLEQm6ja50YjBVmpJsN8tXNkxqD5rNDQieIfkM9AqQTa8d2gVl3_1sYtcpVhSwraA691tNUfXwbns2nnrIY1LhFN1MGUbltAT4dOBMgTx_jPeB/s320/LED+mounted.jpg" height="160" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSowSJIXKKDmcPgD-XoOMdw27Ea9QmOd6cNpdTrgK8kbBnRj7_iOJDPnIGF8WKmEe-yQI_NYsezK65-i-ebuOAw43S3DAEZ8xxULYD2sgzTcKz2hJhRSaXmCM39WWfYIw3LSkk/s1600/LED+spacing+sharp.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSowSJIXKKDmcPgD-XoOMdw27Ea9QmOd6cNpdTrgK8kbBnRj7_iOJDPnIGF8WKmEe-yQI_NYsezK65-i-ebuOAw43S3DAEZ8xxULYD2sgzTcKz2hJhRSaXmCM39WWfYIw3LSkk/s320/LED+spacing+sharp.jpg" height="158" width="320" /></a></div>
<br />
Try to tilt the LED's toward your furthest player position. For me this was the couch, so I tilted the LED's slight down and slightly inward.<br />
<br />
I was surprised at how much effort went into taping the LED's to the TV. It took trying several kinds of tape to find one that would stay on the TV. The stiff extension wires I used worked against me here. I found that painter's tape and electrical tape worked best. Be prepared to try a few kinds of tape to get the best results for your install.<br />
<br />
Now you should plug the USB cable into the TV. No go to <Wii Settings> select page 2 of settings and select <Sensor Bar> and then <Sensor Bar Position> and select <Below TV> (or <Above TV> if that is where you mounted yours). Next go to the Wii settings for <Sensitivity>.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSXsNCz2qsbhaX4hVcnNYFaHQCP2sKtpCqvltPnQODEN_bp0fLpG2_aGSonSTgf0NR94SVydsXAxwT2-xplGkz6g6PXy2M6dP3Cqvn3Ts3BGMgZVdd-qXEiBNcSEI_PMDep-po/s1600/Sens+Setting.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSXsNCz2qsbhaX4hVcnNYFaHQCP2sKtpCqvltPnQODEN_bp0fLpG2_aGSonSTgf0NR94SVydsXAxwT2-xplGkz6g6PXy2M6dP3Cqvn3Ts3BGMgZVdd-qXEiBNcSEI_PMDep-po/s320/Sens+Setting.jpg" height="184" width="320" /></a></div>
<br />
Click through until you get the dark screen that shows the LED's as seen by the remote. This is the best screen for diagnosing your set up. Here you can see how the two dots get farther apart as the remote gets closer to the screen as well as how the dots get closer and dimmer as you get farther away from the TV. I found that a Sensitivity of 3 was a good balance between performance at my maximum distance and closer to the TV. <br />
<br />
Setting the Sensitivity too high can cause artifacts from internal reflections in the Wii remote when the remote is too close to the TV. Here you can see two smaller dots from internal reflections caused by pointing the remote directly at an LED from a distance of two feet. This is so close the other LED is not visible to the remote.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXsLYRZbDW9-U1PjTMUjcDySo4EdwRRCfwpOhPOMONiOLJplNiWWcTjw3BtGWB7G6kESdxnbTG1XI5vT7o7XLKwrCTEcw15ej1RWWMdL13V3hHDM41kwVBRQk3J_JvviTvsgSC/s1600/Overdrive+LED.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXsLYRZbDW9-U1PjTMUjcDySo4EdwRRCfwpOhPOMONiOLJplNiWWcTjw3BtGWB7G6kESdxnbTG1XI5vT7o7XLKwrCTEcw15ej1RWWMdL13V3hHDM41kwVBRQk3J_JvviTvsgSC/s320/Overdrive+LED.jpg" height="194" width="320" /></a></div>
<br />
<br />
Increase the Sensitivity to 4 (or even 5) if your pointer is jumpy at your maximum viewing distance (also try tilting your LED's toward your viewing position). Lower the Sensitivity and or move the LED's closer together if your pointer gets jumpy when you are at your closest viewing distance.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp7RhRqWkWIIAqfNZlCNKRoHQY2b6HUSiQ0m2IoV8cbEcw9s7A_ksXlX4e4HUsclMEMRZ6ZlOaiWVeDuu2f4VgXp333E9DiHwtqSQh9yg0GhNv858aoWS9orr0YeNj3vaM6h1B/s1600/Finished+Installed.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgp7RhRqWkWIIAqfNZlCNKRoHQY2b6HUSiQ0m2IoV8cbEcw9s7A_ksXlX4e4HUsclMEMRZ6ZlOaiWVeDuu2f4VgXp333E9DiHwtqSQh9yg0GhNv858aoWS9orr0YeNj3vaM6h1B/s400/Finished+Installed.jpg" height="293" width="400" /></a></div>
<br />
I am pleased with the look and performance of the new sensor bar. TV. It turns on and off with the TV and is practically invisible. Here it is installed on the TV and you can just barely see the LED's a couple of inches on either side of the center channel speaker. I have worked on improving the LED attachment using peel-and-stick adhesive and will provide details in a future post.<br />
<br />
I had fun building the Invisible Wii Bar and hope you find it useful!<br />
<br />
<br />Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-87658710150065022502014-08-15T14:40:00.002-04:002022-11-02T15:58:31.374-04:00PowerShell Single-Line Script for Useful Folder Modification Dates<h3>
Making Folder Dates Useful</h3>
I want to share an adventure I had after a DropBox rollback reset all of my DropBox folder's modification dates on my Windows computers (Win 7 and XP). Why would I care about a folder modification dates? I'm glad you asked!<br />
<br />
Folder modification dates allow you to view your projects in a useful archaeological manner (newest files and folders on top, oldest items at the bottom). At a glance you can see which projects are receiving attention, and which may have been put into a holding pattern for any number of reasons. You can simulate the reset of the folder dates by making a copy of an existing folder in Windows. The files in the newly created folder will have the correct modification dates, but all of the folders and sub-folders will have the current date for their modification date.<br />
<br />
It was frustrating searching for recent projects by name from a list that includes all of my completed projects - (perhaps completed is too strong a word). View by name is even worse because you have to remember the name of the folder first. This applies to folders of photos as well. Did I name the folder "Beach Trip 2012" or was it "2012 Beach Trip" or was is "Myrtle Beach 2012"? If you have an idea of the date of interest, sorting your folders by date gives you a quick way to zoom in on what you are trying to find.<br />
<br />
I needed to find a program or script that will scan my DropBox folder, find the newest file anywhere inside that folder or sub folder and then set the folder modification date of the folder to the date of that newest file. And then repeat this process for every sub-folder in the target folder.<br />
<br />
<h3>
Searching for a Solution</h3>
<div>
I always recommend searching for similar projects already published to avoid reinventing the wheel. In this case, my search turned up nothing close to what I want, so it looked like I was on my own. My first instinct was to try Python (which I <a href="http://fettricks.blogspot.com/2014/06/fixing-gerber-drill-file-using-python.html" target="_blank">recently</a> used to for a quick fix to some Gerber files) but I found little information about using Python to change folder modification dates under Windows. Expanding my search beyond Python led me to this GREAT <a href="http://blogs.technet.com/b/heyscriptingguy/archive/2008/03/26/how-can-i-change-the-last-accessed-date-of-a-file-to-match-its-last-modified-date.aspx" target="_blank">article</a> about using <a href="http://en.wikipedia.org/wiki/Windows_PowerShell" target="_blank">PowerShell </a> to modify file times. This article was my introduction to PowerShell, and demonstrated the power of recursion and piping results from one command into the next command (or cmdlet's as they are known in PowerShell).<br />
<br /></div>
<div>
I found that PowerShell 2.0 was already installed on both my Windows 7 and XP computers. I only had to set the execution <a href="http://superuser.com/questions/106360/how-to-enable-execution-of-powershell-scripts" target="_blank">policy</a> to remotesigned to allow me to run scripts from the IDE and start coding! Below is a clip from StackExchange with the steps needed to run your own PowerShell scripts. I clicked the Windows Start button and searched for PowerShell and then right-clicked on PowerShell and selected "Run as administrator".<br />
<br />
<ol style="background-color: white; border: 0px; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; margin: 0px 0px 1em 30px; padding: 0px;">
<li style="border: 0px; margin: 0px 0px 0.5em; overflow-wrap: break-word; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
Start Windows PowerShell with the "Run as Administrator" option. Only members of the Administrators group on the computer can change the execution policy.</div>
</li>
<li style="border: 0px; margin: 0px; overflow-wrap: break-word; padding: 0px; word-wrap: break-word;"><div style="border: 0px; clear: both; padding: 0px;">
Enable running unsigned scripts by entering:</div>
<pre style="background-color: #eff0f1; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; margin-bottom: 1em; margin-top: 0.5em; max-height: 600px; overflow-wrap: normal; overflow: auto; padding: 5px; width: auto; word-wrap: normal;"><code style="border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; margin: 0px; padding: 0px; white-space: inherit;">set-executionpolicy remotesigned
</code></pre>
</li>
</ol>
<div style="background-color: white; border: 0px; clear: both; color: #242729; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 15px; margin-bottom: 1em; padding: 0px;">
This will allow running unsigned scripts that you write on your local computer and signed scripts from Internet.</div>
So I studied the PowerShell examples, explored the <a href="http://www.activexperts.com/admin/powershell/powershell10/" target="_blank">cmdlet's</a> available, did a bunch of Google searches, and bought a copy of "Windows PowerShell Pocket Reference".</div>
<div>
<br /></div>
<div>
I used code fragments from the internet, and began building the function that I needed. Before long, I had a working script that was less than 10 lines! I was impressed at how little code PowerShell required to implement the desired functionality. </div>
<div>
<br /></div>
<div>
As you can imagine, my first script was a bit of a kludge, with components thrown-together as I implemented each functional block. Once the script was working I went back and worked on clean up. As I began to understand the PowerShell methodology a little more, I saw places where I had extra steps, or code that could be eliminated. Eventually I optimized the entire function down to a single line of PowerShell script! I was amazed at what PowerShell can do with -recurse and the pipeline.<br />
<br />
Notes. The PowerShell IDE reports an error to the console terminal for each folder processed that contains no files in the folder or sub-folders. This error occurs because the script attempts to set a folder property ($_.LastWriteTime) equal to the last write time property of the null returned if there are no files found. And as you might expect, a null does not have a .LastWriteTime property! The script uses nested recursion so there are a lot of directory commands being issued which can take a while if you have a large collection of folders. A future post will describe how to fix the null last write time issue.<br />
<br /></div>
<div>
<h3>
Working Single-Line Script</h3>
First things first, backup your files and work on a copy of your target folder until you are very happy with the results! I also recommend keeping an extra backup copy of your folder on another drive. Backups are good!<br />
<br />
Below is the single-line script that process a folder and all sub-folders and changes all of the folder modification dates to the date of the most recently modified folder or sub-folder.<br />
<pre style="background: rgb(240, 240, 240); border: 1px dashed rgb(204, 204, 204); font-family: arial; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; width: 646.469px;"><code style="overflow-wrap: normal; word-wrap: normal;"> Get-ChildItem "H:\DropBox\FolderDateFix\Test1" -recurse | Where-Object {$_.PsIsContainer} | ForEach-Object {$_.LastWriteTime = ($_ | Get-ChildItem -recurse | Where-Object {!$_.PsIsContainer} | Sort-Object LastWriteTime | Select-Object -last 1).LastWriteTime}
</code></pre>
<br />
PowerShell allows you to break lines after a pipe without requiring a <a href="http://stackoverflow.com/questions/3235850/how-to-enter-a-multi-line-command" target="_blank">backtick</a>. So the line below is equivalent to the single line above but a little easier to read in the browser because we started a new line after each pipe.<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">Get-ChildItem "H:\DropBox\FolderDateFix\Test1" -recurse | </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Where-Object {$_.PsIsContainer} | </span><br />
<span style="font-family: "courier new" , "courier" , monospace;">ForEach-Object </span><span style="font-family: "courier new" , "courier" , monospace;">{</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> $_.LastWriteTime = ($_ | </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> Get-ChildItem -recurse | </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> Where-Object {!$_.PsIsContainer} | </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> Sort-Object LastWriteTime | </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> Select-Object -last 1).LastWriteTime</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">} </span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<br />
<h3>
Walk through. </h3>
We start off by using the Get-ChildItem cmdlet and the hard-coded path. You need to change text to reflect the path to your target folder. I used quotes for the path to allow a path with spaces to be used. An alias to Get-ChildItem (gci, ls or dir) could have been used but I wanted to use the native cmdlet names rather than aliases. The -recurse switch causes Get-ChildItem to return all of the items in the target folder and all sub-folders. By default hidden folders are ignored. Add the -force switch after -recurse if you want the script to update the date of hidden folders.<br />
<br />
Next the results are piped to the Where-Object cmdlet where filter block {$_.PsIsContainer} tells the cmdlet to produce an array of only the folders. Here we see the first use of $_ which represents the object currently being processed in the pipeline. So now we have a collection that contains only folders.<br />
<br />
Next the collection of folders is piped to the ForEach-Object and this is where things get interesting. Again we use $_ to indicate the current object or folder in the pipe but we are modifying the .LastWriteTime by setting the .LastWriteTime of the folder equal to the .LastWriteTime of the object returned from the last four cmdlets. Again, the results from each cmdlet are piped to the next cmdlet.<br />
<br />
Next we find the newest file in the current folder or any sub folder. We get this by generating a list of all object in the folder and sub-folder (using Get-ChildItem -recurse). By default hidden files are ignored. To include hidden files you need to add -force after the -recurse switch. We then select only the files using Where-Object {!$_.PsIsContainer} (is NOT a folder). Then we sort the files by date using Sort-Object LastWriteTime which orders the files from oldest to newest. Finally we select the last (newest) file using Select-Object -last and then the last write time of this file is applied to the current folder being processed in the pipe via .LastWriteTime property of the file.<br />
<br />
Dropping a new folder into a sub-folder will have no impact on the folder dates written by the script. But creating a new text file in a deep sub-directory will results in the script updating the date of the containing folder and every folder above the containing folder all the way up to the target folder.<br />
<br />
In the end, I discovered PowerShell's amazing power and flexibility allows me to achieve my goals with a single-line script. I hope you find the script useful and that I have encouraged you to look into using PowerShell yourself.<br />
<br /></div>
<div>
<h3>
Coming Soon: Putting a Graphical User Interface on a PowerShell Script</h3>
<div>
In a future post I will walk you through how I expanded the script to add a progress bar and prompt the user to select a target folder!<br />
<br />
<a href="http://fettricks.blogspot.com/2015/03/adding-gui-to-powershell-script-to-fix.html">Adding a GUI to the PowerShell Script</a></div>
<br /></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-26363090674202338712014-06-27T14:54:00.000-04:002014-11-11T12:56:13.110-05:00Fixing a Gerber Drill File using a Python ScriptAdventures in getting sidetracked. I want to build a constant current load for capacity testing some SLA (Sealed Lead Acid) batteries that I bought for my UPS. My first stop when starting a project is usually a quick Google search to see what has already been done and might be available, possibly saving me a great deal of development and testing time. I soon found a printed circuit board design that looked like a good fit but there was a problem with the Gerber files needed for fabrication. This post walks you though my experience in diagnosing the error, developing a solution and getting the boards fabricated.<br />
<br />
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;">
Constant Current Load</span></h4>
This effort began with a search for a circuit to use as the basis for a constant current load. Google led me to the blog post below by cwhittenburg on the Sleepy Robot... blog. Whittenburg based this design on that of constant current load found on the EEVBlog with enhancements made to reduce cost and improve performance. I recommend reading both posts about his work on the constant current dummy load.<br />
<span style="color: #0000ee;"><u><a href="http://www.sleepyrobot.com/?cat=7">http://www.sleepyrobot.com/?cat=7</a></u></span><br />
<span style="color: #0000ee;"><u><br /></u></span>
Here is a link for the constant current load project from the EEVBlog.<br />
<span style="color: #0000ee;"><u><a href="http://www.eevblog.com/2010/08/01/eevblog-102-diy-constant-current-dummy-load-for-power-supply-and-battery-testing/">http://www.eevblog.com/2010/08/01/eevblog-102-diy-constant-current-dummy-load-for-power-supply-and-battery-testing/</a></u></span><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0BtiRnfOpAabid4AXV-xaMV1yKiKdnTIO0Ll5lRW_YVlFEK4u-hbF34eD9vO0SptmXBcVg7hqr1pKRB_6mzZ0IXYRAg0vit_t6Ny6k3iA-2ji4uijZVFLyEdT-jdLA879al87/s1600/currentload-rev2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0BtiRnfOpAabid4AXV-xaMV1yKiKdnTIO0Ll5lRW_YVlFEK4u-hbF34eD9vO0SptmXBcVg7hqr1pKRB_6mzZ0IXYRAg0vit_t6Ny6k3iA-2ji4uijZVFLyEdT-jdLA879al87/s1600/currentload-rev2.jpg" height="400" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">SleepyRobot's revised Constant Current Dummy load. </td></tr>
</tbody></table>
<br />
This seems like a good candidate pcb for my needs so I downloaded the Gerber files using the link at the bottom of his "Constant Current Dummy Load Revised" post.<br />
<a href="http://www.sleepyrobot.com/wp-content/uploads/2012/01/currentload-rev2-gerbers.zip">http://www.sleepyrobot.com/wp-content/uploads/2012/01/currentload-rev2-gerbers.zip</a><br />
<br />
You should always check your Gerber files before sending them off for fab, doubly so if you are getting the files from someone else. There are several ways to view Gerber files. I used the website below.<br />
<a href="http://www.gerber-viewer.com/default.aspx" target="_blank">http://www.gerber-viewer.com/default.aspx</a><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxquD_AoGoXYVpS5qEw840kN2StFThY-OgYEhBVXcMLI7OGrkDalAAf-qKSC3hXEmrXlWYMjUf5KTEicdS_eDmEZHcrH5bCcceQqZT4bQSQk3dckJPX07gO74bEWbg_pNWHs1W/s1600/Gerbers+with+drill+offset.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxquD_AoGoXYVpS5qEw840kN2StFThY-OgYEhBVXcMLI7OGrkDalAAf-qKSC3hXEmrXlWYMjUf5KTEicdS_eDmEZHcrH5bCcceQqZT4bQSQk3dckJPX07gO74bEWbg_pNWHs1W/s1600/Gerbers+with+drill+offset.jpg" height="448" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Preview of gerber files reveals that the drill holes and copper pads are offset.</td></tr>
</tbody></table>
<br />
Whoa, the drill file does not line up with the copper layer! I checked the other layers (not shown) and everything but the drill strikes lined up well. PCB layout programs offer many options for formatting the Gerber output files and drill files and clearly an offset between the drill file and pcb layers crept in somehow. I tried to find contact information for the blog author to request a new set of Gerbers but had no luck. And I believed that a mistake in the zip file of Gerbers meant you have no option other than re-exporting the files from your development environment.<br />
<br />
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;">
Back Burner</span></h4>
I moved on to other projects, planning to design my own or find another pcb to use for an active load. Eventually it occurred to me that unlike the Gerber layers, the drill file is just a text file that tells the drill machine which tool to load and where to drill the holes! I can work with that! I should be able to determine the offset of the drill holes and modify the text of the file to correct the drill hole locations. And once the offset is known, it should be a simple matter to write a script or program to make the changes to the drill file.<br />
<br />
I used the same on-line tool to zoom in on the board and measure the distance between one of the drill holes and it's mating pcb pad. I used the largest, upper right corner pad as my reference. A quick measurement tells us that it appears to have the same offset for both X and Y, approximately 1.1822 inches.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_X3zbMSo_qldIO6_-GScevvnjPmsKOhLBn2hvzlVBS3FRJbs98NO6pHwlIRXhYG-AsnDeSw9gSvXbaAXr-uJnpZsTVRxKHXayqL69EjP_595-4b6iyG1lX3TplhaIcsjoUKw8/s1600/Gerber+drill+offset+measured.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_X3zbMSo_qldIO6_-GScevvnjPmsKOhLBn2hvzlVBS3FRJbs98NO6pHwlIRXhYG-AsnDeSw9gSvXbaAXr-uJnpZsTVRxKHXayqL69EjP_595-4b6iyG1lX3TplhaIcsjoUKw8/s1600/Gerber+drill+offset+measured.jpg" height="448" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Rough measurement of hold-pad offset using viewer.</td></tr>
</tbody></table>
<br />
I manually added 11822 (for 1.1822 inches) to the X and Y coordinate of a single drill strike and then compared the new location to the Gerber pad. Comparison required creating a new zip file for the Gerbers and viewing the layers from the new zip file using the Online Gerber-Viewer. Each time the drill hole got closer to the pad, I was able to zoom in more and get a more accurate measurement. Using this iterative process I found the actual offset is 1.1803 inches. Now to figure out how to modify the drill file to add 11803 to each X and Y value.<br />
<br />
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;">Analyzing the Drill File</span></h4>
The drill holes are made using the information in the file "currentload.TXT" from the zip file. Below is an excerpt from the drill file. We are interested in the text starting at T01 which shows the drill-hole coordinates for the first tool, T01. The remainder of the file has coordinates for the other drills used on the board. You can see that each drill strike starts with an X or a Y coordinate. Some of the lines have both X and Y coordinates. The lines with a single value reflect a hole being located by moving one axis while maintaining the other axis position. Note that "X" and "Y" appear in column 0 for each coordinate provided, with the second "Y" in column 7 in lines with both x and y coordinates. We can find the coordinates in the drill file by looking for "X" and "Y" in the file in the correct columns!<br />
<br />
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">M48<br />;Layer_Color=9474304<br />;FILE_FORMAT=2:4<br />INCH<br />;TYPE=PLATED<br />T1F00S00C0.0320<br />T2F00S00C0.0335<br />T3F00S00C0.0354<br />T4F00S00C0.0394<br />T5F00S00C0.0400<br />T6F00S00C0.0870<br />T7F00S00C0.0900<br />;TYPE=NON_PLATED<br />T8F00S00C0.1000<br />T9F00S00C0.1142<br />%<br />T01<br />X037189Y011189<br />Y012189<br />Y015439<br />Y016439<br />X012539Y012189<br />X011539<br />X009789Y012689<br />X008789<br />X009289Y011939</span><br />
<br />
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;">Python Script</span></h4>
I have been looking for a reason to give Python try and this project seemed like a great opportunity. A few Google searches and I was on my way. My approach is to open the drill file and process the text file line by line while building a new output file, line by line as the values are modified. The script will check each line for "X" or "Y" in the correct locations. If no coordinates are found, I copy the line as is to the new file. If coordinates are found, I extract the values, add the offset and build a new line for the output file using the adjusted coordinate values.<br />
<br />
For example, if the 8th character (item 7 since the the first item in the array is item 0 ) in a line is "Y" then that line has both X and Y values that must both have the offset added. I extract the old x value and the old y value and add the offset. Then I construct a new line using the correct x and y values and write the line to the output file. If no coordinates are found, the line is written to the output file without modification.<br />
<br />
Below is the script I used to modify the drill file. Just select and copy into your own .py file to use the script. Each line in the script is commented to make it easier to follow. I used the script directly from my Python install folder and placed the drill file, currentload.txt in this case, in the same folder. Change the filename in the " i =" line of the script if you want to change the name of the file to be processed. In the same manner, you can edit the "o =" of the script to change the name of the output file.<br />
<br />
The most complicated part of the program is building the new line using the old value plus the offset. Looking at the last elif, we found a "Y" at position 0. We read the next six characters, 1 through 7 into the string oldy. Next we convert the oldy string to an integer, add the offset, convert the new number to a string and pad the string with leading zeros to six characters. Following this, the new line is written to the output file. Next we process the next line of the input file.<br />
<br />
<pre style="background: rgb(240, 240, 240); border-bottom-left-radius: 2px; border-bottom-right-radius: 2px; border-top-left-radius: 2px; border-top-right-radius: 2px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; letter-spacing: 0.015em; line-height: 15.600000381469727px; overflow-x: auto; overflow-y: hidden; padding: 0.5em;"><span style="font-size: x-small;"><span class="c" style="color: #60a0b0; font-style: italic;">#Adds an offset to x and y drill hole locations in a pcb drill file</span>
<span class="c" style="color: #60a0b0; font-style: italic;">#Shane Trent - shanedtrent@gmail.com</span>
<span class="c" style="color: #60a0b0; font-style: italic;">#fettricks.blogspot.com</span>
<span class="n">i</span> <span class="o" style="color: #666666;">=</span> <span class="nb" style="color: #007020;">open</span> <span class="p">(</span><span class="s" style="color: #4070a0;">"currentload.txt"</span><span class="p">,</span> <span class="s" style="color: #4070a0;">'r'</span><span class="p">)</span> <span class="c" style="color: #60a0b0; font-style: italic;">#Open file to be modified for reading</span>
<span class="n">o</span> <span class="o" style="color: #666666;">=</span> <span class="nb" style="color: #007020;">open</span> <span class="p">(</span><span class="s" style="color: #4070a0;">"currentloadnew.txt"</span><span class="p">,</span> <span class="s" style="color: #4070a0;">'w'</span><span class="p">)</span> <span class="c" style="color: #60a0b0; font-style: italic;">#Open new output file for writing</span>
<span class="n">xoff</span> <span class="o" style="color: #666666;">=</span> <span class="mi" style="color: #40a070;">11803</span> <span class="c" style="color: #60a0b0; font-style: italic;">#X offset measured to be added to each x value</span>
<span class="n">yoff</span> <span class="o" style="color: #666666;">=</span> <span class="mi" style="color: #40a070;">11803</span> <span class="c" style="color: #60a0b0; font-style: italic;">#Y offset measured to be added to each y value</span>
<span class="k" style="color: #007020; font-weight: bold;">for</span> <span class="n">line</span> <span class="ow" style="color: #007020; font-weight: bold;">in</span> <span class="n">i</span><span class="p">:</span> <span class="c" style="color: #60a0b0; font-style: italic;">#For each line in the array check the conditions below</span>
<span class="k" style="color: #007020; font-weight: bold;">if</span> <span class="mi" style="color: #40a070;">7</span> <span class="o" style="color: #666666;">==</span> <span class="n">line</span><span class="o" style="color: #666666;">.</span><span class="n">rfind</span><span class="p">(</span><span class="s" style="color: #4070a0;">'Y'</span><span class="p">):</span> <span class="c" style="color: #60a0b0; font-style: italic;">#found a line with both X and Y</span>
<span class="n">oldx</span> <span class="o" style="color: #666666;">=</span> <span class="n">line</span><span class="p">[</span><span class="mi" style="color: #40a070;">1</span><span class="p">:</span><span class="mi" style="color: #40a070;">7</span><span class="p">]</span> <span class="c" style="color: #60a0b0; font-style: italic;">#extract old X</span>
<span class="n">oldy</span> <span class="o" style="color: #666666;">=</span> <span class="n">line</span><span class="p">[</span><span class="mi" style="color: #40a070;">8</span><span class="p">:</span><span class="mi" style="color: #40a070;">15</span><span class="p">]</span> <span class="c" style="color: #60a0b0; font-style: italic;">#extract old Y</span>
<span class="n">line</span> <span class="o" style="color: #666666;">=</span> <span class="s" style="color: #4070a0;">'X' </span><span class="o" style="color: #666666;">+ </span><span class="nb" style="color: #007020;">str</span><span class="p">(</span><span class="n">xoff </span><span class="o" style="color: #666666;">+ </span><span class="nb" style="color: #007020;">int</span><span class="p">(</span><span class="n">oldx</span><span class="p">))</span><span class="o" style="color: #666666;">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi" style="color: #40a070;">6</span><span class="p">) </span><span class="o" style="color: #666666;">+ </span><span class="s" style="color: #4070a0;">'Y' </span><span class="o" style="color: #666666;">+ </span><span class="nb" style="color: #007020;">str</span><span class="p">(</span><span class="n">yoff </span><span class="o" style="color: #666666;">+</span><span class="nb" style="color: #007020;">int</span><span class="p">(</span><span class="n">oldy</span><span class="p">))</span><span class="o" style="color: #666666;">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi" style="color: #40a070;">6</span><span class="p">) </span><span class="o" style="color: #666666;">+ </span><span class="s" style="color: #4070a0;">'</span><span class="se" style="color: #4070a0; font-weight: bold;">\n</span><span class="s" style="color: #4070a0;">'</span> <span class="c" style="color: #60a0b0; font-style: italic;">#build new line</span>
<span class="k" style="color: #007020; font-weight: bold;">elif</span> <span class="mi" style="color: #40a070;">0</span> <span class="o" style="color: #666666;">==</span> <span class="n">line</span><span class="o" style="color: #666666;">.</span><span class="n">rfind</span><span class="p">(</span><span class="s" style="color: #4070a0;">'X'</span><span class="p">):</span> <span class="c" style="color: #60a0b0; font-style: italic;">#found a line with only X</span>
<span class="n">oldx</span> <span class="o" style="color: #666666;">=</span> <span class="n">line</span><span class="p">[</span><span class="mi" style="color: #40a070;">1</span><span class="p">:</span><span class="mi" style="color: #40a070;">7</span><span class="p">]</span> <span class="c" style="color: #60a0b0; font-style: italic;">#extract old X</span>
<span class="n">line</span> <span class="o" style="color: #666666;">=</span> <span class="s" style="color: #4070a0;">'X'</span> <span class="o" style="color: #666666;">+</span> <span class="nb" style="color: #007020;">str</span><span class="p">(</span><span class="n">xoff</span> <span class="o" style="color: #666666;">+</span> <span class="nb" style="color: #007020;">int</span><span class="p">(</span><span class="n">oldx</span><span class="p">))</span><span class="o" style="color: #666666;">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi" style="color: #40a070;">6</span><span class="p">)</span> <span class="o" style="color: #666666;">+</span> <span class="s" style="color: #4070a0;">'</span><span class="se" style="color: #4070a0; font-weight: bold;">\n</span><span class="s" style="color: #4070a0;">'</span> <span class="c" style="color: #60a0b0; font-style: italic;">#build new line </span>
<span class="k" style="color: #007020; font-weight: bold;">elif</span> <span class="mi" style="color: #40a070;">0</span> <span class="o" style="color: #666666;">==</span> <span class="n">line</span><span class="o" style="color: #666666;">.</span><span class="n">rfind</span><span class="p">(</span><span class="s" style="color: #4070a0;">'Y'</span><span class="p">):</span> <span class="c" style="color: #60a0b0; font-style: italic;">#found a line with only Y</span>
<span class="n">oldy</span> <span class="o" style="color: #666666;">=</span> <span class="n">line</span><span class="p">[</span><span class="mi" style="color: #40a070;">1</span><span class="p">:</span><span class="mi" style="color: #40a070;">7</span><span class="p">]</span> <span class="c" style="color: #60a0b0; font-style: italic;">#extract old Y</span>
<span class="n">line</span> <span class="o" style="color: #666666;">=</span> <span class="s" style="color: #4070a0;">'Y'</span> <span class="o" style="color: #666666;">+</span> <span class="nb" style="color: #007020;">str</span><span class="p">(</span><span class="n">yoff</span> <span class="o" style="color: #666666;">+</span> <span class="nb" style="color: #007020;">int</span><span class="p">(</span><span class="n">oldy</span><span class="p">))</span><span class="o" style="color: #666666;">.</span><span class="n">zfill</span><span class="p">(</span><span class="mi" style="color: #40a070;">6</span><span class="p">)</span> <span class="o" style="color: #666666;">+</span> <span class="s" style="color: #4070a0;">'</span><span class="se" style="color: #4070a0; font-weight: bold;">\n</span><span class="s" style="color: #4070a0;">'</span> <span class="c" style="color: #60a0b0; font-style: italic;">#build new line</span>
<span class="n">o</span><span class="o" style="color: #666666;">.</span><span class="n">write</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="c" style="color: #60a0b0; font-style: italic;">#write this line to new file</span>
<span class="n">i</span><span class="o" style="color: #666666;">.</span><span class="n">close</span><span class="p">()</span> <span class="c" style="color: #60a0b0; font-style: italic;">#Close the input file</span>
<span class="n">o</span><span class="o" style="color: #666666;">.</span><span class="n">close</span><span class="p">()</span> <span class="c" style="color: #60a0b0; font-style: italic;">#Close the output file</span></span></pre>
<br />
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;">
New Gerber File</span></h4>
<div>
Below you can see the preview of the corrected Gerber files and a detailed view of the drill hole and pad being used as our reference. Note the three red dots on the left are mounting holes for the 9V battery holder and do not have copper pads.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioPZIDJjDbMAlav708S5QDj0AB8R1CO3TYaI0jkIgc3z97ye5f_xrcfUm-2lg4o0rB3htC9wgj-yT2Qd5BcsgARlDKozxQ1uSCSd1zCZMrk-NkKe5zjFkabf_4b8TavTyzJzkX/s1600/Gerber+drill+offset+corrected.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEioPZIDJjDbMAlav708S5QDj0AB8R1CO3TYaI0jkIgc3z97ye5f_xrcfUm-2lg4o0rB3htC9wgj-yT2Qd5BcsgARlDKozxQ1uSCSd1zCZMrk-NkKe5zjFkabf_4b8TavTyzJzkX/s1600/Gerber+drill+offset+corrected.jpg" height="443" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The holes and pad now appear to be aligned.</td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Up5h_wE5FnOT6fXzKk4lUVqnFFkB0O4O0s2qizYhAzdIyQy1TYNFZebLehVWHf3pTGR_eNRrOoWLS0j-80wmDgkvJocHWVvFoJYcOgac4MD5fvyOgtX1rwRRAGhv7R7VZMvg/s1600/Gerber+drill+offsett+corrected+detail.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7Up5h_wE5FnOT6fXzKk4lUVqnFFkB0O4O0s2qizYhAzdIyQy1TYNFZebLehVWHf3pTGR_eNRrOoWLS0j-80wmDgkvJocHWVvFoJYcOgac4MD5fvyOgtX1rwRRAGhv7R7VZMvg/s1600/Gerber+drill+offsett+corrected+detail.jpg" height="443" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Success! This magnified view of a hole/pad pair reveals very close alignment.</td></tr>
</tbody></table>
<div>
</div>
<div>
<br /></div>
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;">
Board Fabrication</span></h4>
I planed to have the boards fabed at <a href="https://oshpark.com/" target="_blank">OSH Park</a> (3 very nice boards for $5 per square inch) but then I realized the board is 16 square inches which would be $80 for three boards! For me this is a just-for-fun project, I was willing to spend $25 for a single board but $80 seemed a little high. Since I can wait on the boards, I decided to use this as an opportunity to try out one of the cheap overseas fabs. I selected iTead Studio and was able to order 10 boards delivered for $28.88 US. Here is a link to the fabrication package that I selected.<br />
<a href="http://imall.iteadstudio.com/open-pcb/pcb-prototyping/im120418003.html" target="_blank">http://imall.iteadstudio.com/open-pcb/pcb-prototyping/im120418003.html</a><br />
<br />
Here is the zip file of Gerbers that I send to be fabbed.<br />
<a href="https://www.dropbox.com/s/lbwdg40l9ib7k3e/ConstCurrentFixed.zip">https://www.dropbox.com/s/lbwdg40l9ib7k3e/ConstCurrentFixed.zip</a><br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUfGJHRULKp_JhLLdXmcgqh4hgXvW1vy4FpBz7d-uo25cuR6AIIWQaBxMiI4j9JqB9q9nnzGCRrcNkqpKM8zHYZrXXIv98aI_BsZOsOCxbxnEVuZ4L8UUljpW319H_ECi9OF1Y/s1600/PCB+fabbed.jpg" imageanchor="1" style="display: inline !important; margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUfGJHRULKp_JhLLdXmcgqh4hgXvW1vy4FpBz7d-uo25cuR6AIIWQaBxMiI4j9JqB9q9nnzGCRrcNkqpKM8zHYZrXXIv98aI_BsZOsOCxbxnEVuZ4L8UUljpW319H_ECi9OF1Y/s1600/PCB+fabbed.jpg" height="480" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Fresh from the iTeadStudio fab. The holes are aligned and the boards look great.</td></tr>
</tbody></table>
<br />
<br />
The finished boards look great and the drill holes line up nicely with the pads. I enjoyed learning how to use Python process text files and correct the drill file for the printed circuit board. I hope this information can be of use to you in your projects.<br />
<br />
<br />
<br />
<br />
<h3>
</h3>
<br />Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-11365986829592630022014-02-10T16:35:00.000-05:002016-05-18T08:08:45.263-04:00Addressable LED Jacket<b><span style="font-size: large;">LED Jackets</span></b><br />
<br />
This is a fast and dirty post to share a few notes on a my LED jacket project. I wanted to do a project using the addressable strips of LED's. I saw that Ada fruit had a lower density strip, only 30 LED's per meter, for $17. I decided to make LED jackets for me and my wife.<br />
<br />
We ordered 4 meters. Interestingly the strips came as one continuous piece but you could tell that they were soldered up from several separate pieces. The segments were not always the same length and the solder joints were of varying quality. Look under TUTORIALS in the product information to see some of the projects done using the NeoPixel strips.<br />
http://www.adafruit.com/products/1460<br />
<br />
This Adafruit guide has everything you could want to know about the NeoPixels and how to communicate with them. My experiments have consisted primarily of modifying the examples given in the guide.<br />
http://learn.adafruit.com/adafruit-neopixel-uberguide<br />
<br />
I also used a force sensor to allow the LED's to respond to user input.<br />
http://www.adafruit.com/products/166<br />
<br />
We purchase two inexpensive fleece jackets to use the LED's. I pulled Arduino Uno's from other projects for control. The power wiring was done with 20 ga wire that was routed from one pocket and around the back of the jacket using the existing channel provided for an elastic cinch. The power was routed to the bottom of each strip. The power was a 3 AA battery pack with built-in switch. The data lines used wire-wrap wire that was sewn into the jacket.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUrGK8vvsCKB7a5Z5rD6eNgANZ7hhqYqAlzGHVqrBEHsFeekNwQH8uI16ynKFUSVot7nU4JbmFUzT4DPXB0PsmmCu-ZuYQsBfR61-HoMWGUO_xY1714Wex47T1Pi3l64XxTy4x/s1600/IMG_3605.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUrGK8vvsCKB7a5Z5rD6eNgANZ7hhqYqAlzGHVqrBEHsFeekNwQH8uI16ynKFUSVot7nU4JbmFUzT4DPXB0PsmmCu-ZuYQsBfR61-HoMWGUO_xY1714Wex47T1Pi3l64XxTy4x/s1600/IMG_3605.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
We purchase 2m for each jacket for a total of 60 LED's per jacket. We decided to use the strips vertically in strips of 10 with 3 strips on the left front and 3 strips on the right front. We used blue painter's tape to define the top and bottom placement of the strips. I recommend mounting the strips a few inches higher on the jacket. I mounted mine as low as possible to match up better with the height of the strips on my wife's jacket (since I am a little taller)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidl-FE9vOCdqA02wWhRJhD0wiOYY4quKC3YuRaIQwcsuvyogDk32QpQGyeIXdf88SQxC5W9jqEfhUKMiIWKLE4kOGD3_oiXETtXE4mrnF00GH7Jpqt7lOnSuKL4LsksqyBbhyphenhyphen_/s1600/IMG_3622.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidl-FE9vOCdqA02wWhRJhD0wiOYY4quKC3YuRaIQwcsuvyogDk32QpQGyeIXdf88SQxC5W9jqEfhUKMiIWKLE4kOGD3_oiXETtXE4mrnF00GH7Jpqt7lOnSuKL4LsksqyBbhyphenhyphen_/s1600/IMG_3622.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
We then placed marks for the strips on the tape for equal spacing. .</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmjV9f1cdX8E-n1PQV4r-hxduaxQ62W8h7A86oUxABYs4OqNXVUMpCz8ZYfXTJMU6UQaH0kGuPU3FsTDGOgsepRbS6FyLjIGSB9MEAU3oAReskWQB0kXkTEeY4-r84hw17bSHB/s1600/IMG_3612.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmjV9f1cdX8E-n1PQV4r-hxduaxQ62W8h7A86oUxABYs4OqNXVUMpCz8ZYfXTJMU6UQaH0kGuPU3FsTDGOgsepRbS6FyLjIGSB9MEAU3oAReskWQB0kXkTEeY4-r84hw17bSHB/s1600/IMG_3612.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
I thought this looked like a good adhesive for the project. We considered sewing the strips into the jacket but there were no holes in the pcb's large enough for a sewing needle. (Anyone want to make LED strips with sewing size holes?) The glue tool was used to spread the adhesive on the back of the strips.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWwWzYgxIHDYXjiTuvWJ4qM4jLCAPGbljckG1dd_ZcLtRpjlxkE9SGae_RuAadgLar-5yjL-Y03M_d_hWFgpboigOEhifjRj5DkDunwozxKV3gF_o1ZmtDhnjnRO16MryLnste/s1600/IMG_3613.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWwWzYgxIHDYXjiTuvWJ4qM4jLCAPGbljckG1dd_ZcLtRpjlxkE9SGae_RuAadgLar-5yjL-Y03M_d_hWFgpboigOEhifjRj5DkDunwozxKV3gF_o1ZmtDhnjnRO16MryLnste/s1600/IMG_3613.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
We put a generous bead of adhesive on the strip. Stop short of the ends to allow easy access to the pcb for soldering the wires. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3x9ZEfmq20frpEMe3i3TQXxttBVDmQoyantaP2rhNV-rv043pcyXMTg8xuWAPD3OUw5G6ElQNGlIxR9fuJjgiBYZx1SCewSeW2V2KntgHOU5K7T8kdxk9Wc9MO3iQ7Rb4uXyj/s1600/IMG_3606.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3x9ZEfmq20frpEMe3i3TQXxttBVDmQoyantaP2rhNV-rv043pcyXMTg8xuWAPD3OUw5G6ElQNGlIxR9fuJjgiBYZx1SCewSeW2V2KntgHOU5K7T8kdxk9Wc9MO3iQ7Rb4uXyj/s1600/IMG_3606.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Use the glue tool to spread the adhesive, again keeping away from the last inch or so near the end of the strip.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAH4xiwtd2TsfC3fqEElaHoVcsc0sNMdAgkOzG3GG5XGdhIn7WwEAc0p6JgDpLjlKxXW82FJ6DC1_h5De4mzlxD_2E0Id_wqpeX9vzdMkdfFqfRXy0NNDZgXKIxEGUQ60lnGKZ/s1600/IMG_3625.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAH4xiwtd2TsfC3fqEElaHoVcsc0sNMdAgkOzG3GG5XGdhIn7WwEAc0p6JgDpLjlKxXW82FJ6DC1_h5De4mzlxD_2E0Id_wqpeX9vzdMkdfFqfRXy0NNDZgXKIxEGUQ60lnGKZ/s1600/IMG_3625.JPG" width="320" /></a></div>
An oops moment came when I managed to pull off a pad from one of the data lines! Not sure if I over heated the joint (probably) or if I damaged the strip when cutting them. Or I might have just pulled too hard on the wire when working on the jacket.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhneLLuwqeq8bu-d1qRH1NJbJeSH4mpyAuKwC_l87Umfgio-RJBvRgjV8GKT4GDtr3Jh375_Tb2bZJBCqAnwSxqwJbp15ma8oi7bDKbeXrB0exmXhWKJVyE8IYS529iyoLMM4p-/s1600/IMG_3632.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhneLLuwqeq8bu-d1qRH1NJbJeSH4mpyAuKwC_l87Umfgio-RJBvRgjV8GKT4GDtr3Jh375_Tb2bZJBCqAnwSxqwJbp15ma8oi7bDKbeXrB0exmXhWKJVyE8IYS529iyoLMM4p-/s1600/IMG_3632.JPG" width="320" /></a></div>
I had conductive copper tape from another project that I cut down to make a piece small enough to wrap around the end of the pad.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh-c57zJ5CkS_9mqNquWh2kzGVPDQNBqCPUJWWSYNh-p-pRCaMmV2OQN3GixIbHU0M-ytT8pzZHhr0D5_A7voHVmjdsSIOaNUmQrOYejmtMIga7BEu3kp04Laa0Mc7fCgeGt2V/s1600/IMG_3631.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgh-c57zJ5CkS_9mqNquWh2kzGVPDQNBqCPUJWWSYNh-p-pRCaMmV2OQN3GixIbHU0M-ytT8pzZHhr0D5_A7voHVmjdsSIOaNUmQrOYejmtMIga7BEu3kp04Laa0Mc7fCgeGt2V/s1600/IMG_3631.JPG" width="320" /></a></div>
Bottom view of the tape before soldering.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgac5dwMv0WxGNEuclmu4kdSrrBDvVXVMfzc2lkEtQy-MivdkCs2NAj0rDqjYAAZ2vEZY_eKUSLZ__HkixyOyD5AMCfJZfU7FTY4O_9SPDNAQN13tpG20n_0VJcuJpJxJvcUbBE/s1600/IMG_3634.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgac5dwMv0WxGNEuclmu4kdSrrBDvVXVMfzc2lkEtQy-MivdkCs2NAj0rDqjYAAZ2vEZY_eKUSLZ__HkixyOyD5AMCfJZfU7FTY4O_9SPDNAQN13tpG20n_0VJcuJpJxJvcUbBE/s1600/IMG_3634.JPG" width="320" /></a></div>
A quick dab with a soldering iron and the pad was usable.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy1ULT-J2hgSE6NjavB4bUS26zojrxpWVV3Bc6qHonWydMpa_iuqhtPkVgXEoDu_gF5uQIE8SEGOY6CXAdV7YVRAb7j1WYA_vL-OmeXqOOfHVJyY4L45516-HK10kQnP5AsE5d/s1600/IMG_3635.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjy1ULT-J2hgSE6NjavB4bUS26zojrxpWVV3Bc6qHonWydMpa_iuqhtPkVgXEoDu_gF5uQIE8SEGOY6CXAdV7YVRAb7j1WYA_vL-OmeXqOOfHVJyY4L45516-HK10kQnP5AsE5d/s1600/IMG_3635.JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
Bottom view of the soldered pad.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4jp9FAWfHqFkUFzX3C7MzqOFKlvQIpasq0H541nnZ0by8OpoLgzUbbBM_WPtaWeTE5L3zgiLCbL8yJ6TUBLD-XA0qi2Z2AyZKYH3IyEkuWm5Grry49j-atqwWQhjD8h5WZQrg/s1600/IMG_3645.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4jp9FAWfHqFkUFzX3C7MzqOFKlvQIpasq0H541nnZ0by8OpoLgzUbbBM_WPtaWeTE5L3zgiLCbL8yJ6TUBLD-XA0qi2Z2AyZKYH3IyEkuWm5Grry49j-atqwWQhjD8h5WZQrg/s1600/IMG_3645.JPG" width="320" /></a></div>
Here you can see the Uno with the wire-wrap wire connections sewn into the jacket. The Uno draws much less power than the LED strip so the smaller gauge wire was not an issue. Power to the LED's is provided directly from the battery pack by 20ga wire that is not visible in this image. You can also see the Velcro used to mount the Uno.<br />
<br />
I ended up writing a sketch to do random color flickering of the pixels. I set one of the jackets to only use red and green to flicker them randomly as a percentage of the total pixels. This made it easy to tune the ratio of lit pixels to dark pixels.<br />
<br />
I also used the pressure sensor to increase the percentage of pixels illuminated. This allow me to set the jacket to just light a couple of pixels until I pressed on the sensor. Only a little pressure was required to shift from a few pixels to all of the pixels lit in random changing colors.<br />
<br />
I did some pixel dropping effects in orange for Halloween but need to find some photos.<br />
<br />
Here is a video of the jacket's scrolling text.<br />
<a href="https://www.facebook.com/photo.php?v=10202258702178156">https://www.facebook.com/photo.php?v=10202258702178156</a><br />
<br />
My wife iceskating in her jacket at Rockefeller Center.<br />
<a href="https://www.facebook.com/photo.php?fbid=10202317975139943&set=pcb.10202317984140168&type=1&relevant_count=1">https://www.facebook.com/photo.php?fbid=10202317975139943&set=pcb.10202317984140168&type=1&relevant_count=1</a><br />
<br />Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com0tag:blogger.com,1999:blog-6265457.post-71698940653230359812014-01-15T11:36:00.004-05:002018-04-03T10:59:56.284-04:00Reducing Voltage Divider Load to Extend Battery Life<b><span style="font-family: "arial" , "helvetica" , sans-serif;">FET Switched Voltage Dividers</span></b><br />
<br />
A few months back there was a discussion about battery monitoring at a TriEmbed meeting. Someone suggested using a n-type MOSFET between the bottom resistor of a voltage divider and ground to save power. The concept is that the microcontroller would use a digital IO line to drive the n-FET on for a measurement and then disconnect the voltage divider from the system/battery ground, reducing the divider current to zero. However modern microcontrollers include protection diodes from input pins to Vcc and GND to protect the pins from electrostatic discharge. So the ESD diodes will clamp the voltage on the resistor to Vcc + diode drop and conduct current from the battery positive, through the divider upper resistor into the ESD diode and to ground.<br />
<br />
However, a user comment on the Jee Labs blog illustrates a novel approach to use a p-FET to disconnect the voltage divider to reduce the power loss in the divider to zero (see links). You can access my reference sites and documents using the links provided at the end of the text.<br />
<br />
The image below, from the Atmel app-note listed in the References, illustrates the internal protection diodes present in an ATmega168 microcontroller. The Atmel document lists 5.5 volts as the clamped voltage for an AVR input pin. The PIC series from Microchip use the same ESD approach and can do mains monitoring in the same fashion.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY_2bdSUi4-P9xownSZbxxHM1O1wVJ3nBbx-eX00J9aveHaO7wpd261fSaCI9Oy7LZxvs7YkwW5DcL6ouP7Zjkg6eu0C3CIgQRudmvlnT0IEq0RfBhGU218CMmw1siop69L5w_/s1600/AVR+Zero-Cross+detector.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhY_2bdSUi4-P9xownSZbxxHM1O1wVJ3nBbx-eX00J9aveHaO7wpd261fSaCI9Oy7LZxvs7YkwW5DcL6ouP7Zjkg6eu0C3CIgQRudmvlnT0IEq0RfBhGU218CMmw1siop69L5w_/s320/AVR+Zero-Cross+detector.jpg" width="320" /></a></div>
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Examples</span></b><br />
To keep the math simple we will use 1k resistors to illustrate the change in battery life for a very simple circuit. You can use larger divider resistors to reduce the divider current but you will still see a similar change in sleep current due to the voltage divider switching between an N-FET and P-FET.<br />
<br />
Note that the calculations assume that the N-FET and P-FET have negligible resistance compared to the voltage divider. I have calculated the sleep and wake current to allow us to use a battery life calculator to estimate the impact of the three circuit options on projected operating time. <br />
<br />
While a versatile development board, the Uno does not lend itself to low-power battery applications.The Uni has a voltage regulator with Iq of 6mA as well as USB interface and LED that are always on. The easiest way to avoid all of these is to use a smaller form factor board with a low standby current, no power LED's and no extra USB chip. An Arduino Pro Mini looks like a good candidate, link provided.<br />
<br />
Example. 9V Alkaline battery, 565mAh, Voltage divider, divide by 2, R1=R2=1k ohm.<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></b>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><b>Fixed Divider</b></span><br />
Typical fixed voltage divider that would allow a 5V microcontroller to monitor a 9V battery. The 5V regulator and microcontroller are not shown.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyoJx93Fr1cIz-5Xs-tkVCjpE268KFG_I-TIFITCCH1J9jjkCuv09StYBEbdiUQrstn890YlWjcFjsr2SS3bH2ySsbkEZEWgtbK7rzpLhfszf2-IVcXH__ksb0PzT6g6K54gNO/s1600/Votlage+Divider.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="234" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyoJx93Fr1cIz-5Xs-tkVCjpE268KFG_I-TIFITCCH1J9jjkCuv09StYBEbdiUQrstn890YlWjcFjsr2SS3bH2ySsbkEZEWgtbK7rzpLhfszf2-IVcXH__ksb0PzT6g6K54gNO/s320/Votlage+Divider.jpg" width="320" /></a></div>
<br />
The voltage divider would typically be connected to input power leg of the voltage regulator and receive power the entire time the project is switched on. The microcontroller would, among other tasks, periodically check the battery voltage and indicate to the user when the battery voltage had dropped enough that the battery should be replaced.<br />
<br />
<div>
Voltage divider enabled current. 9V/2k = 4.5mA<br />
Voltage divider disabled current = doesn't apply, it is always on<br />
<br /></div>
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">N-FET</span></b><br />
Voltage divider with ground leg switched by an N-FET.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDrxV3shU8ZZeTiZPBVmSs6y1p8aNOs3AFT-eh_8YyNghI1RQ7d0LjyEM-SX_Yx9pIWZVsElfi6mo4nVZ2AIX_FJYwUMuNq4bOUT-B0pEacZUedBgEKTgJuhoq24kNHvaTvEs3/s1600/Voltage+Divider+N-FET.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDrxV3shU8ZZeTiZPBVmSs6y1p8aNOs3AFT-eh_8YyNghI1RQ7d0LjyEM-SX_Yx9pIWZVsElfi6mo4nVZ2AIX_FJYwUMuNq4bOUT-B0pEacZUedBgEKTgJuhoq24kNHvaTvEs3/s320/Voltage+Divider+N-FET.jpg" width="320" /></a></div>
<br />
The N-FET disconnects the bottom leg of the voltage divider from battery negative when DIO is driven low and would appear to prevent current from flowing from the battery but this is not actually the case. The Atmel app-note above indicates that the protection diodes will clamp the input terminal at Vcc + 0.5V. So even when the FET is disconnected, the input terminal clamps at 5.5 volts, producing the current below.<br />
<br />
Voltage drop across R1 with n-FET off = Vin - Vclamp = 9V - 5.5V = 3.5V<br />
Current through R1 with n-FET off 3.5V/1k = 3.5mA<br />
<br />
Voltage divider enabled current. 9V/2k = 4.5mA<br />
Voltage divider disabled current = 3.5mA<br />
<br />
So the n-FET did reduce the sleep state load of the voltage divider but only from 4.5mA to 3.5mA!<br />
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">P-FET</span></b><br />
User <a href="http://jeelabs.org/2013/05/18/zero-power-measurement-part-2/">comments </a>on the Jee Labs blog points to using a voltage divider with the top leg switched by P-FET using a capacitor pulsed gate.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiD6uD1dbfHqnfrEyVTFssM17XxmHZzKobgm6kjaAZ1bicDaRyfbDtjq62qlYW_VgPOL9xI3yUiBkMFPz18avSergW14iFFcd9suvchy1UI9YgHiod8RLqUY1RdezhI5q81k3y/s1600/Voltage+Divider+P-FET.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="292" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiD6uD1dbfHqnfrEyVTFssM17XxmHZzKobgm6kjaAZ1bicDaRyfbDtjq62qlYW_VgPOL9xI3yUiBkMFPz18avSergW14iFFcd9suvchy1UI9YgHiod8RLqUY1RdezhI5q81k3y/s320/Voltage+Divider+P-FET.jpg" width="320" /></a></div>
<br />
The P-FET responds to a pulse from the DIO line and turns on for approximately 2 milliseconds for the 10k and 0.1uF values provided. This means the microcontroller has 2ms to take the measurement and this 2ms is the only time the voltage divider loads the battery.<br />
<br />
<div>
Current through R1 with p-FET off = 0mA (open circuit)</div>
<div>
Voltage divider enabled current. 9V/2k = 4.5mA<br />
Voltage divider disabled current = 0 mA<br />
<br />
The p-FET reduced the sleep state load of the voltage divider to effectively 0mA.</div>
<div>
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">Battery Life Calculations</span></b><br />
We focus only on the impact of the divider current and assume the other currents are zero. Looking at only the divider current and wake once a minute for 2ms to record the battery voltage, with a 9V battery with 565mA/hr capacity the Battery Life Calculator (link provided below) yields the following numbers for expected operating life:<br />
<br />
No switch on voltage diver (sleep=4.5mA, wake=4.5mA) => battery life = 3.92 days<br />
N-FET on Low Side switch (sleep=3.5mA, wake=4.5mA) => battery life = 4.88 days</div>
<div>
P-FET on High-Side of divider (sleep=0.0mA, wake=4.5mA) => battery life = 33.34 days</div>
<div>
<br /></div>
<div>
As you can see, the trick of driving the P-FET gate through a capacitor allowed us to boost the expected battery life from just under 4 days to over 33 days, an improvement of over 8x! Note that you can use higher value resistors without a FET switch but you would still see the divider burden current all the time. The burden of even high value value resistors can be important when you are trying to shave every uA from your project and squeeze operating time from a coin cell or energy harvester. And you can still combine higher value dividers with a p-FET for an 8x improvement in battery life</div>
<div>
<br />
I hope this information is helpful.<br />
<br />
-Shane<br />
<br />
<br />
<b><span style="font-family: "arial" , "helvetica" , sans-serif;">References</span></b><br />
Atmel AVR app-note discussing input pin clamp diodes.<br />
<a href="http://www.atmel.com/images/doc2508.pdf">http://www.atmel.com/images/doc2508.pdf</a><br />
<br />
Voltage regulator for Uno, click Specification tab to find Iq on table. (Iq=6mA)<br />
<a href="http://www.onsemi.com/PowerSolutions/product.do?id=NCP1117DT50G">http://www.onsemi.com/PowerSolutions/product.do?id=NCP1117DT50G</a><br />
<br />
Sparkfun Arduino Pro Mini<br />
<a href="https://www.sparkfun.com/products/11113">https://www.sparkfun.com/products/11113</a><br />
<br />
Voltage regulator for Arduino Pro Mini (quiescent current 5 uA)<br />
<a href="http://www.micrel.com/_PDF/mic5205.pdf">http://www.micrel.com/_PDF/mic5205.pdf</a><br />
<br />
Lightweight Low Power Arduino Library, power numbers, can get a 328p down to 1.7uA!<br />
<a href="http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/">http://www.rocketscream.com/blog/2011/07/04/lightweight-low-power-arduino-library/</a><br />
<br />
Article on generating +5V directly from incoming AC line without transformers.<br />
<a href="http://ww1.microchip.com/downloads/en/appnotes/00954a.pdf">http://ww1.microchip.com/downloads/en/appnotes/00954a.pdf</a><br />
<br />
Article showing Microchip PIC being used directly on AC line for lamp dimmer.<br />
<a href="http://ww1.microchip.com/downloads/en/appnotes/91094a.pdf">http://ww1.microchip.com/downloads/en/appnotes/91094a.pdf</a><br />
<br />
Excellent battery life calculator with capacities listed for common batteries.<br />
<a href="http://oregonembedded.com/batterycalc.htm">http://oregonembedded.com/batterycalc.htm</a><br />
<br />
Link discussing the use of a P-FET to disconnect voltage divider to save power.<br />
<a href="http://jeelabs.org/2013/05/18/zero-power-measurement-part-2/">http://jeelabs.org/2013/05/18/zero-power-measurement-part-2/</a><br />
<br />
Funny things happen when you drop below minimum input voltage on some low power regulators<br />
<a href="http://jeelabs.org/2011/06/21/mcp1702-current-draw/">http://jeelabs.org/2011/06/21/mcp1702-current-draw/</a><br />
<br /></div>
Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com7tag:blogger.com,1999:blog-6265457.post-39095081909978056912013-08-14T18:27:00.003-04:002014-04-08T08:32:54.670-04:00Why is my FET hot? Circuit detective work...I was using an ATtiny85 to drive a large computer fan (brushless DC motor) using a FET and pulse-width modulation and I was surprised at the amount of audible noise. A quick Google search turned up the article below on reducing PWM noise with BDC motors. In short, the article recommends using a resistor and capacitor to slow down the turn-on time (slew rate) of the FET to reduce acoustic noise.<br />
<br />
<a href="http://ww1.microchip.com/downloads/en/AppNotes/00771b.pdf">http://ww1.microchip.com/downloads/en/AppNotes/00771b.pdf</a><br />
<br />
I tried the recommended approach with the FET below (it is a hefty 75 amp, N-FET with an on resistance of 0.002 ohms that I usually have in my parts bin). The fan did run much quieter but the FET was getting HOT with only a 5A load!<br />
<br />
<a href="http://www.irf.com/product-info/datasheets/data/irf2804.pdf">http://www.irf.com/product-info/datasheets/data/irf2804.pdf</a><br />
<br />
I expect that a TO-220 package can dissipate 1 to 1.5 Watts before needing a heat sink. Using 1.5 W as an upper limit and applying P=(I^2)R, the FET should conduct 27.4 amps without getting too hot to touch (a very subjective measure I know). At 5 amps, the power loss in the FET should be about 0.05 W, not enough to even get warm.<br />
<br />
Perhaps the slowing of the gate on the FET was causing the heating. (Very slow gate transitions can cause a FET to heat up because they spend so long conducting current in the linear resistive region before the FET reaches it's low resistance at full turn on.) So I let the FET cool and removed the slew rate limiting capacitor and tried running the fan at full power. Under these conditions the FET should remain cool to the touch. But the FET heated up very quickly. I was perplexed. The gate voltage was only 4.5 volts from the ATtiny but I though that would be enough for only a 5 amp load. So back to the FET datasheet.<br />
<br />
The answer came from taking a closer look at Figure 1 from the datasheet, below. The figure shows a family of curves with each curve showing the FET current as a function of the voltage across the FET (Vds) at a given fixed gate voltage (Vgs).<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjInoyMBZk-ZojIZBhUmCT3HiBmQ2LFNyiuaSR3ZFhbZHD4ytbobIzFeW2rnaLPwId2nJ4R1guWUdIzSYPhcWd_UUGa7NICBY87c1ekOEGh75Y0EyPRUGvggF5shjb1uAbb7V4o/s1600/IRF2084+Figure+1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjInoyMBZk-ZojIZBhUmCT3HiBmQ2LFNyiuaSR3ZFhbZHD4ytbobIzFeW2rnaLPwId2nJ4R1guWUdIzSYPhcWd_UUGa7NICBY87c1ekOEGh75Y0EyPRUGvggF5shjb1uAbb7V4o/s640/IRF2084+Figure+1.jpg" height="640" width="584" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
I finally noticed that the VGS=4.5V curve shows that the FET gate requires almost 11 volts (Vds) to reach 5 amps! This would be 55W of dissipation in the FET while driving only a 5A load. No wonder the FET is hot! I had not bothered to see if the devices was rated for logic-level drive and clearly it is not! I should have checked the datasheet before using the 2804 but it has such a low Rds that I thought it would have no problems with the 5A load. So I need to either switch to a logic level FET or find a way to raise the gate voltage.<br />
<br />
A quick on-line search points to a good candidate in the IRLB8748PbF which has an Rds of 5.5 mOhm at Vgs=4.5V and would fit the bill nicely with a current limit of over 16A for a 1.5W dissipation. At our 5A current the power dissipation would still be less than 0.14W and should run cool.<br />
<br />
<a href="http://www.irf.com/product-info/datasheets/data/irlb8748pbf.pdf">http://www.irf.com/product-info/datasheets/data/irlb8748pbf.pdf</a><br />
<br />
I could also use a gate pull-up resistor to Vin (12 volts) on the FET that I pull down with an NPN transistor driven by the ATtiny. In the end, I dropped in a high-side FET driver that I had on hand. Now the original IRF2804 FET runs cool even with the slew-rate limiting capacitor installed to reduce acoustic noise! Yea!<br />
<br />
<a href="http://www.micrel.com/_PDF/mic5014.pdf">http://www.micrel.com/_PDF/mic5014.pdf</a><br />
<br />
I hope you find this helpful when chasing your next circuit gremlin. Just keep digging, there is a reason for everything the circuit is doing!<br />
<br />
<br />
PS: In post analysis, I noticed in Fig 1, that just an extra 0.5V on the gate would shift us up to the next voltage curve, reducing the FET resistance enough to bring the power well below 1.5 W. So I was not too far off in my expectation that this FET should have performed well enough in this application. A microcontroller would usually have an output closer to 5V. Perhaps I previously over-stressed the pull-up on that output pin and it was out of spec (I could have tried another pin! The joy of hindsight). Perhaps I could have added an external pull-up resistor to the FET's gate, say 5k to +5V, and let the microcontroller pull the gate down to turn it off. Not an ideal solution but may get the job done if you have few other options at hand. <br />
<br />
<br />Shane Trenthttp://www.blogger.com/profile/06540169294375742919noreply@blogger.com