AnaDash
Hardware- 22 Devlogs
- 58 Total hours
An cool looking dashboard for your PC! Features 4 analog meters for resources, an macropad and even a oled screen!
An cool looking dashboard for your PC! Features 4 analog meters for resources, an macropad and even a oled screen!
Let me first begin by saying, that this line:
meters
.fast_write(dash.cpu_load, dash.cpu_temp, dash.mem_used, dash.swap_used)
.await
.unwrap();
hardware.ldac.set_high();
Kinda took me an hour to make, and 2 hours in ADHD sidetracking.
So, to get to this line, I had to remake the driver, not only because I was using computationally expensive floats, but because an u64 for an value between 0-4096 was wasteful of bytes.
While on it, I sidetracked and decided to redo the way the driver interfaced with the USB device, because it felt quite unprofessional to just bake in the serial port.
So, I wrote this fancy function that gets the serial port via the VID and PID, and it looks something like this:
let keyboard_port = match utils::get_serial_with_vid_pid(DEVICE_VID, DEVICE_PID) {
Ok(port_info) => port_info,
Err(e) => {
panic!("Error getting serial port! {}", e.description);
}
};
let mut keyboard_cdc =
match tokio_serial::new(keyboard_port.port_name, 115200).open_native_async() {
Ok(port) => port,
Err(e) => panic!("Error opening serial port! {}", e),
};
As you can see, it’s now way more professional!
After that bit of sidetracking, I finally redid the types, and when I realized I would need an arduino style map functions, and that I was bored without internet, I rawdogged an library using the rustup documentation, not tracking the hours tho. You can get it via the crate “map-arduino”, and it works with all data types, I’m proud of myself!
Finally, after all that work, I had to do the MCP4728, and that line in the start took a loong time, mainly because theer were 500 different I2C types and I didnt understand anything, but, at last, it works ;D
I took a break from programming and decided to go back to PCB design, I replaced the screen pinout, and, more importantly, added an debug UART pin so you can get logging, while on it, I realized I would have to move a bunch of connectors! So i spent over an hour painfully rerouting, only to realize it broke more, I also had to rethink the pull up resistors because those had nowhere to go, anyways, thankfully everything’s working now, so i’m happy.
After that break, I decided that I would start the handler for incoming host messages, but, for some reason, which I dont know, I started doing the README??? anyways, the readme is very pretty and has instructions on how to compile now, so that’s great ^^. Then, for some reason I decided to do the driver again?? I improved it, and it now gets the serial port using VID and PID, wayy better, it was just painful figuring out for the first time how to use results!
And on a more unrelated note: If you noticed, yes, I’m purposefully delaying the CAD part because it’s been hell whenever I tried it, fusion 360 simply won’t run and I’m not sure if onshape is good for polishing, also I’m so scared of the deadline cuz I’m not sure if JLCPCB can get the parts here in time, the BOM is also scaring me, seems so complicated.
As the title says, I finished both of them and I’m very excited to move
on to the next step which is driving the MCP4728 :D ! The rotary was
tough because there’s 700 hundred libraries, but I picked the one
someone in youtube had used, as that’s an good proof. The CDC was tough
understanding the new concepts, but i’m proud it turned out ok!
I started developing the firmware, BUT IT’S SO HARD AND CONFUSING, while
I had a bit of an whiplash when I started developing the driver, it was
nothing compared to what I’m currently experiencing with the no_std
embassy firmware.
I don’t really understand what I’m doing, I’m having to learn new
concepts such as lifetimes and other stuff and it’s so confusing and
messy, it’s making me crazy.
To make matters worse, I was about to delete part of the firmware to
start over but somehow the problem went away???????????
What??????????????? It doens’t make sense, nothing should be working
here, but somehow, it does, and that does not make sense
Nevermind the error is back, it just wans’t included in the commits, I
have no idea, i’m tired.
I have figured out that partial move issue! :D All I had to do was just
stop trying exporting the peripherals object, so that’s solved :D
I have finished the part that sends the macro keys to the computer, and
i’m really proud of how it turned out! I’m also proud of the solution I
used to save up memory, which is an bool array made out of one u8 int! I
save up 7 bytes, which is small, but you gotta remember our memory is
constrained! I also implemented the encoder switch, and I’ve been making
more use of consts!
The next step will be implementing the CDC!
I did spent an hour attempting to understand how heapless strings
worked, and how serialize and deserialization worked, but, I’m happy to
say that I have an working driver. Sure, it’s not ready by any means, it
needs an package, and other stuff, but it’s good enough for me!
The rust driver is nearly done :D
It gets the system information, it gets notification, gets mpris player
information, and gets the time.
It wanst easy, I spent a lot of time learning tokio, I also had to learn
some concepts about parallelization, but i’m really happy with how it
turned out :D
I have been struggling with an creative block for some reason, idk, it
just feels daunting to finish this.
I have made the labels for the meters, at the cost of my sanity :(
For context, the measurements and arch thing I am borrowing from Lex
Bailey at Computing the Details, however, the rest I made from scratch.
For the first 20 minutes, things went smoothly, and i added the label of
what the meter measures, along with 50% and the unit it’s measuring.
But things did take a turn when adding the other 2 values.
See how it’s at an angle (because this is a needle meter), it was hell
to align it with the text, I spent an hour of my life frustrating about
how do I even do this, in the end, the solution I decided upon was just
accepting defeat and making it roughly accurate, but it’s quite an
bummer
I have labeled the connectors on both PCBs! Why? Because I realized my README got confusing with the pinouts, and I realized it would be an struggle to connect everything based on a single markdown file.
Another thing I did was divide my rust code. Why? Well, I realized it was going to get big, and to prevent 1000 line monster files I spun off the part of the code that gets sensor data into another file
Another thing: Right now, I have no idea about what should be the next step of the projecrt, and it’s driving me nuts! I’ve also been struggling about what the BOM should look like.
I have switched from the adafruit prebuilt DAC module to the raw MCP4728
chip, this way, I cut the cost of the DAC in about half. Since it was
my first time doing a raw chip, it was pretty tough, and quite
complicated to understand, took 2 hours of my life. But it works, it’s a
mess tho, but hey, I’m glad it works!
It feels a bit wrong too, idk why, I might have to do a clean up.
I have switched displays, why? Well, I realized that having some constant UI on an OLED display will quickly lead to burn in, so that’s a major change. I’m glad I haven’t actually started designing the UI, so I didn’t lose a bunch of time designing for a monochrome display.
I rewrote the whole entire thing, and we finally have achieved drivers
:D, reading the cpu load average, memory and swap were pretty easy, as I
had already done it before, the only issue was reading the temperature,
I did have to learn quite a bit, but it works, I also have added the
time too!
Now, it’s not ready in any way, shape, or form, for now it just prints
the data to console, but i’m overall really happy with the results!
Next devlog I’m making firmware and finally moving on to the monster
that’s named 3d modeling, I did try it today, only for onshape to not be
really good and fusion just refuses to run.
Do note that this is just the beta firmware, I’ll hold on the fancy
features for now, and will only be adding them when I get to build it.
Today, I woke up feeling like doing the drivers, so that’s what I at least tried to do… However, I am struggling to find a library handling both cpu temperature and memory and it drove me insane!I am probably going to have to accept defeat, and instead opt for getting memory and swap from sysinfo rust crate, and temperature from the hwmon or thermalzone files in Linux…
Today, I finished making the PCBs! You may wonder “didn’t you do that in the last devlog?”, and yes, I did. The difference is I fixed many of the mistakes today, such as using solid connections which would make soldering impossible, or ground continuity mistakes. Anyways, I’m now pleased to say that they are actually finished. Next devlog we maybe get a case?
I have finished both PCBs :D
It was pretty smooth actually, I haven’t got it sanity checked yet, but, I’m actually surprised due to how smooth that went. The biggest issue was getting the 3d models just right, and also figuring out where to place stuff. Also, making sure both connectors were matched was sorta an issue. Also, I have begun writing the README, but, I’m struggling a bit with it.
Making the PCB was actually rather smooth. Now, I DID encounter some issues. But it was mainly with the 3D model of the DAC I had downloaded, but the fix for that was just making one myself with the Adafruit PCB Design files.
I’m very very happy and proud of this work :D
Basically, I went to check the ERC and I had 46 errors. Half of them were simply a lack of an not connected symbol
However, the other half was just something else.
What happened, was that the connectors were all specified as bidirectional pins, so, when I grounded one of the pins, KiCad freaked out like i just put 120V on an I2C line
So, I decided I should try making my own symbols manually
Kicad sent my symbols library to outer space as soon as I created it, and I spent 20 minutes trying to find where did it go. Not only that, but I didnt even need to actually make a new symbol! I was using one connector symbol library, and all I had to do was switch to the other!
I hope I can start making the PCB now
And if you’re curious, the ammeter is our gauge, the thing we are gonna drive.
Also, a few minor changes:
Basically, i HAD begun designing PCBs, keyword HAD.
Now, it took 90 minutes of my life for me to realize something:
For context, you need to understand that this dashboard will be sitting at angle, for the sake of ergonomics.
So, during the design, I realized something, which was that mounting an pico at an angle would make it hard for the USB cable later.
I also ran into the issue that the PCB would be too big to fit in JLCPCB promotion of 5$.
So, after thinking, I decided the best course of action would be to split the design into two PCBs, now, I haven’t started the PCB part, but I did start the schematic part.
I also took this oppurtunity to make the schematics pretty.
Remember that cad from yesterday? Well, basically, I made an useless box. Why? Because I dont have a PCB to put there, and the measurements were wrong, so I’ll have to redo the design. I’ll explain it better the day I do the 3d design
Second, I have re-added the rotary encoder switch, I also had to change the switches’s pins because I realized routing the switches wire to the other side would be awkward. (You see, it would be 4 switches on one side and 4 on the other)
Another improvement to the schematic today was the addition of test points and status LEDs for debugging.
Today, I realized going to the esp32 was a pretty dumb decision, because it doenst come with USB support natively (which I need for the macro keys), so I went back a few commits to the pico
I then meddled a bit with onshape, but got tired quickly and decided to spend the day drawing up the UI, only to realize lopaka doesnt do it well
So I went back to onshape and made this case, which will hold 4 analog resource monitors, an OLED screen and 8 macro keys
Basically, I figured out I was looking for exact precision, when not even the machines are that precise
So what did I do then?
Well, I still used Kicad’s finest grid of 0.001mm, and i got the thru hole aligned with a precision of 0.0005mm, or 5 microns, which is 0.25x the size of an human hair.
I begun to wire the DAC and the meters, which is quite simple. You may notice this curious arrangement of 2 330ohm resistors in series, it’s because they dont make 660ohm resistors
Today, i have started the development of AnaDash, this project aims to
be a cool dashboard for your PC, featuring 4 analogue resource monitors,
a few macro keys, and an OLED screen for showing whatever your heart
desires!
Today, I begun the project, then realized that i can’t find the DAC
breakout board online, so what i did? I decided to make my own footprint
What I didn’t realize, is that for some reason, the PCB adafruit
provides is not aligned, this is def an issue in my part during some part
of the conversion process.
Even on the finest grid, it’s still off, just why?