"How hard can it be"

Post Reply
leif
Posts: 6
Joined: Wed Oct 14, 2020 1:55 am

"How hard can it be"

Post by leif »

That particular rhetorical question always gets me into trouble.

Hi!

My name is Leif. I started with electronics and soldering kits at a pretty early age (~7), but then migrated to playing with computers, eventually learning to program them myself (starting on an Amstrad CPC 464 and then a 286), and then had a pretty successful 20 year career based on writing digital signal processing algorithms on x86 in C/C++.

Electronics were always there in the background, but never the focus.. until last year, when I had a problem with my street side sliding gates that the installer wasn't able to solve. They'd sometimes get out of sync and chase each other rather than close together and open together. For a more detailed description please see this thread on the openhab forum.

I knew I could solve the problem with an algorithm, but algorithms have to run on something, and I wasn't going to put a PC there.. besides, it has been a long time since PCs came with parallel ports ;) . So, I remembered having heard of something called "Arduino" that never interested me before, and ordered my first Arduino Uno. I got the blink sketch uploaded, it worked. Then I unplugged the uno from the computer and plugged it into a powerbank... and it instantly started blinking. It had remembered the program I uploaded!
The emphasis may seem silly, but this was a paradigm shift for me. None of the computers I had used for the last thirty years did that! I couldn't believe how easy it was to get it going -- and it was just plain C/C++ code, which I could write in my sleep. I was hooked.

That was just last year. Since the beginning, I've now made _lots_ of projects, and designed and ordered several custom circuit boards, challenging myself a little more each time. The first board was little more than a carrier board with lots of MOSFETs for driving pool lights, but the last two boards not only have 220v right onboard, and some low voltage circuitry i designed myself, but also surface mount components mounted right from the factory.

I can't believe how much fun microcontrollers and electronics projects are. In my professional work, my code base grows and grows, and development just slows to a crawl because by far the hardest part is finding where to write the new code. There's just too much baggage for it to remain fun.
Not so with microcontrollers though -- there, lean and mean is the name of the game, and you get to start over frequently. It's been a blast.

My current project is a home automation board that can sit in a room and perform several tasks, like listening for 433 MHz remotes and translating to WiFi, controlling power to several devices, dimming lights, having inputs for motion and window sensors, things like that.
The main MCU will be an ESP32, but it's going to be too busy to dim lights, so I need to offload the trailing edge dimming control duty to a secondary MCU. I've successfully built the zero crossing detection on a perfboard though, takes unadulterated 220 volts AC on one side and outputs nice little pulses on an optoisolated output other side. So far so good, but what MCU?

I looked at JLCPCB's basic parts list for a suitable microcontroller part. They do carry Atmel parts and a few other manufacturers, but most are extended parts, and all are very expensive for what they are.

..and then I came across the STM8S003F3. 22 cents in quantity 30. I looked up the specs. 8 kilobytes of flash, 1 kilobyte ram.. okay that's not much but I can work with that, and I like a challenge.

So, I ordered development boards and an ST-LINK v2 clone. Blink sketch worked perfectly, and so did a tight loop to count the zero crossings and measure the period with nice long averaging, serial communications, and outputs. But, tight loop polling isn't going to work in the long run, I need interrupts and timers.. and I have not been able to get interrupts to work, and haven't been able to find good examples.

So, I started look for support, and came across this page which directed me here, as well as this line:
"Please note that after registering on that forum, you are required to post an introduction in the new user board first in order to aquire the right to post or reply in any other board. Roger is strict on that."

You know, I must say, I really respect this! That's a fair stance, and it certainly helps build a community -- now that I've read a few introductions and having taken the time to properly introduce myself, I'm certainly more likely to stick around after this project is done.

And there will be more projects. Every new tool learned opens countless new possibilities. I for one can't wait to see what happens next!

User avatar
fpiSTM
Posts: 742
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 27
Location: Le Mans
Contact:

Re: "How hard can it be"

Post by fpiSTM »

Welcome.
Nice presentation. ;)
Sorry for the welcome delay :?

Post Reply

Return to “Let us know a bit about you and your projects”