Battery Drain
About The Battery Drain MicroSim
This MicroSim teaches students how batteries work in robots. The student can adjust the speed of the motor. But the more power the motor draws, the faster the battery drains. When the motor is off, there is no drain. When the battery is fully drained the motor will no longer turn.
Sample Prompt
Generate a p5.js file on a 400x400 canvas that demonstrates the
rate that a battery is discharged when it is powering a motor.
Add a slider at the bottom of the canvas that allows the user
to adjust the speed of the motor. Place the battery on the
left side. Make the negative sign be at the bottom and
use a black filled rect. Make the battery top be positive
and use a gold filled rect to draw it. Draw wires from
the battery's positive and negative to a motor in the right side.
The motor should drive a circle that spins faster as the slider is changed.
The motor should only spin if we have power.
Sample Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
Challenges
- Add a label that shows the percent of charge remaining
- Add a label that predicts how long the battery will last at the current discharge rate
- Add another button called "Recharge" that will slowly recharge the battery
- Add animation to the wires of red dots moving along the wires. Make the dots go faster at a higher power.
- Make the battery explode if you charge it too quickly
Lesson Plans
5th Grade Robotics Class Lesson Plan
Objective
- Understand the concept of battery discharge and its application in powering motors, particularly in robotics.
- Develop an understanding of how adjusting variables (like motor speed) can impact power consumption.
- Ask questions about what we do with batteries when they are discharged?
Duration
- 1 hour
Materials
- Computers with internet access to use the p5.js Web Editor.
- Projector to demonstrate the p5.js simulation.
- Printed screenshots of the p5.js canvas setup (for reference).
Introduction (10 minutes)
- Interactive Questioning: Begin by asking students about their experiences with batteries. "What devices at home use batteries?" "Have you noticed how the performance changes as the battery drains?"
- Relevance to Robotics: Discuss why robots need batteries, linking to their own experiences with battery-powered devices.
Demonstration of the Simulation (10 minutes)
- Show the p5.js Simulation: Project the simulation on the screen. Demonstrate how the motor's speed changes with the slider and how this affects battery discharge.
- Explain the Components: Point out the battery, the wires, the motor, and the spinning circle, explaining their roles.
Group Activity: Experimenting with the Simulation (20 minutes)
- Hands-On Exploration: Students work in pairs on computers to experiment with the simulation.
- Guided Inquiry: Encourage students to observe what happens as they adjust the motor speed. Does the battery discharge faster at higher speeds?
Discussion and Reflection (15 minutes)
- Group Discussion: Reconvene as a class and discuss observations. Key questions: "How did changing the motor speed affect the battery life?" "Why is this important for designing robots?"
- Connecting to Real Life: Relate the activity to real-world scenarios. "How might this knowledge impact the way we design battery-powered devices or robots?"
Conclusion (5 minutes)
- Summarize Key Learnings: Reinforce the importance of understanding battery usage in robotics and everyday devices.
- Reflect on the Activity: Ask students to share one new thing they learned and how they might apply this knowledge.
Assessment
- Participation and engagement during the activity.
- Responses during the discussion, reflecting understanding of the concept.
Follow-Up
- In the next lesson, explore other factors affecting battery life in robots, like weight or the type of task performed.
- Assign a small project where students design a simple battery-powered device or robot, considering battery life.