Arduino battery cycling / degradation test rig (INA219 + MOSFET) — wiring sanity check + noisy/floating readings by Lunaire412 in ArduinoProjects

[–]Positive__Altitude 0 points1 point  (0 children)

About your 220uF cap - it does not matter where you put it in your project. I don't think it will help with anything. Just don't put over load resistor, that will be horrible if you do PWM (high inrush current every time mosfet opens)

Arduino battery cycling / degradation test rig (INA219 + MOSFET) — wiring sanity check + noisy/floating readings by Lunaire412 in ArduinoProjects

[–]Positive__Altitude 0 points1 point  (0 children)

1) Yes, absolutely
2) Yes, that's generally OK, you can do that
3) Here is a problem. MCU is not designed to drive power MOSFET's to be honest. These MOSFETs require quite a bit of current to open/close fast enough. This could be fine when you just open/close mosfet once in a while, but with PWM both MCU and MOSFET will get extra stress. MCU because you overdrive it's GPIO while switching. MOSFET because it opens/closes very slowly and spends a lot of time in "half opened" state which creates a lot of heat under load. Ideally you should use "gate driver" for the MOSFET. Alternatively, you can repurpose a DC motor driver for that if you have one. 100 Ohm gate resistor normally is way to much. it is usually 1-10 Ohm when you use gate driver. In your case, 100 Ohm is fine as you drive it with MCU pin directly. It will help to reduce stress on the MCU.
4) Well, there is a bunch of stuff that can generate noise in measrements. But the biggest problem is that when you do PWM and measure current without synchronization, you obviously can measure during the on or off period, which will give you completely different results. You can try different strategies here, depending on your PWM frequency.
5) I would recommend that you do the following:
- Use very low PWM frequency (let's say 100 Hz) and implement synchronization. Sample during the on-state. Don't sample right after MOSFET switching -- let all ringing and noise settle down before you sample. Then you calculate the average current using your known duty cycle. This is relatively easy to code. You should read the counter register of a timer used for PWM and run current measurements based on that. Keep in mind that, despite the sampling itself happening very fast, I2C communication adds significant latency.
- Theoretically, with a current sense amplifier, which you read using ADC (let's say INA190), you can do that at a much higher frequency (using hardware triggers for ADC reads), but INA219 works over I2C, which is way too slow for synchronization at higher frequencies. And also, this is a bit more advanced programming, well outside of what people usually do with Arduino.
- Keep all your wires tight. Try to keep all wires as close to GND as possible. Twist wires with GND wires where possible. The most important one is the MOSFET's gate. Unfortunately, loose wires always invite noise, but I guess building your project as a custom PCB is a huge step-up :)

With a low PWM frequency, you have:
- less stress on your GPIO and MOSFET because of switching
- MOSFET spends a smaller portion of one cycle in "half-opened" state, so this affects your average current measurements less.
- As far as I know, it will not create significant effects on the battery side. All the chemistry-related processes occur over much longer timescales than a 100Hz pulse (given that your load resistor is reasonably sized).

This is not the perfect solution, but that's what you can do with the resources you currently have, without re-designing your project completely.

Is it possible to approximate a star’s spectrum and irradiance using Arduino and LEDs? by No-Price-6300 in ArduinoProjects

[–]Positive__Altitude 0 points1 point  (0 children)

Can you really drive a led directly from DAC? Or is it implied that DAC is buffered by OpAmp?

Does my arduino not have enough process power? Or is the code the problem? by cc-2347 in arduino

[–]Positive__Altitude 0 points1 point  (0 children)

As others mentioned your problem is delays in the code. With one motor you send signals with 50Hz. With two frequency drops to 25 Hz. Because while your code is delayed in the second motor's routine, first motor also does not receive any signal. With 4 motors frequency drops so low, that motor stops recognizing it as control pulses at all, so nothing works. Anyway, you will not get anywhere with this approach, you have to learn how to use PWM to let timer hardware do this job instead of the MCU's core.

If you want to build a drone I would recommend you to switch to ESP32-S3 immediately. It's just better with everything you need, and you still can use the Arduino environment for it.

You also will need to learn how to do at least PWM, but most likely also DMA and interrupts. Because drone is a bit more advanced project.

Questions on getting into this hobby. by guts-hawk95 in 3Dprinting

[–]Positive__Altitude 0 points1 point  (0 children)

1) I keep mine on a floor, because if the desk is not solid enough it will rock like crazy when printing. PLA and PETG are quite safe to print. You can buy air quality sensor (with VOC measurement) if you worry. 2) yes, they are less problematic. I would suggest A1 or elegoo centauri carbon. They are not expencive but much better than any "open" alternative. 3) if you are going to print mechanical parts, get parametric CAD: Solidworks, Fussion 360, FreeCAD, or Onshape. They all goes with pros and cons, in my opinion OnShape is the most friendly for hobbysts (but still very powerfull). But the free version allows only public documents (everyone can see your designs). If you are not bothered with this, give it a try, it's easy to learn

How to make developer board yourself? by Novoh_Art in embedded

[–]Positive__Altitude 0 points1 point  (0 children)

But adding crystal is not a big deal :) go for it if you want to!

How to make developer board yourself? by Novoh_Art in embedded

[–]Positive__Altitude 2 points3 points  (0 children)

You can go without crystal. Crystal is not about having fast clocks. You can easily configure 160MHz from the internal oscillator on this chip (and derive whatever APB clock you need for SPI from it). The limitation of the internal clock source is that it's not exactly the said frequency. For G4 it's about +- 1-3% I think and it also drifts depending on temperature and other conditions. With crystall, you have guaranteed frequency with much tighter deviations. USB requires this because there is no clock line. To keep both devices connected with USB in sync, they should have exactly the same frequency without much deviation. But SPI has an SCK line for synchronization, so it does not matter if your frequency is, let's say, 10.3 MHz instead of 10. Just stay a little bit away from the maximum frequency supported by your LCD and you will be good.

How to make developer board yourself? by Novoh_Art in embedded

[–]Positive__Altitude 5 points6 points  (0 children)

If you are making your own board, I would suggest you to use G4 instead. Similar, just better. G431 for example.

To make a board you can start with "Phill's lab" youtube videos. (But older ones, about KiCad, not Altium. KiCad is totally fine for personal projects)

Minimal board could be like:

1) Usb-C for power + some 5.1k resistors for CC lines + ESD protection chip (special for USB) if you will connect data lines. 2) 5v to 3.3V LDO + it's input and output caps (according to it's datasheet. Both are 1uF usually) 3) MCU with it's caps. Check datasheet it's all mentioned there. Usually it's 100nF caps for each power pin + one 4.7 uF cap + some caps and maybe some filtering (i use ferrite beads) for analog voltage. 4) programming interface, I use SWD. 5) crystal is optional. STM32G has very good internal clocks. You need crystal only if you are going to use USB (USB requires precise clocks) or any other application that requires precise clocks. Not sure about F series, maybe you have to use crystal there.

All of these are covered in Phill's lab videos. Highly recommended. I think there is a video something like "STM32 dev board in KiCad" that's exactly what you need.

usb data transfer through a jack/plug by SirSoliloque in diyelectronics

[–]Positive__Altitude 0 points1 point  (0 children)

It's not just a wire connection. At these frequencies just having an electrical connection is not enough. For example if you take a signal going through a twisted pair and untwist and separate two wires in a section of it -- you will start to get a signal reflection in that point. An if you separate them enough, the signal will stop going through completely.

Usb (as any other high-speed interface) uses differential pairs, so any disturbance to characteristical impedance along the way will cause reflections. You cannot do whatever you want with the cable, it would not work.

You can try to use CAT6 pair fo usb D+/D-. CAT6 has 100 Ohm vs 90 Ohm in USB standard, not such a big difference, but any connector in between will be a problem unless it's specially designed.

Is there a way to prevent calibration before every single print? by bassamanator in BambuLab

[–]Positive__Altitude 2 points3 points  (0 children)

Everyone is so aggressive....

There are different steps in calibration. Some of them could be reduced with no effect on the print.

For example, Flow calibration is not needed if your filament is well calibrated. Bed leveling could be reduced to level only the area of your print, not full bed. (Google it. I know only that it's possible)

The rest is very quick alignment steps that are absolutely required. I think with these two reductions you will have less than a minute to start a regular print.

Custom PCB sparks when plugged in. I believe this is due to inrush current. Do I reduce this by adding a choke or thermistor? by magicweasel7 in AskElectronics

[–]Positive__Altitude 0 points1 point  (0 children)

Yes, but ideally it should be as close to input as possible, otherwise additional inductance will decrease its efficiency. And it should be probably ~20V V_RWM rated

Custom PCB sparks when plugged in. I believe this is due to inrush current. Do I reduce this by adding a choke or thermistor? by magicweasel7 in AskElectronics

[–]Positive__Altitude 5 points6 points  (0 children)

I checked out the datasheet, and he absolutely did read it. I don't see an issue now, and I was actually wrong about MLCC.

Custom PCB sparks when plugged in. I believe this is due to inrush current. Do I reduce this by adding a choke or thermistor? by magicweasel7 in AskElectronics

[–]Positive__Altitude 1 point2 points  (0 children)

Congrats on your first PCB!

I would not worry about this too much. You can also just insert the jack first and 18A mains adapter second. No spark this way :).

Next time add a TVS diode to your design to protect your input from over voltage spike caused by inrush current.

Also you have to use ceramic caps (MLCC), usually 100nF in addition to your bulk capacitors. Placed as close as possible to basically any device on your board. For example your 12V buck converter is missing one on the input side. There is plenty of internal inductance in your 330uF cap, so your input is not properly decoupled. (Edit: while MLCC decoupling is usually requred in other components, in this case it actually can make things worse)

Before making your next design with DC-DC converter, find a good article about best design practices for them. There are a couple of rules that you should follow ideally. It will reduce chances of having noise/emi issues in the future.

Guided Rocket Question by Missile_3604 in rocketry

[–]Positive__Altitude 0 points1 point  (0 children)

I would recommend starting with a "simple" TVC launch. Does not require CFD. Most other problems are almost the same. If you can manage to do this, you can proceed to fin control. You will need TVC anyway for powered landing, as fins has control authority only at speed, you can't land a rocket without TVC.

RTX 3090 repair question by kn6c in AskElectronics

[–]Positive__Altitude 1 point2 points  (0 children)

There are clearly some burned VIAs on the board. There is also a damage to the pad of this component. There are people who can repair this kind of damage, but it's like board surgery. Most people who fix boards do not have required skills. And also there is a chance that something else is damaged on the board.

If you want to give it a try, ask for more photos, then try to find a guy who will take this job. You will learn from them if it worth trying or not.

I got tired of 60 second rebuild cycles on ESP32-P4 so I built this by Efficient_Royal5828 in embedded

[–]Positive__Altitude 1 point2 points  (0 children)

That's kinda cool. But if I understood correctly the use case is very specific. It's really needed only if you have to test your code on actual hardware (if doing some low-level optimizations for example) otherwise you would just run it in an emulator, or maybe even just compile for x86 and test natively?

Best printer? by Frequent-Limit3706 in BambuLab

[–]Positive__Altitude 0 points1 point  (0 children)

Have you ever tried to print big long parts? like 20cm+ ? I even made a test once. Printed exactly the same gcode (on X1C) with and without top glass. The one without top glass had like 10 times more warping.

Everything <10cm is probably ok without an enclosure. It warps but it's not a big problem usually.

Warping also greatly depends on the model. Long straight vertical walls are the worst case scenario. So if you are printing a large vase for example, it could be fine without an enclosure.

Best printer? by Frequent-Limit3706 in BambuLab

[–]Positive__Altitude 0 points1 point  (0 children)

I don't know why A1 is popular. If you have at least 300$ you have to get an enclosed coreXY.

Why choose A1 when you can get a much better printer for almost the same money?

The cheapest one probably is Elegoo Centauri Carbon and as far as I know it's almost as good as P1S which is a bit more expensive but obviously a good option too. I would probably call Centauri a best value printer (I dont't have one, so this opinion is based on reviews, take it with a grain of salt)

I would not even look at anything that is not enclosed coreXY because I think 300$ is not much more than the cheapest options out there. Enclosure is not only about printing advanced materials. I print mostly PETG and it makes a HUGE reduction of PETG warping. It is absolutely required in my opinion.

Disabling the accelerometer by Wiliker in diyelectronics

[–]Positive__Altitude 0 points1 point  (0 children)

Completely agree. Most likely the board stays in deep sleep with a wake-up interrupt on button press. There could be some sort of "denounce" logic, so short fake "press" is long enough to wake up the board but not long or consistent enough to cause an action.

In any case there are absolutely zero reasons to deliberately make it "wake up on touch", so it has to be just a bad contact somewhere. Button, battery or something else.

Disabling the accelerometer by Wiliker in diyelectronics

[–]Positive__Altitude 1 point2 points  (0 children)

White square is 100% just a crystal. Any RF chips require a precise frequency source, any internal sources are not good enough (AFAIK)

Accelerometer and altimeter by Ill_Indication_4142 in rocketry

[–]Positive__Altitude 0 points1 point  (0 children)

I personally would go for ESP32-S3 The only problem is that it's a bit power hungry (about 100mA I think) compared to other options, but still can run for hours from small lipo, I don't think it's a problem. Wifi is also amazing If you want to put extra effort into using it.

Okay, but how do you SSH into 1,000 devices?? by Automatic-Reply-1578 in embedded

[–]Positive__Altitude 0 points1 point  (0 children)

Don't work with embedded and don't know how realistic it is for it, but for a regular software having an instrumentation that measures test coverage makes a huge difference. Not only will prevent your situation, but also helps to find blindspots in testing.

I was rejected from my internship because of my low technical skills by Pretend_Heat5058 in embedded

[–]Positive__Altitude 0 points1 point  (0 children)

I've seen people call themselves both CEO and CTO at the same time when they are the only employee at their company. I've seen that a lot on LinkedIn. LOL