Electronics - Tumblr Posts
doing the worst soldering job of my life rn wish me luck š
not me tryna fix my old ass headphones š theyāre expensive tho so Iām giving it a shot


Repairing the USB cord on my Wacom Intuos 3 because I am a cheap bastard...

I just... I was trying to sleep, ok? And I am back at my parents' for the summer and the place has just been hit by a pretty heavy summer storm, so the power is a bit touch-and-go (it blinks out from time to time), and.
Like
I was trying to sleep when I was yanked awake by a series of mechanical sounds along the lines of:
```CLUNK```
- beep!!
```BAAAAAAAAAAAAA, ska-KLANK!```
- Boopš
And for a moment I was like, WHAT THE FUCK WAS THAT, but then I remembered that Dad installed a "continuity group" (that is, a battery that sits between the wall socket and the modem/router to make sure that the power fluctuating doesn't knock out our wi-fi) and an auto resetting braker (that, when tripped, tries to fix itself three times, then gives up).
And like,
Did I just witness a discussion between them????
The power went down for a split second -> the braker tripped -> the battery yelled "oi! Power's down over here! -> the breaker went, "my bad, lemme fix it" -> the battery booped in satisfaction, then turned off.
And like, I knkw that's not what happened, and they were just working indipendently. But it's so stupid, I feel oddly sentimental about this?? Like, it's machines working and all that, but that's beautiful in its own right! No?

Hmm, wonder what this machine could be for...?
If you can plug it in and it turns on, IT'S NOT DEAD. Okay? Coma, they go into COMA(going dormant is also acceptable).
Please, do not let them mislead you.

Electrophysiology setup from the lab I used to work in, now in painting form!
Midcentury Family Room - Family Room

Large open concept game room with a media wall in the mid-century style
fun fact it actually is
Reblog is youāre an AAA or AA Battery
Be it any combination is Autistic, Agender, Asexual, and Aromantic; and congratulations, youāre now a battery.
And hey, weāre power, and the world canāt function without us!
I myself am a AAA Battery, Autistic, Asexual, Aromantic.
It's fixed now! Nan fucked with the wires and it's been taped together!



It's kinda dark in here and I couldn't post the video unless I made it a gif but you needed to see the claw.


See y'all soon I guess (my phone's on 3% and tumblr won't work on my laptop for some reason)
Frustrations
Following other developers, learners and makers are great. It facilitates learning and gives inspiration
But one thing that is often missing from people telling about how it is going, is the failures, frustrations and problems any developer will run into.
For this reason, two of my favorite maker youtube channels are Extractions&Ire (Chemistry) and Code Bullet (machine learning). Because these madlads are brave enough to not just show their process and result, but also their failures, mistakes and errors. And how they overcome them. Not always by learning (Sometimes making a dumb mistake is not really something you can learn from...)
It's good, because it's real.
Code tutorials and guides can give the impression that the normal process of development is "Open IDE, code, fix tiny typo error, compile, success". They don't do it out of malice, but out of a want to be concise. Which is fair.
So I also want to share when things do not go so well. I have programmed Atmel's AVRĀ Chips for quite a while now. But I have done it mostly in microchip studio(former Atmel studio) and a bit in the arduino IDE. A job I am currently applying for, uses visual studio code. Which is fair enough. So to prepare for this specific job, and to acquire this quite good-to-have skill, I want to set that up for myself First things first, since I have not done this before, I cannot know if my code would have a weird error so I want to know everything else is working first. So I write a tiny program which simply have the microcontroller increase a number every 2 seconds and write it to my PC over UART. Takes 2 minutes.... I grab one of my Arduino Nano boards and a USB cable for it. And then... I cannot flash it... Its communication protocol have troubles.
I have seen this before. It is to do with the cables not being correct. If they are USB 2.0, very little magnetic noise can cause trouble. (And you cannot tell if a cable runs USB 2.0 or 3.0 by looking at it... because the universal serial bus is not universal... Insert grump rant here) I then spend an hour finding and trying different USB A to USB B-mini cables. Give up, notes down to buy (and MARK) some USB 3.0 versions for the future. I then grab a Arduino Uni instead, as they use USB B, which is much more resistant to noise... And then spend half an hour trying to find a the cable, as I do not have a lot of them, since... nearly nothing uses them. Finally find it, and yes, the program can now be flashed. So I packed all the cables I tested back in their places, after marking them so I will(hoefully) not have to do this again. Had to take several breaks feeling depressed and grumpy, and all in all, this adventure took 4-5 hours. And now I can START on this... And this is how work sometimes is. And that is ok. It is still... VERY frustrating ...
Sometimes you just accept a flaw and move along
So I am building a robot from scratch. It just needs to be a platform for my other projects. It takes Twist commands (Basically, orders how fast to move in what directions) and return odometry (Basically, where the robot thinks it is), both over wifi via the HTTP protocol. Because the odometry math is a lot easier with stepper motors(motors that moves in tiny discreet steps. Usually several hundreds for a single rotation), these are what I am using: I am using 2 TMC2100 boards to drive them. These have 2 pins that you can set to Ground, supply or let them float, and they are used to configure what amount of micro-stepping you want to do (If a stepper motor have 200 steps for a rotation, micro stepping 4 means it takes 4 smaller steps to do one of those 200 "real" steps, and so takes 800 steps for a full rotation) All great... eeeeexept... for some reason the configuration pins just does... nothing, no matter what I set them to. The boards are just stuck at 16 micro-steps, as if both pins where set to supply. This limits the robots speed to 0.3 meters per second... which is... fine. The amount of work and money it would take to fix this(Likely I would have to buy new boards) is not worth a speed boost that is not needed for the first 2-3 projects I want to test on top of it... so I am just leaving it. "Perfect is the enemy of good" and all that... but it still feels unsatisfying... blaaa
The Universal Serial Bus is often not universal...
So there is this problem you often run into when doing development. You come up with a solution. You research the solution, and find only tiny amounts of people talking about it, and/or they seem to say many different things and disagree. Most of the time, that is for 2 reasons 1: it is a very novel solution, so no one have tried it much, and everyone who have, has made very custom versions of it. 2: There are variables that makes it impossible to do it in one single way. I needed a rechargeable battery system to power my robot. These can get... VERY complicated, and pre-made solutions can quickly be expensive and you might end up with batteries catching fire, or destroying the batteries so they can never be used again. You need protections on them, but which kind depends on a bunch of things. I know electronics, but I am mainly a software guy, and I know when I do not know enough about electronics to do it myself. This being such a case. So, I came up with the idea to use powerbanks. One for each steppermotor, and one for the microcontroller(so the noise fromt he motors could not cause issues).If I use ones that can output enough amperage, they should just work and they are cheap. They are meant to be used by normal costumers, so have all the protection needed, and are quite idiot-proof(Which is a very handy thing when you are an idiot, like me) so should be easy to use. But I could not find much info about doing this... and I did not realize I was looking at reason 2. Basically, BECAUSE powerbanks are idiotproof, they do not want to discharge themselves unless there is a real device at the end of the USB cable. So if they cannot detect one, they turn off after about a second. How do they determine if there is a real device? Depends on the power bank.... No really, there is NO standard way to do it, as far as I can tell. And it does not depend on the power bank MODEL. I have 2 identical power banks, bought at the same time, and they do NOT behave the same. Which means that when I connected the powerbanks to supply my system, they (SOMETIMES) did not supply anything. Some check how much current is being drawn, which can be faked with a resistor wasting some power. 500mA was being quoted a lot, but that is more of a "That is probably enough to get it going". Others check for impedance(Basically, also resistance, but from frequency dependent sources). Those can be "faked" by having a coil or a device that acts like one to the faking resistor. I wanted a tiny 5 volt fan to cool the stepper motor drivers anyway, so I had one power bank also power that. That ensured that it actually stayed on (But if I used the other, (identical!) power bank it just turned off anyway). The other one could be connected up directly. If I used the powerbanks lower amperage socket. If I used the high amperage one, it just turned off. So now it works... I have 2 powerbanks for the motors, each with painters tape marking which powerbank and socket to use for what. Took me a week longer than I had hoped to figure all this out and do all the experiments. Sometimes, things that should be simple are just headaches.
It works!*
So I (FINALLY) put the final touches on the software for my robot PROTO! (Listen, I am a software person, not a coming-up-with-names person)

Basically, it is a ESP32 running him. He takes HTTP messages. Either GET odometry, or PUT twist. Both just being a string containing comma separated numbers
Odometry is the robots best guess based on internal sensors where it is (Since PROTO uses stepper motors, which rotates in tiny tiny steps... it is basically counting the steps each motor takes)
Twist is speed, both in x,y and z directions, and speed in angular directions (pitch, roll and yaw). This is used to tell the robot how to move

Now, since PROTO is a robot on two wheels, with a third free-running ball ahead of him, he cannot slide to the side, or go straight up in the air. You can TRY telling him to do that, but he will not understand what you mean. Same with angular movement. PROTO can turn left or right, but he have no clue what you mean if you tell him to bend forward, or roll over.
The software is layered (Which I use a BDD diagram to plan. I love diagrams!)

Basically PROTO gets a twist command and hands that over to the Differential_Movement_Model layer.
The Differential_Movement_Model layer translate that to linear momentum (how much to move forward and backwards) and angular momentum (how much to turn left or right). combines them, and orders each wheel to move so and so fast via the Stepper_Motors layer.
The Stepper_Motors turns the wanted speed, into how many steps each stepper motor will have to do per second, and makes sure that the wanted speed can be achieved by the motors. It also makes sure that the wheels turn the right way, no matter how they are mounted (In PROTO's case, if both wheels turn clockwise, the right wheel is going forward, and the left backwards.). It then sends this steps per second request down to the Peripheral_Hub layer.
The Peripheral_Hub layer is just a hub... as the name implies, it calls the needed driver functions to turn off/on pins, have timers count steps and run a PWM (Pulse-width modulation. It sends pulses of a particular size at a specific frequency) signal to the driver boards.
Layering it, also means it is a lot easer to test a layer. Basically, if I want to test, I change 1 variable in the build files and a mock layer is build underneath whatever layer I want to test.
So if I want to test the Stepper_Motors layer, I have a mock Peripheral_Hub layer, so if there are errors in the Peripheral_Hub layer, these do not show up when I am testing the stepper motor layer.
The HTTP server part is basically a standard ESP32 example server, where I have removed all the HTTP call handlers, and made my own 2 instead. Done done.
So since the software works... of course I am immediately having hardware problems. The stepper motors are not NEARLY as strong as they need to be... have to figure something out... maybe they are not getting the power they need... or I need smaller wheels... or I will have to buy a gearbox to make them slower but stronger... in which case I should proberbly also fix the freaking cannot-change-the-micro-stepping problem with the driver boards, since otherwise PROTO will go from a max speed of 0.3 meters per second, to most likely 0.06 meters per second which... is... a bit slow...
But software works! And PROTO can happily move his wheels and pretend he is driving somewhere when on his maintenance stand (Yes. it LOOKS like 2 empty cardboard boxes, but I am telling you it is a maintenance stand... since it sounds a lot better :p )
I have gone over everything really quickly in this post... if someone wants me to cover a part of PROTO, just comment which one, and I will most likely do it (I have lost all sense of which parts of this project is interesting to people who are not doing the project)
What is even some companies websites...

Jobhunting is WILD! Your self confidence is just on a roller-coaster. One minute doubting yourself because of the ghosting and rejection (Yes, big professional companies behave with all the maturity of a 14 year old boy starting online date and being very bad at it) and the next I see shit like this... And I am CLEARLY very competent compared to whoever did... this... I am not taking that picture out of context, that is a picture on the website of a electronics firm that intents to convey (checks notes)... enviromentalism.... Which perfectly explains the well dressed sitting dude with the birdnest with eggs he clearly stole from some birds, winking at me and making fingerguns... Did someone go to their companies unused stock photo assets and hit random? What is happening??? Source:

I am low level engineer. As such I am NEVER let ANYWHERE near a costumer or ANY decision that involves "How do you feel people should use computers?". I am a low level engineer. When you ask us such questions, answers like "Working in the shell is most of the time nicer than a GUI" or "No I DO think forcing the consumer to insert the settings for their automatic curtains in a hex code they generate based on several tables in the manual is a reasonable way for this system to work". So AS a low level engineer, I can only say... yep, put it up to 12. I once used one to melt tin and used it to solder with, and I am sure many users will face simillar needs of their toasters since that is completly reasonable behavior.

What is half-adder and full-adder combinational circuits?
So this question came up in the codeblr discord server, and I thought I would share my answer here too :3
First, a combinational circuit simply means a circuit where the outputs only depends on its input. ( combinational means "Combine" as in, combining the inputs to give some output )
It is a bit like a pure function. It is opposed to circuits like latches which remembers 1 bit. Their output depends on their inputs AND their state.
These circuits can be shown via their logic gates, or truth tables. I will explain using only words and the circuits, but you can look up the truth tablet for each of the circuits I talk about to help understand.

Ok, so an in the case of electronics is a circuit made with logic gates ( I... assume you know what they are... Otherwise ask and I can explain them too ) that adds 2 binary numbers, each which have only 1 character.Ā
So one number is 1 or 0
And the other number is 1 or 0
So the possible outputs are are 0, 1 and 2.
Since you can only express from 0 to 1 with one binary number, and 0 to 3 with 2, we need to output 2 binary numbers to give the answer. So the output is 2 binary numbers
00 = 0
01 = 1
10 = 2
11 = 3 // This can never happen with a half adder. The max possible result is 2
Each character will be represented with a wire, and a wire is a 0 if it is low voltage (usually ground, or 0 volts) and a 1 if it is high voltage (Voltage depends. Can be 5 volts, 3.3, 12Ā or something else. )
BUT if you only use half adders, you can ONLY add 2 single character binary numbers together. Never more.
If you want to add more together, you need a full adder. This takes 3 single character binary numbers, and adds them and outputs a single 2 character number.
This means it have 3 inputs and 2 outputs.

We have 2 outputs because we need to give a result that is 0, 1, 2 or 3
Same binary as before, except now we CAN get a 11 (which is 3)
And we can chain full adders together to count as many inputs as we want.
So why ever use a half adder? Well, every logic gate cirquit can be made of NAND (Not and) gates, so we usually compare complexity in how many NAND gates it would take to make a circuit. More NAND gates needed means the circuit is slower and more expensive to make.
A half adder takes 5 NAND gates to make
A full adder takes 9 NAND gates.
So only use a full adder if you need one.
Geeks for Geeks have a page for each of the most normal basic cirquits:

I hope that made sense, and was useful :3