I am forcing instabilities when powering my IoT with 12v
The whole "development process" was done with a regular 5v supply via usb cable and when everything was done and was working perfectly fine- I tried powering it with a 12v (device has to powered with 12v) and problems kicked in. Project "stops" after few second -no led error codes (not sure if IoT can show them like Nano BLE) no nothing, just frozen code. Reset helps but nothing changes, same few seconds. Sometimes it gets through setup procedures, sometimes it does not. Best I saw is something like a minute but after 10 second Gyro Data maxes out, z-axis returns something like 1398 (don't recall the real number, but something super crazy for a board laying still on the desk ).
If I remove all the gyro code from the project (comment gyroSetup() and gyroLoop()) everything goes back to normal and runs totally fine form both 5v and 12v
At total project utilises BLE Peripheral (settings through BLE apps), BLE Central (BT Tag discovering), FlashStorage (EEPROM substitute), Gyro for motion detection, Digital Pin interrupt for external buzzer signal detection and some basic IO operations
Zipped project is attached
From a hardware side- I've tried adding 35/16 capacitor directly to VIN and GND pins of Arduino but that did nothing.
Are there something that I'm missing? Maybe some code tricks can be implemented?
There is always an option to run external 3.3 regulator but I don't like complicating things, so if there is a way to solve it- would be lovely
Thanks main.zip (8.9 KB)
Help us help you. I believe your assumption is correct and that it worked indicates the software is ok. Post your annotated schematic, not a frizzy picture showing how you wired it. Also add links to each of the hardware devices that gives "Technical" information, sales info such as supplied by azon is not much help.
Most people would use a separate, switching buck regulator to supply 3.3V (or 5V if required) to the entire circuit, and be done with it. Pololu has a the best selection.
Hi, @kaws
As asked in previous posts.
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, component names and pin labels.
Are you putting 12V to the Vin pin?
What is your 12V supply?
I think you're right about software being ok. I just thought that maybe that is something typical since I saw another topic of guy struggling with powering the IoT with 12V. Even though there was no mention of using gyro or other internal sensors.
Schematics are attached- first one is what in use now (Trackino is a GPS tracker modified to work out of 12v instead of battery), it all now takes 12V from (apparently crappy) 240v power supply, it says "Goobay Stecker Netzgerat". It pretends to be German but "Made in China" makes him fail. Second schematics if a final power supply installed in the bike, it uses 90 to 12 buck converter shown in the picture (from my experience it does pretty good job despite being noname)
So I think it's a 100% current "test Goobay power supply" failure, I'll check it's output with an oscilloscope once I'll get back to my workplace and update you. I'll also test the second scheme supply, hope there will be no problem
This sounds like a power supply regulator dropping out on the Nano33 due to thermal overload.
12V in on Vin is then regulated down on the Nano33 board to 5V and 3V3, if the regulator is not efficient (I'm not sure if it has a linear or switch mode regulator on board), then it will overheat.
When this happens, have you measure the 5V and 3V3 pins on the Nano33 to see if its regulators are working and you still have 12V at Vin?
You may have to include a 12V to 5V converter for the Nano33.
That is my backup solution but I would really like to keep things minimal
I don't think it is an overheating issue, not in few seconds. And again, gyro code removing solves everything, I don't think it consumes sooo much power out of on-board regulator.
And I did some temperature measurements with accurately calibrated thermal probe (a.k.a finger) and it did not feel any heat at all.
I'll do some more measures on voltages and their stability
At this moment my #1 suspect is a very poorly stabilised voltage out of my test power supply. It might be so bad that even 3.3 on-board stabiliser can't make it good enough and it's just LSM6DS3 being more sensitive to unstable voltage
We'll see, I'll keep you updated
Here I am back with results
Problem solved but not solved. Chinese 90->12v regulator supplied with good siemens 24v PSU does work absolutely fine, so yaay but..
No issues were found with both multimeter and oscilloscope. Network 12v adapter shows exactly same voltage shape (can't see anything criminal). There are pulses but 90v adapter has those as well.
I also soldered ceramic capacitor in addition to 35/16 and that did not help either. At this moment I am a bit worried about Arduino being too sensitive to the quality of power supply and if electrolytes degrade a bit with time that potentially could introduce stability issues.
Picture of "bad" network adapter is attached, so stay away form it
Currently it's a complete schematic.
I do tests on the block itself only suppling it with external 12v.
Later it will be installed into the network of other devices but I did not get that far yet so it's not the cause. 12v line currently only powering Arduino via VIN and Trackimo's LMO78_03-05 regulator with a voltage divider modified to get 3.8v out of it (Tracker considers 3.3 as low battery and won't turn on ). Tracker does not consume much, around 10mA (@3.8v) peak (original plan was to power it with Arduino's 3.3 out but it needs more as I mentioned). So 12v supply available current is muuuch more then needed
I did assemble the final variant expecting everything to run perfectly smooth and fine but the pretty much same issue immediately came up. Frozen Arduino, unconnectable BLE service and random output of "horn_out". The power supply is identical Chinese 12 step-down to one I did successful test with.
I've recreated same setup for tests and problem remained. Unplugging everything beside 12v and ground "fixed" the board. So problem was "horn_out" (A5) pin. Due to mistake in soldering, it (I suppose) was overloaded. And the initial test setup (I started topic with) had a similar problem, since the power was connected through 6 pin shielded cable with only 12v ang GND connected and rest was left hanging. So the output pin most likely was touching the shield causing the overload of IO pin. I never new that can completely freeze the code.
I can successfully recreate the problem: soldering A5 to gnd makes board go nuts, and Chinese wall 12v adapter (one I told to stay away from ) does actually works fine
Another issue is that A5 "by default" is set as OUTPUT and HIGH (before init code sets correct modes and levels). In case of "unlocked" pin which is an input- it might cause troubles if it tries to set high output level. Is there a way to define "default" states of pins? I understand that adding something like 100 Ohm would do the job but I am still curious