top of page
Search

Week 14 - October 10-16

  • Writer: Jesus Diaz-Rivera
    Jesus Diaz-Rivera
  • Oct 14, 2021
  • 4 min read

Power Module

With having the wiring functionally switching the battery’s line between charging mode, on and off, the next step was to help the battery indicate when it is low charge and alert when it needs to. For this, research was done on some Arduino projects about creating a sort of voltmeter using the Uno’s ADC converters on the board and measuring the input voltage from there. DroneBot Workshop created a very informative video on the topic that seems to be the most useful to do this, and explained how the overall operation would work. Essentially, a voltage divider would need to be between the input voltage to be tested and one of the analog inputs the Uno board has. From there, a resistive circuit that would drop the voltage down to the board’s internal Reference voltage, or 5V, in order to compare the voltage that is being input to that. Once this is completed, the code for reading this DC voltage converts the input into bits with the values being passed through a simple formula, and then the resulting value would be calculated using Ohm’s law principles to find the final Voltage that was originally input. Their video goes into greater detail, but it is a simple application that was verified over the weekend, and this week along with other tasks will be focused on implementing a variation of this voltage reading technique into the code and find a way for the circuit to indicate that when the proper threshold of voltage is read from the battery that the circuit will respond accordingly.


Figure 1: Video on Measuring DC voltage and current with Arduino


One way that is being considered to do this is to include in the code that will be on the secondary controller a loop that over a set timed interval, a reading of the voltage will be done to see if the battery is still at a good charge and then continue operation, or pause operation to alert the user and then possibly continue operation or do something else. While the reading of the whole code is technically instant, a for loop was made around the motor controlling code that while in the VOID LOOP part of the code, the for loop can repeat the same signal reading actions 'X' amount of times, with the amount of times increasing or decreasing the timed interval, and then exit to quickly perform the voltage reading operation. For this moment, and IF statement will compare the voltage read to what is considered a “charged” battery level, or one that is above a level where the cart would die soon. If it is, then no action will be done and signal reading operation will continue, but if a lower voltage was read then the cart will stall for a moment and wither send a signal to the user or indicate another way to check the battery level, delay, then begin signal reading loop. This will continue until the user either shuts the cart off or gets the cart to an outlet to switch the cart to charge mode and begin charging the battery. The user will have the LED indicator to help show them the state of the battery, and when charging the on-board charger will give the status of the battery, whether it is fully charged or not. The goal of this is to set that “charged” voltage value to one that will give more than enough time for the user to move the cart to a wall plug and charge the battery, and not completely stop operation so the user can finish their work and then aim to charging.


A test manipulating a digital multimeter to affect the operation of secondary controller was successful, and upon researching the use of a buzzer in a circuit, the buzzer along with an LED lighting up was used to indicate that a low battery charge was being read. The way it was tested was using the circuit shown in Figure 2 that, when the battery is connected, a variable resistor or potentiometer was placed between the voltage divider and positive of the input voltage. When the potentiometer was not creating any resistance, the current would go through as normal and not create any drop in voltage at the analog input of the controller, thus reading what voltage the battery is at. As the resistance is increased, the analog input would read the voltage change at a timed interval and when dropped to a low charge, the respective indicators would occur along with stopping the cart, which will occur once the cart is ready to connect with all electronics.


Figure 2: Power module testing and design


Control Module

Work on obstacle avoidance code is being expanded to include the other sensors, beginning with the IR proximity sensors that will be on the sides. It was realized due to the size of the cart, the sides would probably need an extra sensor in the middle of the sides to help avoid that no object in the exact center would be missed. It was also verified that all systems including the addition of the voltmeter can work together and give the appropriate responses as needed. For example, while the cart would be taking commands from the user and IR sensors, the charge drop will be indicated accordingly regardless of what is going on. The power module will be observed using the secondary controller as it will be dealing with the battery, and the drivers will need to be close to the battery along with that secondary controller. This also helps in saving memory storage on the primary controller and not cluttering that code with this function as well.


So to summarize the secondary controller has two basic functions now: to determine what signals the primary controller is sending it with regards with what direction to take and tell the motor drivers that, and also see what the charge of the battery is and indicate to the user when a charge is needed. Work will continue into the weekend and to keep adding the sensors, and on Monday with beginning to add electronics to the cart for troubleshooting and testing.


References:

 
 
 

Comments


bottom of page