HAL9k hacks: Arduinostyret vindspil som vækkeur
Bastian har en notesbog hvor projekter opstår. En af skitserne er blevet realiseret i form af et Arduino-styret vækkeur i form af et vindspil.
Bastian har en notesbog hvor projekter opstår. En af skitserne er blevet realiseret i form af et Arduino-styret vækkeur i form af et vindspil.
20 feb
Kommentarer lukket til HAL9k hacks: Elektrificering af ladcykel
Nikolai er i færd med at montere en elmotor på sin ladcykel i HAL9k. Der er lidt der skal mases og bukkes lidt for at det kan lykkedes, men gåpåmodet er der cyklen venter med stor forventning på at blive gjort højteknologisk.
23 jan
Kommentarer lukket til HAL9k hacks: Søren vil styre et kirketårn med ESP32
HAL9k hacks 2025-01-23. Søren taler med Georg omkring en opdateret kirkeklokkestyring baseret på ESP32. Den gamle Arduino-version skal opdateres 🙂
06 jan
This could happen to you: A really cool LED lamp was found online, on a Danish and well-written homepage. Unfortunately, when the lamp arrives it is a cheap Chinese production, of questionable quality and safety. This is a non-rational quest to make such a cheap LED lamp safe to use.
From the outset the wires are tiny. The wires are connected with wire nuts *gasp*! (Wire nuts are basically unheard of in Europe). The LED driver itself that converts the 230V AC into DC has absolutely no separation, and as we will see later, absolutely no safety features. It did have a cool feature of changing light color temperature by turning the lamp on and off a couple of times, though.
But happily going to 300mA when shorted, going up to 118V unloaded, and full willingness to spark away, is a deal-breaker. This abomination was not being powered on in this house! It should be possible to replace the unsafe parts with safer (and more expensive) parts.
The first step was understanding the mess of wires. This took quite some pondering to figure out that all the LEDs were basically in series, and that it was wired with a “common positive”, with either the white or the black wire (or both) acting as ground depending on the wanted color temperature.
In the end the entire schematic was reverse engineered.
That LED driver was going nowhere but the electronic garbage bin, so a replacement of decent quality had to be acquired: a constant-current LED driver (configurable from 200mA–350mA) was purchased from a reputable source. That gave the next problem: an LED driver of quality was at least double the size of the unsafe one, and did not fit in the original round enclosure. 3D-printing to the rescue, and a new bigger round enclosure was printed.
Now everything should be able to fit and work! Instead of that illogical wiring of putting the LEDs in series, why not just put the two parts in parallel? Well, that won’t work. Only the path of least-resistance would light up, in this case the dome LEDs. So, back to the original wiring in series.
Unfortunately, the next problem was that the new LED driver was unwilling to drive LEDs as originally wired, that seemed to require somewhere above 45V, out of spec for the new driver. More stuff had to change. Looking at the schematic, the long strip in the circle could be cut in half, and the two half put in parallel instead. This should reduce the power going to those LEDs, and thus also the light output, but should also help to decrease the required voltage. But first I had to learn again the hard way that putting LEDs in parallel they need to match quite closely: the original LED strip had 11 segments, and dividing into 6 and 5 gave lights only in the one part.
Reducing to 5 and 5 segments worked really well!
Finally, the total voltage of putting the two parts of the lamp in series was below what the new LED driver would supply.
The only task remaining was to fit everything back into the enclosure, and add copious amounts of Kapton tape and hot glue. And finally, the spaceman could go star-fishing – safely.
21 okt
Der findes rigtig meget åbent data om det danske energi system hos Energi Data Service, f.x. spot prisen på elektricitet og CO2 prognoser per kWh. Det er dog overordentligt svært at finde den samlede pris man betaler som forbruger per kWh, pga. det uigennemskuelige datasæt over tariffer og priser. I frustration kom udbruddet: “Giv mig nu bare elprisen.somjson.dk” der nemt summerer alle priser og afgiter per elselskab, er open source og uden yderligere dikke-darer.
For en forbruger i Danmark er strømprisen en sum af forskellige priser og afgifter, nogle faste, nogle dynamiske:
Dette er alle de uundgåelige priser og afgifter, der kan regnes ud udelukkende fra adressen. Derudover kommer så det “frie elmarked”, hvor der skal betales til et elselskab: typisk månedsabonnement og et tillæg til spot-prisen.
Som om det ikke er uoverskueligt nok i sig selv, bliver vi nødt til at snakke om datasættet Datahub Price List. Der er flere åbenlyse problemer med det:
Efter at have regnet de fleste af de ovenstående problemer ud, skrev jeg en API-proxy der udstiller det API man i virkeligheden vil have: givet en dato, og et elselskab (eller en adresse), returnerer den prisen time for time som et JSON dokument. Prisen er typisk tilgængelig fra kl. 13 dagen før. Som bonus får man også CO2 udledningen med, hvis den er tilgængelig (typisk kl. 15 dagen før). Det er implementeret som en ren API proxy, dvs. det er ren omskrivning af input og data og ikke andet.
Det hele er open source, men der kører en version på elprisen.somjson.dk som frit kan benyttes.
Der findes andre API’er der opfylder forskellige use-cases:
27 feb
Kommentarer lukket til HAL9k hacks: Arduinostyret vindspil som vækkeur