askelectronics

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

rufus, in Considering positioning strategies for autonomous mechanum-wheeled robots

I think mecanum wheels slip quite a bit. So I’m not sure how effective those encoders are. But I’ve only ever tried 3d-printed ones. So I’m not super sure.

You’re sure your STEM students are ready to handle the LiDAR? Manage point clouds, do the arithmetic, path planning etc? We had a practical course with little robots. But they had 3 of those sharp distance sensors at the front and a bumper with a switch. This was enough to teach many concepts and also enough to implement for the students for something that was just a project and not a full time job. But I’m sure that depends on what exactly you want to teach…

And our robots hat the motor drivers (h-bridges) replaceable on socket terminals because every so often someone wasn’t very clever or didn’t listen in the lectures.

Saigonauticon,

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.

rufus,

Well, kids / young people / students will surprise you anyways. No matter what you planned ahead. I think teaching this way just requires you to stay flexible and try things with the students and see what works. University students will benefit from a little challenge, but it shouldn’t be impossible and get them frustrated. I’ve never taught myself, but I bet it’s difficult to hit that balance.

Programming little robots is awesome, though. I think it’s on a whole other level to see robots move and do tasks, than to look at your screen and program something that changes a few pixels there. My university course was more related to embedded devices and closer to the electronics. It teaches you valuable lessons when forced to interact with some electronics, real-world physics, constrained resources and you need to get your maths right. Usually students are concerned with something like Java, learning object-oriented programming or handling some big frameworks. Or learning maths. And robotics teaches you to really pay attention, combine different skill-sets and do things without an easy route available.

Maybe it’s just me who likes electronics too much. But I’m sure the kind of motivation you get by watching a real robot move and it runs your code, is unique. And kind of universal. You can do this in pre-school or in university to spark their imagination and motivation.

Your task is a bit different. If you’re teaching something like simultaneous localization and mapping and the students also have to deal with all the robotics, sensors and real-word problems, this might be more of an ordeal for them than fun. Even dealing with noisy sensor values is a hassle until you get to grasp the bigger picture.

If you’re giving them access to an API, you can choose and adjust what kind of abstraction you’re providing them. Give them something high-level or have them do more work. You could prepare most of the implementation and adjust the level of detail while teaching. Maybe skip something and give them working code via your API so they can focus on the problem they’re actually supposed to learn. You can also do it the other way round. Let them start with all low level stuff handled for them and learn the big concepts. Then let them dig down and see what your API functions have abstracted away until then. This way around you won’t run out of time.

I’m sure including actual robotics is going to get them more motivated in contrast to running a simulation.

Saigonauticon,

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

rufus,

Well, there’s also turtles to program in Python (i think) and there is Scratch.

I guess there’s a real risk (…like 100%) that I overestimate the motivation students have

Definitely sounds like it. But a motivated teacher is a very good thing. Maybe you’re able to get that spark across to some of the students.

API-like to abstract away the low-level components

You can always have some extra assignments ready, just in case someone is curious and wants to do/know more. A room full of studens will have a mixed amount of knowledge, abilities and motivation anyways.

I’m most interested in resource-constrained embedded systems. I like the attiny10 a lot.

I also ate a few books and datasheets on the Atmel chips in my lifetime. Their design is well-thought-out and probably an excellent subject to learn the concepts about microcontrollers.

As of now I like the ESP32. It is ridiculously overpowered if you’re used to something like the ATtinies or old ATmegas. With (at least) 520kB of RAM, two cores that work at 240MHz (depending on variant) and very nice peripherals. Also WiFi connectivity is really useful. But it definitely adds to the fun if you programmed the more constrained (previous generation of) microcontrollers and know how spoiled you are and can feel like a supervillain wasting hundreds of kilobytes of memory deliberately. Or (ab)use some of the peripherals for things that wouldn’t be possible with the few timers available on the Atmel chips. Or do trigonometry at crazy frequencies for your robots, because you can handle 32bit floating point numbers. But I’d agree, that doesn’t teach you the same things if you can do floating point arithmetics for cheap and don’t know if calculating a square root is an easy or difficult thing to do. The STM chips also have nice peripherals. But I haven’t really fiddled around with those.

Definitely hope you’ll have fun being involved in that STEM program.

Saigonauticon,

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!

Sieguito, in Considering positioning strategies for autonomous mechanum-wheeled robots

Even though you add encoders on the wheels it’s still an open loop locomotion method, you need the room to have a feedback of the position on the plane/in the space

Saigonauticon,

Yup. Agree. Probably going to go with a LiDAR-first approach.

LazaroFilm, in Replacement Bulb for Ultrafire WF-500 Flashlight
@LazaroFilm@lemmy.world avatar

My opinion: look for a new LED flashlight. It will have the proper circuit and design to take advantage of LED capabilities including high brightness, PWM dimming, power efficiency, and heat management. Adapting an incandescent flashlight will always be a compromise in one of those.

Edit: I have a similar flashlight and I bought a tiny usb-c rechargeable flashlight that is brighter for 1/5 of the size. And for battery life, you can recharge your keychain size light with any usb battery pack.

TCB13,
@TCB13@lemmy.world avatar

Yes, feature and price wise that would be the best decision… but I kinda feed bad trashing a perfectly good machined aluminum piece just because of a bulb. :(

elDalvini, in Replacement Bulb for Ultrafire WF-500 Flashlight

From looking at the LED bulb, I can tell you that it will not work very well in that flashlight.

The reflector of the flashlight is built so light coming from a very small source (like the filament of an incandescent bulb) is directed forward in a focused beam. With the led bulb, light is coming from 10 different spots, none of them being in the focus point of the reflector. The result will be a spread out beam that won’t be bright over longer distances.

The only type of LED bulb that could work is something like this car replacement bulb that keeps the light source to a relatively small spot. But I don’t think those are available in the size you need.

TCB13,
@TCB13@lemmy.world avatar

Thank you for the reply.

So your in your opinion something like this would work better: www.aliexpress.com/item/1005005278498808.html

But… I don’t believe that bulb does 500lm was advertised.

elDalvini,

Not really. With that bulb, all the light is focused forward, not to the side. The light will never hit the reflector, it is only focused by the lens in the LED housing, and that isn’t enough.

Reader9,

The reflector of the flashlight is built so light coming from a very small source (like the filament of an incandescent bulb) is directed forward in a focused beam.

I agree, but I also think that using a modern LED with a single source of forward-facing light is fine. However the emitter would need to be properly positioned in the light.

Here’s a very similar host (from one of the best low-cost flashlight makers) showing a properly aligned LED and reflector:

https://ae01.alicdn.com/kf/H00c7f1f2d2e14471aa89625d1f7719437.jpg_640x640Q90.jpg_.webp

Product link: www.aliexpress.us/item/3256801849471618.html

TCB13, (edited )
@TCB13@lemmy.world avatar

Well I emailed UltraFire and they will ship me a replacement bulb that is LED. They also say it is 600lm. I’ll report on how it goes.

TCB13,
@TCB13@lemmy.world avatar

Finally got a replacement head from them with a LED, works great, way less heat than before and most likely the light.

czardestructo, in Looking for some Guidance Finding a Power Supply for a CrocSee CRS-7A016 Micro Water Pump (specs in post).
@czardestructo@lemmy.world avatar

What did you hook up? You mentioned using cords? But first off, what you pictured, you need to make sure it’s wired correctly. There is no standard for barrel jacks. The center pin can be positive or negative and the jacket and be positive or negative. If you’re using a generic 5.5x2.1mm female barrel jack most generic 12v power supplies overwhelmingly do center pin positive and jacket negative. Once you get polarity correct check the amperage rating of the supply and the motor. Motors usually require huge in rush current to start and can easily trigger a short circuit protection on the supply output

Shortbus, (edited ) in Looking for some Guidance Finding a Power Supply for a CrocSee CRS-7A016 Micro Water Pump (specs in post).
@Shortbus@lemmy.world avatar

Since the pump doesn’t seem to mention it does the pump packaging/paperwork mention how many amps it draws?

Edit I found it. Load current < 350mA

I would think damn near any 12v DC “wall wart” would do it, but the adapter you have may not be the right size for what you have laying around.

Could grab something like THIS that comes with its own adapter.

lossykittens,

Thanks- I got the thing running through a breadboard power adapter of all things, to confirm the pump was still living, so I will try what you linked! I am beginning to wonder if I wired my last adapters’ poles. So, this might have been user error on my part, doh!

jjagaimo, in How to improve my battery measurement circuit?

You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:

https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png

My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair

nilclass,

Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?

When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time

https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png

and fully on, when a pulse is applied

https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png

Source:

spoiler$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0___

jjagaimo,

It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0

nilclass,

Nice, than you for sharing!

I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping

Yonrak, (edited ) in How to improve my battery measurement circuit?

Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?

Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).

Switch it with an NFET

The micro will see 0V or divided/clamped battery voltage on the measurement pin.

nilclass,

Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?

That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.

Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).

Not sure I understand this point. Which resistor would you replace with a diode?

Yonrak,

Not sure I understand this point. Which resistor would you replace with a diode?

Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).

Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).

The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.

I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.

WaterWaiver, in How to improve my battery measurement circuit?

You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.

A couple more things to keep in mind:

  • a fresh alkaline 9V battery is actually 9.6V or more, not 9V.
  • 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
nilclass,

You could probably increase the 82K and 10K resistors to be much bigger

That’s what I thought initially, but this stackoverflow post dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!

a fresh alkaline 9V battery is actually 9.6V or more, not 9V.

Indeed! 9.6V * 10k/92k = 1.04V is still below 1.1V, so I should be fine in this case :)

9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.

This is a good point!

My firmware will be pretty monotonic though, basically:

  1. wake up
  2. measure battery
  3. measure some other sensors (the actual task of the device)
  4. turn on a transceiver, send all the measurements (including battery voltage)
  5. turn off transceiver & go to sleep

So, the load should be always the same at step (2).

brendan,
@brendan@mastodon.brendans-bits.com avatar

@nilclass

@WaterWaiver

From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."

In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)

Black616Angel, in Can anyone help how to fix my led?

There is like a multitude of possible reasons.

Can you open it up, without destroying or damaging it?

If so, you would need a multimeter to trace, which components are broken and maybe you can repair them.

NextNoobi,

After opening up, it might also be obvious what’s the problem.

Double_A,
@Double_A@discuss.tchncs.de avatar

Most likely it’s just a worn out micro usb port, which are usually super shitty.

nilclass, in Can anyone help how to fix my led?

Could you share a picture? I’m having trouble imagining what you are describing

Saigonauticon, in Learning about electronics

Well, you could say that there are three branches of electronics: analog, digital, and discrete (sort of between the previous two). For your goals, you mainly need to learn about digital systems.

What you’ll mainly be dealing with in terms of digital systems are microcontrollers and other embedded systems. I’d say the main two places to get started with those are the Arduino and Raspberry Pi ecosystems. The first is “more pure microcontroller” and the second is “more advanced embedded systems”.

Microcontrollers are mostly programmed in C++ these days (with a few strange people like me using Assembly), and the Arduino ecosystem sort of teaches that. Microcontrollers are usually the most efficient system to make the control electronics for something like a keyboard. Sparkfun and Adafruit are good companies to buy parts to get started from.

Embedded systems like the Raspberry Pi stuff can often run a whole operating system. This is too expensive (power, space, and $) for most keyboard builds, but you may want to learn how to use them for other projects. However, they also make a microcontroller (the Pi Pico) which would be OK and can be programmed in Python.

For advanced computer peripherals, you might need to learn FPGAs. However, that can be a difficult topic to get into by comparison. So maybe leave that for later.

A good way to get started is to buy the parts for, and build, a few Arduino projects. There are specific libraries for making Arduinos emulate a PC keyboard too.

In terms of tools, at first you will just need a breadboard, some resistors, LEDs and jumper wires. Maybe a battery or USB power supply. A multimeter too.

Soon after you will probably want to learn to solder to start making your own standalone devices. You should get a soldering station with temperature control – some people swear by Hakko, myself I have a cheap-but-good Yihua soldering + hot air rework station.

Next, while Sparkfun and Adafruit are great businesses, they are not cost-effective ways to source a lot of parts. You’ll want to learn how to use the part search and ordering functions on Digikey, Mouser, Arrow, and RS Components. Maybe also McMaster-Carr if you do mechanical stuff.

When you have some working designs done, you will probably want to learn KiCAD. It’s software for designing circuits, and laying out printed circuit boards (PCBs) to send to a factory to be made professionally. Through the magic of globalization, this is actually pretty affordable! A typical run costs me 20-40$ for 10 units, and takes 16 business days – although I live in Asia, so it might cost a little more from the USA or Europe.

You’ll also maybe want to learn 3D modelling and printing, for designing cases (I struggle with this more than I’d like to admit). TinkerCAD is an OK place to get started, although tools like SolidWorks are certainly more advanced. You don’t need to buy a 3D printer unless you want to – you can just order your designs made online.

Anyway, the results with KiCAD + 3D printing can be really quite good and can last many years of use. They also let you share your design with others, so other people can make it!

Finally, if there’s a hackerspace / makerspace in your area, these are great communities of people you can learn from. Definitely check them out. They may have a 3D printer you can use, as well as other tools. Often they teach courses too.

One small note – getting from “hey neat this works!” to making and selling a product is (sadly) a really big step. So if you one day want to do that, build a network and ask for advice from someone who has gone through it first.

Cheery,

Man, that was a great read, from simple beginnings to selling your product. Thanks for the thorough explanation, I definitely don’t plan to sell anything, I was considering learning electronics as a hobby, but it’s good to know where to start if it ever comes to that.

Saigonauticon,

Glad to help! I find it quite neat that with effort and time, it’s possible to learn to make quite advanced electronic systems yourself at home. Some of the stuff the more advanced hobbyists make is quite a bit better than a lot of mass-produced goods. We truly live in an age of wonders!

XTL, in Is “harvesting” small amounts of electricity a fools errand?

www.iloq.com for example does a lot of parasitic energy stuff. Most of the advertised things now seem to be RFID, but I think they also had locks that are powered by the key insertion.

There’s plenty of places where infrastructure power is not available and a flat battery would be a disaster. Door lock is one mundane one. Space is one more extreme one.

RandomUser, in Learning about electronics

Arduino and esp32 are both good places to start. On YouTube look up ralph s bacon I think he is - He does lots of microcontroller stuff, and of course the likes of big clive will teach you all about basic electronic circuits.

If you’re a complete newbie, get a kit and work through the tutorials.

Stuff you’ll need at first is a microcontroller, prototyping breadboard and a few components (should all come in the kit of you go that route). When you have something that works that you want to keep, you can think about a cheap (ish) soldering station and either veroboard, or look into getting your own boards made.

A multimeter will help a lot (cheapish will do) and depending on how deep you get, a bench power supply and an oscilloscope, but you can live without those for a while.

Get good quality solder, and using extra food quality flux changed the game for me. If you are an older person, magnification really helps too!

Get components in 10’s or more as you’ll save a little and it doesn’t matter much if you let out the magic smoke. For hobby stuff, Alix is your friend.

Have fun.

Cheery,

Thanks, that’s exactly what I was looking for!

M_Reimer, in Learning about electronics

You want to get into microcontroller programming somehow. The Raspberry Pi Pico may be a good target to start with. The documentation is well made and you have the choice to either use C++ or Python for programming.

Cheery,

Thanks for the suggestion! I do know a bit of Python, so it should be easier on that front at least.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • askelectronics@discuss.tchncs.de
  • localhost
  • All magazines
  • Loading…
    Loading the web debug toolbar…
    Attempt #