Embedded Systems and Design & Development - Feb 17, 2026 | Afternoon | VisionAstraa EV Academy
Overview of BMS Implementation
Introduction to BMS Functions
- The discussion begins with a recap of the morning session focused on implementing Battery Management System (BMS) aspects using embedded controllers.
- Key functions of BMS include monitoring, control, and communication, emphasizing the need for accurate data on current, voltage, and temperature.
Monitoring Parameters
- Sensors are essential for measuring voltage, current, and temperature; these measurements are critical for effective control and communication within the system.
Protection Mechanisms for Lithium Cells
- To protect lithium battery cells from over-voltage, three key components are identified:
- MOSFETs isolate the cell from the charger.
- DVS diodes suppress transient voltages.
- Fuses serve as a last line of defense that must be replaced manually once blown.
Embedded Controller Programming
Program Objectives
- The goal is to write a program that activates a MOSFET to isolate a fully charged lithium cell at 4.1 volts from its power source.
ADC Utilization
- An Analog-to-Digital Converter (ADC) will be employed to measure cell voltage; specifically using an ATmega328 microcontroller which includes built-in peripherals like ADCs and timers.
Key Parameters in ADC Selection
Essential ADC Characteristics
- Important parameters when selecting an ADC include:
- Resolution: Determines how finely it can measure voltage levels.
- Conversion Time: The time taken to convert analog signals into digital form.
- Voltage Range: The range of voltages that can be accurately sensed by the ADC.
- Number of Channels: Indicates how many different analog signals can be sampled simultaneously.
Exploring Embedded Controllers in Automotive Industry
Interactive Session on Microcontrollers
- A session is introduced where participants will explore various embedded controllers used in automotive applications to identify if they contain an ADC and its specifications.
Data Sheet Importance
- Emphasis is placed on the significance of data sheets for design engineers; they provide crucial information about electronic components necessary for effective design work.
Finding Data Sheets
Practical Search Example
- A practical example is provided where participants search for data sheets using part numbers from manufacturers or vendors like Mouser Electronics.
- It’s noted that navigating through extensive data sheets (e.g., one with 165 pages) can be time-consuming but necessary to extract specific information relevant to their projects.
Understanding ADC Resolution in Microcontrollers
Introduction to ADC and Generative Agents
- The discussion begins with a focus on the Analog-to-Digital Converter (ADC) resolution in specific microcontroller units, emphasizing the importance of consulting datasheets for accurate information.
- A generative agent, similar to ChatGPT, is introduced as a tool to quickly extract relevant data from lengthy documents without manual searching.
Utilizing Generative Agents for Data Extraction
- By querying the generative agent about the ADC resolution directly, users can efficiently find necessary information from extensive datasheets instead of sifting through hundreds of pages.
- Users are encouraged to utilize their preferred generative agents by inputting part numbers and downloading relevant datasheets for quick queries regarding ADC resolutions.
Practical Application and Findings
- The speaker mentions that they have already determined that certain microcontrollers (SD Microelectronics MCU) have a 12-bit resolution for their ADC.
- Participants are prompted to practice finding the ADC resolution for Infinion and NXP microcontrollers using both direct queries and attached datasheets.
Confirming Results Across Different Microcontrollers
- It is confirmed that both Infinion MCUs and NXP microcontrollers also feature a 12-bit ADC resolution, highlighting consistency across different manufacturers.
- The session emphasizes the utility of generative agents in obtaining manufacturer data sheet information quickly while also recommending cross-verification of results when time permits.
Understanding Accuracy with 12-Bit Resolution
- The discussion shifts towards understanding how 12-bit resolution impacts voltage measurement accuracy, noting that automotive MCUs typically default to this specification.
- The minimum measurable voltage change with a 12-bit ADC is calculated based on its ability to represent 2^12, or 4096 states within an input voltage range (0 to 5 volts).
Calculation Example: Measuring Voltage Changes
- To determine accuracy, participants are guided through calculating the smallest measurable voltage change by dividing the maximum voltage (5V) by 2^12.
- This calculation yields approximately 1.22 mV as the smallest detectable change with a 12-bit ADC, indicating high precision suitable for most applications.
Conclusion on Measurement Capabilities
- With an accuracy threshold around 1 mV, it is concluded that such precision is adequate for various practical scenarios involving these microcontrollers.
Understanding Over Voltage Protection in Lithium Cells
Monitoring Cell Voltage
- The process involves determining if the cell voltage has reached 4.1V, starting from a cutoff voltage of 3.0V. The monitoring must track incremental increases through values like 3.9V and 4.0V.
- A required accuracy of 100mV is essential for providing over-voltage protection for lithium cells, indicating that a resolution of 1.2 to 2mV is sufficient with a 12-bit ADC.
Design Considerations
- The design should incorporate an embedded controller capable of managing over-voltage protection effectively.
- Once the voltage reaches 4.1V, a semiconductor switch must be activated to isolate the charger circuit from the cell.
Data Collection and Processing
- A voltage sensor will be connected across the cell to provide an analog signal that feeds into a 12-bit ADC, which converts this signal into digital data.
- This digital information is stored in memory and processed by the CPU based on pre-stored program instructions to decide whether to open or close the switch.
Algorithm Development
- The algorithm can be outlined as follows: collect data by reading ADC values, focusing on controlling the ADC specifically.
- If the ADC voltage (VA_ADC) exceeds 4.1V, the semiconductor switch should open; otherwise, it remains closed to connect the battery cell to its charger.
Programming Choices
- Two primary programming options exist for microcontroller control: assembly language for precise resource management or higher-level languages like Embedded C.
- Embedded C is commonly used due to its popularity and ease of use compared to assembly language; other options include C++ and MicroPython.
Graphical Programming Languages
- Graphical programming languages offer advantages such as visual logic building but come with limitations compared to textual programming languages like C or assembly.
- These graphical programs utilize blocks representing operations that can be dragged and dropped into place, allowing users to assemble algorithms visually.
Upcoming Demonstration
- A brief demo on graphical programming language-based embedded controller development will occur in future classes before Friday, while current focus remains on textual programming methods.
Getting Started with Tinkercad for Circuit Simulation
Introduction to Tinkercad
- The session aims to provide a hands-on experience using online platforms, specifically focusing on Tinkercad for testing algorithms.
- Tinkercad is chosen due to its popularity and accessibility; it is a free platform suitable for circuit simulation and 3D CAD designs.
Accessing Tinkercad
- Users can log in or sign up on the welcome screen of Tinkercad. Google accounts facilitate easy access.
- After logging in, users can explore various features including simple 3D designs and circuit simulations.
Exploring Circuit Simulation Features
- Upon entering the circuit section, users will find different elements available for simulation and options for code development.
- The interface includes a "code" button that opens a Blockly environment, allowing users to develop logic through drag-and-drop blocks.
Programming Environment Overview
- Blockly provides a graphical programming interface similar to MATLAB Simulink, enabling users to build circuits visually.
- Users can switch between block-based coding and text-based instructions; this flexibility caters to varying levels of programming expertise.
Code Development Techniques
- The platform allows switching between blocks and text; modifications in one format reflect immediately in the other.
- For complex programs, transitioning from block-based development to text-based coding may be necessary as complexity increases.
Utilizing Generative Coding Agents
- Users are encouraged to leverage generative agents (like AI tools), which assist in code development by providing skeleton codes that can be fine-tuned.
- Companies are increasingly adopting these practices; notable figures like Nvidia's CEO advocate for employees using such agents for efficient coding.
Practicing with Pre-made Circuits
- Participants are encouraged to practice with pre-existing circuits available within the platform after completing their online sessions.
Understanding Basic Arduino Circuits
Overview of Arduino Components
- The status section includes various categories of basic Arduino circuits, featuring pre-made circuits with available code.
- Users can select from a wide range of components, including both active and passive elements, to build and simulate their circuits.
Simple Circuit Demonstration
- A simple circuit is introduced: a battery connected to an LED through a resistor. This setup allows for the LED to glow when the simulation starts.
- Current flows from the battery's positive terminal through the resistor into the LED, returning to the negative terminal after lighting up.
Incorporating Programmable Logic
- The discussion shifts towards incorporating programmable logic by selecting Arduino controllers for more complex simulations.
- An example circuit is chosen that reads analog values using a potentiometer, which varies resistance between 0 and 250 kiloohms.
Simulation Insights
- The potentiometer's center terminal connects to an analog port; varying its knob simulates different resistance levels in real-time during simulation.
- These platforms serve as initial testing grounds for basic logic before moving on to physical hardware implementations.
Understanding Code Structure in Arduino
- The environment resembles drag-and-drop graphical programming, simplifying embedded systems learning without needing extensive coding knowledge.
- Default code accompanies example diagrams; users can modify existing code rather than starting from scratch, streamlining development processes.
Understanding Microcontroller Programming and Over Voltage Protection
Introduction to Microcontroller Functions
- The speaker discusses the programming structure for various microcontrollers, emphasizing that while environments may differ, the fundamental flow remains consistent across platforms like TI and STM.
- Key components of a typical program include declaration sections, function declarations, and the main function, which are essential for understanding how to write effective code.
Logic Analysis in Programming
- The analog channel is set as an input while a built-in LED is declared as output. This setup allows continuous execution of logic through loop structures.
- A decision-making process based on reading values from the analog port is introduced; if the voltage is less than or equal to three volts, the LED should turn off; otherwise, it turns on.
Modifying Code Logic
- In this environment, users can only edit text mode after selecting it. The speaker encourages practicing modifications by implementing conditional statements (if constructs).
- After class, students are encouraged to modify existing code so that when the potentiometer's voltage drops below three volts, the LED turns off.
Implementing Over Voltage Protection
- To simulate over voltage protection algorithms, a potential divider circuit using two resistors will be created with a 9V battery mimicking a lithium-ion cell.
- The circuit diagram will illustrate how resistive dividers work in controlling output voltage safely within limits suitable for ADC terminals.
Calculating Resistor Values
- The importance of ensuring that output voltage does not exceed 5 volts when using a 9V source is highlighted. Proper resistor selection (R1 and R2) is crucial for achieving this.
- Using the potential divider formula V = R2/R1 + R2 times V_in , students are guided on how to calculate resistor values needed for safe operation.
Practical Application and Simulation
- Students are tasked with calculating R1's value based on selected standard resistance values. An example calculation shows that R1 should be approximately 800 ohms.
- Verification of calculations will be done using an Electronic Design Automation tool (Tinkercad), ensuring that voltages remain within safe limits before connecting to ADC terminals.
Understanding Resistor Values and Voltage Measurement
Importance of Accurate Resistor Values
- Resistors can have a tolerance of ±5% to ±10%, meaning a 1 kiloohm resistor could measure anywhere from 900 ohms to over 1 kiloohm. It's crucial to measure actual values.
Break Time Discussion
- A break was proposed, with the group deciding on a 10-minute pause before resuming discussions.
System Design Responsibilities
- After acquiring resistors R1 and R2, it's the system design engineer's responsibility to verify their actual values and ensure voltage outputs are within safe limits.
Simulation Environment Setup
- The discussion shifted back to using Tinkercad for simulations, where two resistors were already set up for measurement.
Practical vs. Theoretical Measurements
- In theoretical scenarios, exact resistor values (800 ohms and 1 kiloohm) yield precise voltage readings (5 volts). However, practical applications often introduce complexities that must be managed.
Complexities in Circuit Implementation
Challenges in Simple Circuits
- Even simple circuits require attention due to various factors affecting performance; higher-end sensors will necessitate even more careful consideration.
ADC Channel Connections
- When connecting the voltage across R2 to an ADC channel, it’s essential to reference measurements against ground for accuracy.
Reference Points in Measurements
- Potentials should always be measured relative to a reference point; in this case, terminal one of the resistor serves as the reference for measuring potential at terminal two.
Noise Management in Analog Inputs
Common Ground Issues
- All six ADC channels share a common ground reference. Noise from one channel can affect others, leading to inaccurate readings.
Differential Arrangement Benefits
- For high-fidelity measurements, differential arrangements are recommended where each analog channel has its own ground reference, minimizing cross-channel noise interference.
Final Steps in Sensor Integration
Coding Requirements Post-Wiring
- Once wiring is complete, coding remains consistent: if sensor value is below three volts at A5, turn off the built-in LED; if above or equal to three volts, turn it on.
Voltage Testing and Resistor Adjustment
Adjusting Resistor Values for Voltage Measurement
- The process begins in edit mode, where code is pasted. It's crucial to adjust resistor values to achieve a specific voltage across pin A5 before starting the simulation.
- Increasing R1 resistance results in a lower voltage drop across the second resistor; conversely, decreasing R1 increases the drop. A multimeter is used to verify these changes.
- With an 800 ohm and 1 kiloohm configuration, achieving 5 volts is confirmed. Adjusting resistance allows for testing different conditions without risking damage to the microcontroller.
- When increasing R1's resistance, a lesser voltage drop occurs (noted at 1 volt). The program logic dictates that if voltage exceeds three volts, an LED will turn on; otherwise, it remains off.
- This setup serves as a foundation for implementing over-voltage protection using a potential divider connected from the lower resistor to the ADC terminal and ground.
Objectives of Voltage Protection Implementation
- The primary goal was to test the signal conditioning network and assess how effectively the embedded controller operates under varying conditions.
Current Sensing Methods Overview
Introduction to Current Sensors
- Discussion shifts towards various current sensors with plans to design one type in future sessions. Shunt resistors are highlighted as simple yet effective current sensing methods.
- Common current sensors include shunt resistors (measuring voltage drop), Hall effect sensors (operating in open-loop fashion), and standard current transformers used in industrial applications.
Detailed Look at Shunt Resistor Method
- Shunt resistors measure current by introducing series resistance with load; Ohm's law indicates that voltage across this resistor correlates directly with current flow.
- As current increases, so does voltage across the shunt resistor. This method is straightforward but requires careful consideration of resistance values due to potential time decay effects.
Considerations for Using Shunt Resistors
- Power dissipation must be minimized when measuring currents through shunt resistors since losses can affect accuracy (expressed as I²R).
- After converting current measurements into voltage signals, isolation is necessary before interfacing with microcontrollers equipped with ADC components for safety compliance.
Current Sensing Mechanisms and Safety Levels
Overview of Safety Levels in Current Sensing
- The required safety levels for current sensing are categorized as A, B, C, D, with a mention of a fifth level that is not specified. The first level is defined as having no safety-related aspects.
- When using current sensing resistors to measure DC bus or traction inverter load currents, it is essential to adhere to higher safety categories (e.g., category CR D).
Circuit Design Considerations
- A floating terminal in the circuit can create measurement issues; ideally, the reference should be grounded to avoid problems with the operational amplifier.
- Key design considerations include changes in resistance, electrical isolation, and avoiding configurations that could lead to floating nodes.
Types of Current Sensors
Shunt Resistor-Based Sensors
- The first type discussed is shunt resistor-based current sensing mechanisms which have specific limitations regarding resistance change and electrical isolation.
Hall Effect Sensors
- Hall effect sensors measure current by detecting the magnetic flux produced by the flowing current. This results in a proportional Hall voltage that indicates the amount of current.
Current Transformers (CT)
- Current transformers operate on similar principles as Hall effect sensors but are limited to AC measurements only. They convert magnetic fields generated by AC currents into measurable voltages.
Application Use Cases and Future Discussions
- Similar application use cases for voltage sensors apply to current sensors. The session will transition from theoretical discussions to practical applications involving shunt resistors for core protection.
Upcoming Topics and Practical Exercises
- Future topics will cover constant current/voltage control methods and algorithms for cell balancing or state-of-charge prediction based on sensor data.
- Participants are encouraged to experiment with Tinkercad circuits related to voltage protection before the next session. Questions can be addressed during future meetings.
Conclusion and Next Steps
- Queries can be posted in chat; there will be time allocated at the end of this session for questions.
- Emphasis on using C++ compatible code for upcoming projects; participants should try building an over-voltage protection algorithm using Tinkercad examples.
Additional Notes on Tools
- Discussion about compatibility between Tinkercad and Simulink; suggestions made regarding using embedded coder blocks for hardware-in-the-loop systems.
This structured summary encapsulates key insights from the transcript while providing clear timestamps for easy navigation back to specific points within the discussion.