2025. december 14., vasárnap

Log No.2 of the 25/26 Hungarian National Engineering Olympiad

OTIO 2025/26: Almost done with the circuit design


Alright, it has been a bit longer since the last post than I anticipated. In fact it's been so long that I turned 15 in the middle of it lol, but here we go.

First of all, I don't think I disclosed the name of the project in the last post. So, it's called OpenApollo (with blue Nordic Inline font). 

A few changes made since last time, mainly, I didn't like how no available UARTs would've been left on the CM5, so I changed the sensor handling STM from an STM32F042K6T6TR to an STM32F745VET6, which has a 100 pins and a bunch of UARTs, so now along with the previous sensors, it also handles the GPS and the servo current sensing PIC. All this means that the user now has 2 free UART channels to tie directly to the CM5 and probably even more to tie to the sensor STM (I don't remember).

Alongside that, I started working on the GUI for the 'ground station' via the NeutralinoJS framework, which means I unfortunately had to learn HTML and JS. Truly tragic. Seriously, NeutralinoJS is great for this because it uses webview, so it's basically cross-platform by default (and also has JS natively, so using APIs is easier). So far, I've managed to get the FreeStaticMaps API working after wayy too much time. Originally, I tried to use the OpenStreetMaps Maptiles API, but I had issues with zooming in on the maps, because as it turns out, map tiles are like... weird, because they're literally tiles and due to that, zooming kinda goes in a spiral and doesn't put the coordinates I want in the center, so Static maps were what I actually needed. 
Also, why can't RapidAPI just give me code that works by default? Why have you got to hide the source code from me, oh almighty Test Endpoint button? I swear coding this is harder than the circuit design and I refuse to use AI for anything other than explaining async functions.

I did finally decide on the HC-12 as the telemetry method, and it's the boring one, but actually better than the LoRa for multiple reasons. First, unlike the LoRa, its a transciever, so I don't need 2 modules taking up more space than all the other components combined. It can get a pretty good range with just software config, but I also replaced the stock spring antenna (which I'm pretty sure is just an ornament for this tbh) with an optimal 1/4 wavelength antenna, and wow, there is a huge difference. The lowest power mode on this is -1dBm and with the stock antenna, it could barely get through one concrete wall. Now with this antenna and still the lowest power mode, I can literally go 3 stories down and almost into the basement and still mostly get a signal (that's multiple meters of concrete and monopoles aren't even that good at radiating downwards). Originally I though about using what is presumably called a dipole colinear antenna (since its a combination of a dipole and a colinear antenna. duh), but I can't fit 2 antennas into the hole and a colinear array would also be way too large at 433MHz. It's a shame, but this isn't that bad either. The last benefit is that the HC12 is an SDR (I might be really wrong about this, but bear with me), so instead of having to press the pair button on the LoRa, which might not be accessible, you can just select a channel in software and that's it.

I should also revise the code for the PIC, because right now I have this part written 12 times, because I'm not sure how to increment binary numbers via code:

    ADCON0bits.CHS = 0b00000; //Select AN0
    __delay_ms(3); //Delay for channel switching
    ADCON0bits.GO_nDONE = 1; //Start sampling
    while(ADCON0bits.GO_nDONE == 1){ //Wait until sampling is done.
        
    }
    A0result = ((uint16_t)ADRESH << 8) | ADRESL;

But this would be much prettier if made into a function, so I might have to figure that out as not to get struck down by the C gods.

Also, I have a github set up now, so go to github.com/TzEngs if you want to see some absolutely atrocious code (or nothing at the moment).

It's 2:14AM, I'm absolutely done with writing this.

Tamás Zétény Tóth
TTZ

(P.S: I made a logo to put on the circuit board and now I'm gonna start putting it at the end of the posts. I think it's cool. Though I might have to rethink the Bauhaus 93 font)







Nincsenek megjegyzések:

Megjegyzés küldése

Log No.6 of the 25/26 Hungarian National Engineering Olympiad

 Damn. A lot longer than I wanted, but I honestly forgot about this blog. So, the PCB arrived in about mid-February, if I'm not mistaken...