Saigonauticon
@Saigonauticon@voltage.vn
- Comment on Sanity check for LiFePO4 Charger Design 11 months ago:
An international parts order is too complex for such a small thing. I’m not in the USA or China. So no TP5000 for me, got to work with what I have.
I agree, no charging at 4.2 volts. The current charger I built seems to work well enough. I ran some tests and it charges within spec. The reason I turn off the charger to measure cell voltage is because otherwise I’ll mainly be measuring SMPS noise.
Anyway it beats the charger available in the local market, which is clearly unsafe, no matter how much they assure me that it’s ‘totally OK’.
- Comment on Sanity check for LiFePO4 Charger Design 11 months ago:
No worries! I appreciate that you were just trying to assist!
- Comment on Sanity check for LiFePO4 Charger Design 11 months ago:
Battery University is indeed a great resource!
However this is not a lithium polymer battery, and as it’s a 32700, it is not a prismatic or pouch cell either. It is a lithium iron phosphate (LiFePO4) cylindrical battery in metal housing. Battery University does have them listed in their table of chemistries (in case you’re curious), but they don’t seem to have much detailed information. Enough to build a charger though :)
batteryuniversity.com/…/bu-216-summary-table-of-l…
Also some more detailed information here:
batteryuniversity.com/…/bu-205-types-of-lithium-i…
Anyway, thanks for your reference in any case! I’m not responding to criticize you, only to improve the utility of this conversation in case someone else finds it on search :)
- Comment on Sanity check for LiFePO4 Charger Design 11 months ago:
Makes sense!
I’d order online if there was a LiFePO4 charger on the market. However, in my country I’ve been unable to find one, and importing (excise & duties, paperwork) is more work than building it myself. I’ll also likely need a design that I can cheaply include on custom PCBs for manufacture (not for sale to end-users, but for internal use by maintenance technicians).
I gave it a test on a cell today and it seems to charge fine and at a reasonable rate – but in a sudden flash of brilliance, I forgot to physically connect the ADC pin to the battery, so it couldn’t shut off. Well, that’s what testing is for I guess.
Anyway after fixing this, it looks like I can call this a win and move on. If it undergoes destructive optimization, I’ll report back here with a warning to others.
- Submitted 11 months ago to askelectronics@discuss.tchncs.de | 17 comments
- Comment on Siglent SDS1104XE: slanted square wave 1 year ago:
Yup, seen that for sure.
Did you try turning the little adjustment knob in your probe tip to calibrate it? Sometimes needs a small screwdriver. Here’s a reference:
www.elecrow.com/…/HowToCalibrate10xProbe.pdf
What I’m referring to is labelled ‘Cap Trimmer’. The document also has some waveform images that match your problem.
I have a Siglent and it looked like this at the dealership, then they adjusted the probe a bit, and then it was 100% fine.
- Comment on How should I get started? 1 year ago:
Glad to help :)
Besides the I/O and supporting hardware, the clock speed is wildly different between these 3 chips – that’s worth considering. By that metric, the ATMEGA based designs are the slowest by far – although somewhat faster than you’d estimate since they usually operate 1 instruction per clock cycle, whereas the other chips are a few clock cycles per instruction (they are still way faster than the ATMEGA line though).
Regarding pre-made boards vs. your own? I think there are three things to consider:
-
Pre-made boards are awesome for prototyping. Making sure the damn thing will work (feature-complete) before designing your own board is a good idea. Then, make your first board with all features added in (this is important), but expect to iterate at least once (make revisions and order boards a second time). There’s no such thing as premature optimization in hardware design – it’s not like software where you can just design the core of an application and then build features as you go. This is why always designing prototypes to be feature-complete is a good workflow, and generic development boards are a good starting point for this.
-
Designing your own board is really easy for AVRs. I do this all the time, lately with the Attiny10. Honestly there are a ton of AVR chips out there, and not all of them have affordable / popular development boards, so often it’s worth making your own for use in item 1 above (…really you just need at minimum power and a header to break out the pins for ISP programming). Then when you want to make your final widget, you just expand your development board design, which lets you make a really miniaturized and streamlined thing! You will need an ISP programmer though, like the AVR-ICE (which has a nasty but minor bug in the design – ping me before buying one and I’ll save you 2 days of headaches setting up).
-
A neat trick is to design your own boards and still use a dev board (so making your own boards and buying premade dev boards are not mutually exclusive options). This is especially useful with the Pi Pico and ESP32 (where making a dev board is less beginner-friendly) – a cheatcode is “castellated mounting holes”. These let you solder (for example) a Pi Pico dev board directly to your own design as a surface-mount component. You can do this by just adding a socket and using header pins too, but SMT + castellated mounting holes lets you keep the design small and reliable.
BTW when designing your own boards, committing to SMT parts (where possible) early on is one of the things I’m really glad I did. You don’t need much tooling to do it. Just a solder paste syringe, a toothpick or pin, some tweezers, and a hot air rework station (included in some soldering stations). Even 0402 parts (about the size of two grains of salt) are pretty easy to do by hand. It’s amazing the level of miniaturization that you can achieve these days this way, as a private individual with a very modest budget!
Finally, the Arduino products are generally very good dev boards, whether or not you’re using the Arduino IDE (you can still program them ASM or non-Arduino C++). So for any chip that an Arduino exists for, it’s an excellent starting point – although you may want to design your own board one day to remove unnecessary stuff if it comes out cheaper and you go through a lot of them, or just for the experience.
-
- Comment on How should I get started? 1 year ago:
There are a lot of differences, but I’ll try and go over the high level ones. The RP2040 is a chip, and the others are boards – so I’ll compare the chips on them.
The RP2040 chip is really powerful overall, and does some odd things with I/O that let you do a bunch of very fast, precise things. You also get a lot of I/O pins and they are very well-behaved. The main advantage though is that it works well in both Python and C++, and is well-supported.
The ESP32 based board (Thing Plus) has integrated WiFi. The ESP32 is a great chip, I use it a lot, but it has some unfortunate quirks. First, it has a very high clock speed and decent memory, making it quite powerful. However, if you glitch out the network stack via your code, it can have some problems with unexpected resets. This was much worse with the earlier-generation ESP8266. Secondly, the I/O work much more slowly than the system clock (if I recall correctly), and they are picky about what state they have on startup – some go high as part of the boot process, others must be high or low on boot but can be used after. This is actually quite a pain sometimes. It’s a great chip overall though and works well in C++.
The Pro Micro uses an ATMEGA32 chip. I’m a huge AVR fan so I don’t have many bad things to say, I like it a lot. It is much slower than the other two chips though, and has less memory. Probably it’s best to use C++, but you ought to be able to use Assembly too if you like. The I/O on AVRs are really well-behaved and usually operate at the same speed as the chip, which is nice when you need precise timing! The best thing about it though, is it can use much less power than the other two options, if you use the sleep modes right. So you can build neat battery-powered applications. Finally AVRs have excellent datasheets – there’s rarely any ambiguity on exactly how any system on the chip works.
Overall, I’d choose an RP2040 board if I wanted to use Python and do IoT/Robots/whatever (you can buy boards with or without WiFi), an ESP32 based board if I wanted to do IoT stuff in C++, and the Pro Micro if I wanted to do low-level, low power embedded stuff in C++ or assembly (and maybe branch out into other AVR chips). The C++ options mean you can use the Arduino IDE and their libraries.
- Comment on How should I get started? 1 year ago:
The most important thing is to tackle projects frequently and get yourself involved with other people doing the same. Learn by doing! I found books, videos, and so on of limited utility by comparison. I’ll include an unreasonable quantity of my notes below.
Some useful resources:
- Learning Python – a decent programming language to start with since in flexible and enforces some good habits : python.swaroopch.com
- Your local hackerspace, makerspace, or fablab: wiki.hackerspaces.org/List_of_Hacker_Spaces
- Websites with details on other people’s cool projects: hackaday.com
- You should also learn C / C++ (unless you are an assembly-language degenerate like me)
- KiCAD is fantastic these days (and free!): www.kicad.org
- I’ll point out that Microchip Studio is awful and buggy but for some microcontrollers you’re stuck with it. Everyone working with embedded systems gets stuck with some lousy manufacturer-supplied software sometimes.
List of initial things to learn:
1.How to read component datasheets (you will be doing this a lot). Actually I think a lot of my electronics knowledge was picked up from just absorbing datasheets like a weird sponge of some sort. 2. How to order from Mouser / Digikey / RS Components / Arrow / McMaster (these are also a great source of datasheets) 3. Basic laws of electricity and magnetism (any freshman university physics textbook is OK – these pop up used all the time, and even an old one is OK). Just do all the problems in each chapter and you’ll be fine. Or you can tackle “The Art of Electronics” if you like. 4. If you’re into analog, this is a classic (and free!) text : web.mit.edu/6.101/www/…/op_amps_everyone.pdf 5. Soldering is actually pretty easy, just buy some resistors and some prototyping board and get some practice in. You’ll need to learn surface mount soldering to get access to good and cheap parts later on, but thankfully, it is way easier than it looks. Like, really a lot easier than people make it look. 6. How to order manufactured circuit boards from a factory using a design in KiCAD (this is actually pretty easy and cheap!) 7. These days, a lot of components can be purchased on pre-built ‘modules’ that fufill a certain objective. For example, a temperator sensing module might have a sensor and all the supporting components on a little board, so you just connect power+ground and data. These are made specifically with learning in mind and are made in Asia at a very reasonable price – do note though that reading the actual datasheet of the parts in question will give you much deeper knowledge over time.
Tools to buy:
- A soldering station. Some people suggest fancy expensive stuff, but frankly, some brands of Chinese tools have gotten quite good. Yihua is a good and affordable brand of soldering station. You can get a soldering-iron-only version if you need to save money, but I’d recommend a model that also includes a hot air rework tool. This makes fixing mistakes on boards way easier, lets you salvage components more easily from junk and failed projects, and also adds a lot of flexibility later on.
- A multimeter / parts tester. Should measure voltage, current, capacitance, resistance and diodes. Pro’s Kit is an OK brand from Asia.
- Eventually you will need an oscilloscope, but not at the start. Hantek, Rigol, and Unit-T make good entry level ones. Siglent is midrange. Tektronix is for rich kids. An old used scope is fine but often shipping is expensive if it’s one of the heavy ones.
- Tweezers, wire cutters and strippers. Lots of protoboard and solder.
- If you’re really into low-level microcontroller stuff, an AVR-ICE will be pretty cool to have a few years down the line :)
Platforms and Communities to Consider:
- Arduino – largest friendliest community with the most tutorials, but as such has a ton of beginners and students looking to copy/paste code without understanding. So sometimes it’s hard to find someone knowledgeable, and if you do, they might be sort of exhausted. It’s probably the best place to start these days overall.
- AVR Freaks – the opposite of Arduino. Hostile, but super knowledgeable. I’ve learned so much by searching their forums, I’ve never needed to ask a question! They are great too, but really not a place for beginners to ask questions. It is a good forum to read if you want to learn assembly / C for microcontrollers, but has a steep learning curve – I’d save it for later :D
- Raspberry Pi – makes everything super easy, generally at the cost of being horribly inefficient and somewhat expensive. It can be a good place to start, but be careful not to learn bad habits here – e.g. using a whole computer system with Linux to blink an LED. You’ll end up having to unlearn a lot to make reasonable battery-powered devices later on. Awesome where processing power is actually needed – machine vision, some robotics, and AI. The raspberry Pi Pico has fewer of these problems (and you can code in Python!) – it’s pretty fantastic and I would personally choose it as my first microcontroller.
Other Stuff:
- Avoid playing with mains power / high voltage until you know what you are doing.
- Avoid selling things until you know what FCC / CE is. You can teach courses on what you’ve learned to fund your studies though! I bootstrapped this way.
- Lithium batteries can be sort of tricky / hazardous. When starting out with them, use the metal cylindrical cells at first. The TP4056 is an OK charge controller to use, and pre-built modules are like a dollar in bulk.
- I own a prototyping company in Asia, this introduces some bias on my tool recommendations: low cost, high value – but only ‘good enough’ performance and convenience.
Ping me if you get stuck or have questions :)
- Comment on Considering positioning strategies for autonomous mechanum-wheeled robots 1 year ago:
Good advice all around! Thanks!
I’ve also messed around with the ESP8266 and various models of ESP32. Their WiFi time-of-flight stuff is interesting. I’ve quite a few projects with both actually! My main complaint is that the GPIO don’t behave nicely (also the esp8266 is a power hog and reboots if you screw up the network stack). They are much slower than I’d expect, and have weird states on boot. It’s not too bad to work around this stuff, but I chose the Pi Pico W so as not to have to explain it.
It still blows me away that I can easily do public-private key encryption on the ESP32. And graphics. At the same time!
- Comment on Considering positioning strategies for autonomous mechanum-wheeled robots 1 year ago:
Haha, I know exactly what you mean – I’m most interested in resource-constrained embedded systems. I like the attiny10 a lot. At work I mostly write Python, but in my own time it’s mostly assembly language. It feels more concrete, every decision matters, and anything that goes wrong is 100% your fault as there are relatively few bugs at that level. It’s a lot of fun. Also the datasheet is very good.
I’m self-taught with all the electronics stuff, I paid for it by teaching a course on whatever thing I did most recently. Then I’d use the proceeds to buy tools and parts for the next big (often dumb) idea. I’d also ask for the software engineering assignments from colleagues in those programs, and complete them in my spare time. It was puzzling to a few people why I would want to do assignments, and indeed some were very boring (oh god Java + Spring framework) but others were quite interesting (formal study of algorithms). Sadly, economic reality kicked in and I had to run a company instead of pursuing my education further (I still try to do one ridiculous engineering thing per year though).
I guess there’s a real risk (…like 100%) that I overestimate the motivation students have – so I think I’m going to take your advice and set the level of abstraction with something API-like to abstract away the low-level components (this is closer to my client’s domain). I’m imagining a robot that acts as a WiFi access point, and having something “like an API” that works over UDP packets that describe high-level functions. Then start with something simple – like a digital map with known starting location, and a small obstacle course that can be completed with simple distance measurement, no point clouds. If that goes well, I can develop towards more complex material – probably not full SLAM, but maybe localization on a pre-mapped surface. I have plenty of my own code as examples of how to do simple UDP communications in Python, I could expand it into a custom library.
Sort of like Logo from 1983, but with a physical robot and sensors. I’m a little to young to have used Logo, but the computer lab in my school was really outdated so I got to try it once :D
- Comment on Considering positioning strategies for autonomous mechanum-wheeled robots 1 year ago:
Yup. Agree. Probably going to go with a LiDAR-first approach.
- Comment on Considering positioning strategies for autonomous mechanum-wheeled robots 1 year ago:
They’re university software engineering students, probably a year or two into their degrees. I’m hoping to provide the robots as completed units that are controlled via API, because we’re not likely to get many students with electrical, mechanical, or embedded backgrounds. You’re right about the complexity though, and that’s something I’ve been thinking about – I guess I’ll start out with a bit of optimism regarding their talents, and scale back if needed :D
I don’t really have a scope, budget, timeline, or audience properly defined for this project – in short my client has a STEM program for building and interacting with digital maps, but it’s way too boring and I’m determined to breathe some life into it. So I’m going to have to play a lot of things by ear.
- Comment on Considering positioning strategies for autonomous mechanum-wheeled robots 1 year ago:
Ok yeah – I’m leaning toward relying more on the laser ToF than the rotary encoders.
A simple algorithm of ‘pick a lidar point and drive toward it’ does sound simplest. Thanks for weighing in!
- Submitted 1 year ago to askelectronics@discuss.tchncs.de | 10 comments
- Comment on Attiny85 the right choice for 24h led timer? 1 year ago:
I use the Attiny10 in this context. At 3.5V operation and using the Watchdog timer + deep sleep… that should cost you about 4.5 uA when the lamp is off. Then a bit more when it is on (about 40uA assuming whatever the GPIO is connected to is high impedance), as you have to enable the I/O clock (but most things and peripherals can stay off). So an average consumption of 10.4 uA, or 31 years of operation off two 1.5V cells – of course they’re not rated for this long and the actual light will consume far far more power. The point is that the current consumption of the system is absolutely dominated by the light-producing component, in other words the control system is highly efficient.
You can implement as a state machine, e.g. something vaguely like:
Set WDT to trigger an interrupt instead of the RESET vector. Then set WDT to trigger after 8s. Then on wake increment a register (you will need 2 registers, 8 bits isn’t enough). Compare these registers to constants that set the timer duration. On compare match, change the machine state.
Machine state 1: GPIO HIGH, timer duration 4h, I/O clock enabled. CPU sleep mode IDLE. Machine state 2: GPIO LOW, timer duration 20h, sleep mode POWER DOWN.
I think in assembly language but should be a similar process in C++. I’ve successfully implemented very similar (night-light timing) algorithms on this chip. I can’t give you power consumption metrics as none have ever run out of power over the past 6 months.
- Comment on Another good reason not to open port 22 1 year ago:
Perhaps ironically, I live in a nominally Communist country that went through decolonization quite a number of times. It doesn’t change much in my daily life (I’m not really political), although I arguably own some tiny slice of the means of production these days. So maybe in retirement I’ll provide public access to those for working class people. That would be really fun, I think. Who knows what we might create together? Certainly if the machines are sitting unused in my retirement, they are creating nothing, and I would feel sad for the machines.
I don’t do the whole 9-5 thing. That would stress me out! I work as long as I feel like, any day of the week I feel like. Generally, this is really nice for both managing stress (there’s always tomorrow!) and steamrolling over any competition.
I’m just a mercenary (and a bureaucrat) though. You pay my fee in filthy lucre, and the job gets done – legally, and reliably. If someone annoys me with politics at a client, I just try and replace them with a computer program. The result is that several of my best coworkers are machines these days. I foresee that trend increasing with time.
- Comment on Another good reason not to open port 22 1 year ago:
Yeah… I couldn’t cope with that unfortunately (I’m a bit jealous, it sounds nice). I need to work long hours and make things, it’s a compulsion. “Taking it easy” can stress me out to the point where I end up in a hospital.
So I sold all my worldly possessions and immigrated to the developing world on an investment visa (where things are made). My timing was a few years early, but I had no path to a decent life left except having my own company in a growth economy – my entire industry vanished twice overnight in my home country due to changes in legislation.
Nowadays, looking at the local economy, there is no path to home ownership except for people who own companies, and maybe senior executives or senior software engineers. An average university-educated couple would have to save 100% of their income for their entire adult life to afford a nice home – if they don’t have kids. I think this kind of cruel equation is slowly coming to the West too – although you guys have more land so I guess it takes longer.
- Comment on Another good reason not to open port 22 1 year ago:
One of the sad aspects of my job (in IT) is building tools to eliminate less stressful jobs, especially ones that pay well (usually management or accounting, in my case). Design has definitely been a specific target in recent years though – off the top of my head I could at least imagine two approaches to writing a tool that automates color and font selection with results comparable to human expertise.
This is one reason it’s a good idea to regularly study new things (IT or otherwise). I have to retool every few years as whatever I know becomes obsolete – this used to mainly be a frustration in IT, but is rapidly becoming a necessary process in other fields. It won’t be necessary to become an IT expert, but I would keep up-to-date on how to use the new tools technology provides… especially if I wanted to keep a job in say, graphics design or copywriting!
(Incidentally, my first job in this country was in marketing! It was high-stress and I did not earn 130k. I recall font and color choice processes vividly :D)
- Comment on Neat trick for desoldering many-pin components 1 year ago:
Haha, I’ve done that too. However sometimes it rips the pads off or otherwise damages the vias. So instead I cut them along the other axis (parallel to the PCB), then remove the remaining nibs.
These days I mostly use a hot air rework station though. In my city this is integrated with many soldering stations on the market, for maybe an extra 10$. I think mine is Yihua brand, it’s quite OK.
- Comment on Continuous operation of a general purpose relay? 1 year ago:
I was thinking about that, but if they are using 12VDC + light load a MOSFET would be more cost and space efficient, and probably more electrically efficient too. No real voltage drop, and just a few milliohms added to the load.
I mainly use SSRs to switch mains power, although it’s true they can be used for other things too.
- Comment on Continuous operation of a general purpose relay? 1 year ago:
I sort of hate relays. For 12VDC and a light load, I might consider a depletion-mode MOSFET and a diode to protect the battery. Much faster switching time than a relay, and quite probably lower internal resistance! Also no moving parts and much lower current consumption. There are some cases where it’s not appropriate though.
Anyway, I looked through the datasheet and you’re right – no mention of wear and tear from just leaving the solenoid energized, only from switching. Failure time also seems to increase when switching high currents. Since you don’t seem to be doing either of those things, I think you should be in the clear.