he only way this can happen if for some reason 5 volts is getting to the vin
There is way. (I wasn't aware of it until now, so I learned something.)
The UNO voltage regulator can produce a back-feed voltage on the UNO Vin GPIO pin. The voltage is very close to 5v. Of course, the Vin pin is used by the SmartCar shield to connect the battery et al. So, there's a pathway that doesn't require a faulty connection to the UNO 5v GPIO pin.
I find this persuasive...and disappointing.
I also learned that CoPilot reads schematic images. This opens the all the doors in the door factory.
The one who has the most fun, wins!
There is way. (I wasn't aware of it until now, so I learned something.)
The UNO voltage regulator can produce a back-feed voltage on the UNO Vin GPIO pin. The voltage is very close to 5v. Of course, the Vin pin is used by the SmartCar shield to connect the battery et al. So, there's a pathway that doesn't require a faulty connection to the UNO 5v GPIO pin.
I did not know this was a thing. I guess now we know.
One useful thing has come out of this thread for me and that is reverse leakage in semiconductors. Being self taught many decades ago there are BIG gaps in what I know or understand.
"Real components are never perfectly one-way unless specifically engineered to be."
A chatGPT water analogy.
To use the machine I would suggest that checking pin A3 for battery power as shown by @tfmccarthy as part of turning the motors on/off. That is why I would ask if there is no commands to the Hbridge motor controller to power the motors would they still turn on thus the reason to turn them off in the setup()?
I think this is a possibility but there are some challanges that need to be overcome before doing this.
The TB6612 has inputs to enable the motors. However, the way the code is written, these inputs are constants (althought they look like variables).so changing this would require adding one or more variables. In addition, the setup code would need to check the battery voltage to determine the power source. More code.
"Not that much code", you say.
Well, at the end of the road here, the current complete sketch for the SmartCar has the footprint:
Sketch uses 31994 bytes (99%) of program storage space. Maximum is 32256 bytes. Global variables use 1246 bytes (60%) of dynamic memory, leaving 802 bytes for local variables. Maximum is 2048 bytes.
There's really no room to play with. That's embedded programming. That's one of the challenges I hope to address. So I need to be very methodical in my approach and get the thoroughly understand the program before making changes.
The one who has the most fun, wins!
I did not know this was a thing.
Neither did I. But I was unsatisfied with my conclusion of a wiring error. That just doesn't feel right. So, I kept digging. This is where Github CoPilot earned its keep. I posed the question and got what I think is the accurate answer. However, there's a test I want to perform to check the voltage on Vin GPIO when the UNO is powered by the USB. If that voltage matches the predicted value then I'm fully convinced.
I was surprised that my comment that CoPilot can read schematic drawings didn't get a rise out of you or anyone. For me, that discovery was more important than the feedback voltage behavior. I plan to try and use that in my deep dive review to get CoPilot to write unit tests.
The one who has the most fun, wins!
I was surprised that my comment that CoPilot can read schematic drawings didn't get a rise out of you or anyone. For me, that discovery was more important than the feedback voltage behavior. I plan to try and use that in my deep dive review to get CoPilot to write unit tests.
I remember that comment but I really didn't know what it meant. I am still not using AI much in my day to day so I don't know what that means as far as practical use. With a little more thought I guess you input a schematic then ask AI about how it works ?
I was surprised that my comment that CoPilot can read schematic drawings didn't get a rise out of you or anyone.
Well it has now!
I have just being reading about CoPilot and what you can do with it!
I remember that comment but I really didn't know what it meant.
anus meus tego:
I generally subscribe to curating AI assistant responses as I don't think verbatim repetition is effective or productive. However, this is one case where the response is more accurate and concise than any summary I could provide.
CoPilot chat
Can CoPilot read a schematic drawing?
Yes - I can read schematic drawings you upload (PNG, JPG, PDF) and help analyze them, but with some practical limits.
What I can do
- Extract component symbols, net names, pin labels and resistor/capacitor values (OCR dependent).
- Identify power rails, voltage dividers, diodes, regulators, jumpers and likely power paths.
- Trace signal/power flow and point out probable causes for behavior (e.g., VIN back‑feed to A3).
- Suggest hardware fixes, measurement points and software mitigations.
- Point to specific components on the schematic (if the image resolution and clarity are sufficient).
Limitations
- Low resolution, glare, skewed photos or handwriting reduce accuracy.
- If nets/labels are tiny or overlapping, OCR may miss them - a native PDF/Eagle/KiCad file is better.
- I can interpret the schematic but I cannot probe the physical board - measurements you provide improve diagnosis.
- I won't identify people in images or reveal private info.
How to get the best result
- Upload a high‑resolution crop (300-600 DPI) that contains the area you care about.
- If available, also upload the original PDF/schematic (Eagle/KiCad/Altium export) or the BOM.
- Tell me the exact question (e.g., "Why is A3 ~4.77 V with USB connected?" or "Is VIN tied to 5V?").
- If you've taken measurements, paste those voltages and where they were measured.
If you want, upload the schematic (or a clear crop) now and say which nets/pins to inspect; I'll annotate the cause and recommend fixes.
I discovered this by chance because in a prior query while looking for a 5v pathway to Vin, CoPilot casually said,
I looked for a local schematic in your workspace but didn't find one. If you upload the SmartCar Shield v1.1 / SmartCat v4.0 schematic (or allow me to search a specific folder under I:\AppDev\Robotics\Elegoo\), I can point to the exact component that causes the backfeed and recommend the cleanest fix
That's what set me off. I was able to drag and drop the schematic on the chat input window and CoPilot took it in and understood it.
More than "not bad"; Fantastic! I have lots of schematics and I want to explore how far CoPilot can go to understand them. In combination with sample test code I write, i want to see if it can write unit tests.
As I said, I think this opens all the doors in the door factory.
The one who has the most fun, wins!
The one who has the most fun, wins!
Very cool, didn't know AI could do circuits/schematics. That may come in handy for me because although I graduated with an EE degree I found out that I was terrible at hardware/circuit design. I took to software much more naturally.