Recent Blogposts of Electronics

Toy Motor Controller Update: PCB Revision, Menu, Bootloader and Memory Card Support

March 31, 2024, 5:35 a.m. Electronics ilo lawa nasa

It's been more than a year since I've posted any update of this project on this blog. If you know me personally, you should probably have heard that this project has been on-going because I do talk about this project online from time to time. It just happened that I've been too busy to update this blog. Now that I've finally got the time to document the latest progress over these months, as well as the planned future development of this project.

Hardware Revision 3

Photo of Toy Motor Controller Hardware Revision 3

I've revised the hardware. The new hardware update includes:

  • Upgraded microcontroller: STM32G070CBT6. It has more flash and RAM and IOs ports, which allows the end-user to have more space to implement the custom functions
  • Added an external memory card slot
  • Added an extra button
  • New DC-DC regulator. It's a buck-boost converter supporting input voltage range of 1.9V ~ 5.5V
  • Removed built-in pressure sensor
  • Upgraded the 1-pin analog port to a 3-pin GPIO port
    • This GPIO port can support the pressure sensor / analog sensor on an external board
  • Replaced the 3D printed knob cap with an off-the-shelf one. My consumer grade 3D printer simply isn't good enough for printing that

A further revision is pending, which mainly focus on fixing hardware bugs and optimizing the design for small scale production. The pending revision doesn't change the feature set above.

Firmware Development

I've split the firmware into two parts, the bootloader and the app. The bootloader is used for performing firmware upgrade for the app. The app is where pretty much everything happens. The idea is to let the user develop their own custom app to be loaded into this toy motor controller.

The app upgrade file format is a dumb .BIN file. Basically it's just a binary stream to be self-flashed to the app region of the flash. The bootloader would flash as many pages as the size of the .BIN file. The development of the bootloader has just been completed.

The app development is still on-going. The user interface prototype is done with working menu and display. The UART protocol is also working. However, it's currently pretty difficult to develop plugin for this toy motor controller so I need to find a way to make it easier to perform plugin development. I foresee that I'd need to change quite a bit of the codebase for that.

On the app driver side, it's done and tested working except for the external memory card part. However, the existing code that initialize the peripheral is very inefficient (thanks to the auto-generated code of STM32CubeMX). I plan to make it more efficient somehow.

As for external memory card support for the app, I need to implement that. I'm mainly interested in data logging, config import/export and firmware dumping.

Production Plan

I found that it's too much work to manually solder the units for small scale production, especially for SMD soldering, I need to wear the gloves, take out the equipment and material, do the job and perform clean up, which's rather time-consuming. Therefore, I've decided that manual SMD soldering is to be done on only a unit or two for prototyping purpose. After the prototype is verified to work correctly, I'll at least outsource the SMD soldering for small scale production. For the parts with larger pitch, I could still solder that on my own if it isn't economical to outsource in small volume.

In the next revision, I'm gonna put all SMD parts on one side, and parts that can be hand-soldered on the other side.

Roadmap

As this is a hobbyist project, making profit is not and will never be the primary objective, just like other electronic projects that I work on. (To whoever proposing commercializing this project, particularly a certain close internet friend of mine coming from CIS, fuck you! As if I'd want to keep hustling off the clock! :P)

The main objective of this project is for me to learn and to share the tech that might be useful for others. There's no solid release schedule for this project. Tentatively I hope that I can get the first batch out by the end of this year, probably in a scale of <20 units. I'll make another blogpost of this project again when the time comes.

If I can complete this project, the firmware will be released under an FOSS license.


Toy Motor Controller Update: Mechanical Case and New Revision

July 31, 2022, 5:55 a.m. Electronics ilo lawa nasa

So, I've been working on the Toy Motor Controller. Over the past weeks, I have designed the mechanical case, revised the PCB and worked on the firmware. This device is still a work-in-progress.

Mechanical Case

The mechanical case consists of front cover, back cover, a couple of knob caps, a button and a power slider switch. The battery tray is affixed to the back of the top cover using a couple of screws via a couple of screw holes that comes with the tray.

It's the first mechanical case that I've ever designed in my life. I'm glad that it's working. And I'm happy that I can finally put the 3D printer that I've got into good use. :D

Here is some photo showing the mechanical case of the second revision of PCB:

Photos showing the front view, side view and back view of Toy Motor Controller

Second Revision of PCB

I have revised the PCB design. Compared with previous revision, now that it has the following feature:

  • More compact
  • Wider input voltage range. Previous revision: 1.85-5.5V. Current revision: 1.4-5.5V
  • Dual motor output port. Previously it only had one output port.

After spending hours of time, I have assembled a unit of this revision of PCB. I found that it does have minor issues, including a couple of capacitor footprints are having the size that's slightly off, and some silk mark issues. But they aren't anything critical so I can get away without fixing them for now. :P

Here's a photo showing the difference between the previous revision and the current revision:

Photos showing the front view, side view and back view of Toy Motor Controller

Firmware Development Updates

As for the firmware development, the driver code is mostly completed. Now that it's time for me to implement the actual feature on top of the driver code that I've written.

I've also tested the hardware using the driver code. At this stage, there's no evidence of existence of major defect in electronic design.

Production

With the current development status, both the mechanical and electronic design seems to be working fine. I believe that I can go ahead and assemble 4-5 units of this device.

Due to the minimal ordering quantity of the PCB, I've got a few extra PCBs. I'm gonna find a time to purchase the components and solder them onto the extra PCBs.

This time over, I'm gonna purchase solder paste stencils as well. It took me hours to fix issues associated with putting incorrect amount of paste in my previously assembled units. I'd rather to spend an extra few dollars on getting stencils so that I can apply the exact amount of paste needed to avoid running into this problem again.

I don't think that this device would have any good amount of demand. I'll be using this 4-5 units to evaluate the demand and see if I should outsource the assembly or if I should continue to do the assembly on my own. I've done the math. Apparently it's well worth the cost outsourcing the assembly if the demand is >20 units per batch.

That's it!

That's it for the update on this project. I'll update you guys whenever there's any news. See you soon! :)


New Project: Toy Motor Controller

June 5, 2022, 2:33 p.m. Electronics ilo lawa nasa

Hello guys! I haven't been blogging about the projects that I've been working on for quite a while.

Here's new a project that I have been working on for a bit longer than a month. It's a toy motor controller.

Photo of Toy Motor Controller

Application

This Toy Motor Controller is designed to be used for modifying existing motorized toys so that they'd be more fun to play with. For example, the motor of fishing game toy or penguin dash toy can be attached to this toy motor controller so that their motor can run at different motor speed, optionally with randomized movement pattern. It also supports reading external sensors so that the end-user can develop their own firmware to control the motor based on the sensor readings.

Feature

  • Microcontroller: STM32G030F6P6
  • Power input: AAx2 battery or DC Jack w/ power switch
  • Dual encoders with push button
  • A dedicated push button
  • Dual 3-digit seven segment LEDs
  • LED stripe display composed of 15x 0603 LEDs
  • Motor driving port - Can be used for driving any motor that meets the voltage and current requirement
  • External analog sensor port
  • Air pressure sensor
  • Motor current sensor for feedback control
  • UART port mainly for interfacing with computer
  • SWD debug port

Completed Task Items

  • First revision of hardware design
  • Assembly of the first prototype unit, which's mostly working
  • Test firmware for testing the hardware design

Task Items to be Worked on

  • Mechanical case - to be printed using 3D printer
  • Revision of hardware design for fixing the following issues:
    • Removal of known useless hardware feature that I've added to the first revision of PCB just in case
    • Mitigating voltage regulator transient output voltage drop upon the motor starts
    • Perhaps adding an additional motor driving port
  • The actual firmware. Currently we've only got the test firmware working, which isn't good for anything other than testing hardware feature
  • Production and distribution

Expected Production Volume

Based on my previous experience with the demand of my products, the expected demand for this project for its life time would be 10-50 units. I'll try to optimize the design for small volume production, including looking for parts that can be ordered in small volume, designing it in a way that I wouldn't have to spend too much time doing assembly even if I have to do it on my own, etc.

Future of Sadale.net

I kind of feel bad of starting a new project before completing the previous ones. It isn't uncommon for hobbyist projects tho. At least the completion rate of my projects is still higher than most fellow hobbyists.

After this project, I think I'll revamp my website for a little bit to make it less formal and more personal. Then I'll try getting back to my previous projects that I haven't finish (the clock and the portable game console).


Exhibition in Maker Faire Shenzhen 2019 has been a Blast!

Nov. 16, 2019, 4:02 p.m. Electronics Exhibition

Maker Faire Shenzhen 2019 had ended. It was my first exhibition in my life. This blogpost is to document what I've done during the trip for the exhibition.

Days before Nov 8 - Paperwork, Planning and Preparation

Days Before Nov 8 - Preparation of the Event

It took me weeks to prepare for the event. I had to sort out the application, paperwork, etc. In addition, I had to decide which projects to be exhibited, plan for the layout of the props in the exhibition, purchasing props for exhibition, order posters, order my cards, come up a list of the equipment to be brought to the site, plan for when to go and when to leave, etc. etc. etc. I had gotten extremely busy since the day that my application of exhibition had been confirmed. :(

The preparation was a loooot of work. I barely made it on time. The organizer had provided the dimensions of the exhibition table. And here's my test exhibition setup at home with a platform made of two tables that's about the same size as the exhibition table:

Test exhibition setup at home

Days Before Nov 8 - Sightseeing Preparation

I had decided to dedicate a day after the event for sightseeing. However, since I'd be exhibiting alone, touring around alone would be boring.

Luckily there's a WeChat group for oversea exhibitors. I just shouted there like an idiot and ask if anyone's planning to tour around in Shenzhen a day after the event. It turned out that there's a Japanese team interested in accompanying me. Yay! :D

We ended up having a plan for the tour in both the registration day (i.e. the day before the first day of the exhibition) and the day after the end of exhibition.

Nov 8 - Registration and Pre-Event Sightseeing

Nov 8 - Traveling to Shenzhen

I took highspeed train from West Kowloon Station in Hong Kong SAR to Shenzhen North Station. The border control process went smoothly. And I had never traveled using the highspeed rail station in Hong Kong.

When I saw the Vibrant Express train that I was about the board on, I was excited. Despite that it's pretty much identical as other CRH380A trains in functionality, the paintings are different. And it's operated by MTR Corporation (a company in HKSAR) instead of the companies in mainland China. It's like a special snowflake.

The interior of the train didn't disappoint me either. There're TVs showcasing Hong Kong and its tourist destinations. There was only a few people traveling using the train I was in. It took a while until the train got departed tho.

However, the real disappointment started when the train got departed. As soon as the train left the station, it ended up being in a tunnel. And it's staying inside the tunnel for the entire trip. Here's a photo showing the view inside the train with nothing other than darkness outside the windows:

Photo showing the interior of highspeed train with nothing outside windows because it's inside a tunnel

Its traveling speed for the entire trip was less than 200 km/h. This isn't what I was expecting for "highspeed" train. Nevertheless, it only took 20 minutes to went from West Kowloon to Shenzhen North. That's an impressively short traveling time, except that it didn't take the train waiting time into account. Depending on your origin and destination, the highspeed train may, or may not be any faster than using other kind of transit.

Nov 8 - Hotel Check-in and Registration of Exhibition

After having lunch close to the station, I headed to the hotel by taking metro. As I can't speak Mandarin well, it took me a bit trouble to get thru the check-in process. After that, I walked to the exhibition venue and did the registration of exhibition. Here's the entrance of the event's site:

The entrance of the site of the event

I was allowed to perform the setup of the exhibition booth and store the exhibition props into the warehouse. However, I decided not to do that because I'd rather to do the setup right before the exhibition starts. Since I had tested the setup at home, there's no reason that the same setup wouldn't work on the site.

Nov 8 - Sightseeing

As there's a bit time left for the day, I gathered with the previously contacted Japanese team and toured around in Shenzhen with them. We've visited the following places:

  • Near Baishilong station:
    • A dumpling restaurant
    • Baishilong Music Park (which I suggested to go because it's close to the event's venue)
  • Huaqiangbei
    • Accessories stores
    • A cafe

The music park that we visited is just a park with music playing inside the entire park area. The speakers were somehow synchronized. The decoration inside the park wasn't particularly interesting. However, the view outside the park was. Here's an array of buildings outside of the park that each buildings look identical:

Buildings that look identical outside the music park

As for Huaqiangbei, most stores were closed by the time we arrived there because we were a bit late. Fortunately the Japanese team had managed to get what they wanted. And I've got a power adapter, a retractable USB cable and an earphone. They're of good value. :)

I was a bit surprised that most storekeepers there in Huaqiangbei couldn't speak English well. A while ago I've been to a building in Huaqiangbei that most people there could speak decent English. This led me to thought that most storekeepers in Huaqiangbei could speak English well.

After that, we got drink in a cafe. And I parted with the Japanese team, went back to hotel, took a shower and slept.

Nov 9 - First Day of Exhibition

Nov 9 - Exhibition

I went to the Exhibition's site about an hour early so that I could do the setup. The setup went mostly smoothly. The only issue was that I wasn't able to get the power because there's only one power socket shared between me and the booth next to me. This was quickly sorted out by contacting the organizers, which provided me a socket outlet splitter. Here's my exhibition setup:

Real exhibition setup on the site

Some of the visitors spoke English, some spoke Mandarin and a few of them were able to speak Cantonese, which's my mother tongue. It wasn't easy for me to identify which languages the visitors spoke. And I often judged that wrong. For example, many Chinese-looking visitors of my booth are actually Japanese or Korean. And a few Chinese visitors actually spoke Cantonese instead of Mandarin.

As my Mandarin was bad, quite a few of those Mandarin speaking visitors had mistaken me as Japanese. When this happened, I just pointed at the flag of China with the flag of Hong Kong SAR on the poster and explained to them that I'm from Hong Kong, China.

I actually find that it's easier for me to explain my projects in English than in Mandarin. That's probably because English is the main language I use for anything technical. I did have a problem on trying to figure out the correct technical words in Chinese (Mandarin) when I tried to explain the stuffs that I was exhibiting. Oh, of course, it's the easiest for me to explain them in Cantonese mixed with some English technical words. :P

As for the exhibition itself, it seemed to me that the kids loved the poopie game that I was exhibiting. There was a few times that the kids gathering around on the tablet that's having my poopie game running on it:

Kids gathering around my tablet that the poopie game is running on

It's rather exhausting to do the exhibition alone. There's no break. I had to handle all of the visitors alone. I had compressed cracker (military ration) for lunch so that I wouldn't need to leave my booth. I only asked the staffs to take over the booth for going to toilet and fetching drinking water. Other than that I pretty much stayed in the booth during the event. It was a super busy day. :(

Nov 9 - Maker Party

I joined the Maker Party after the first day of the event. It's just a normal party. It had pizza, packaged waffles, lollipop, crackers, beer and water. I wish they had non-alcoholic soft drinks tho. Here's the photo of the entrance to the party:

Photo of entrance to the Maker Party

Since I already had dinner, I took a lollipop and that's all I had during the party. The party was mostly about socializing with other makers. So I chatted with the people inside the party.

This session reminded me of the pitching session of my first global game jam. Fortunately, I'm doing far better on this one because I'm now a less jerky person than I used to be. This party was pretty fun. I got a chance to know more about other fellow makers and learned about what they had developed and what they're making for. :)

Nov 9 - Maker Party - Japanese! A lot of Japanese!

Here's something funny happened during the party. There was a Super Mario cosplay guy in the Maker Faire. He was exhibiting just two booths away from mine. I found him in the party and tried chatting with him, only to find out that he's Japanese and he could only speak bad English and bad Mandarin. We chatted with each others mostly using simple English. With the help of photo and body language, we were still able to communicate. And we managed showed our projects to each others.

Suddenly another Japanese joined in. Thank goodness. He spoke good English albeit heavy accent. I could understand him perfectly. So he acted as a translator between the Mario guy and me. This was cool until another Japanese joined in. Then they started discussing in Japanese and started speaking less English. After that, yet another Japanese joined in and the entire conversation had turned into Japanese-only. I was like, awww. :(

Then we exchanged our cards and I moved on to chat with someone else. At least I had got the twitter of that Mario guy. xD

After the party, I got back to hotel, took a shower and slept a bit late.

Nov 10 - Second Day of Exhibition

Nov 10 - Exhibition

It's pretty much the same as the first day. Except that there're more visitors to my booth. And I hadn't slept enough in the previous night. It was almost too much for me to handle the visitors alone. :( Here's a photo showing an overwhelming amount of visitors:

There're a lot of visitors in second day of exhibition

During the lunch time, I opened up another pack of compressed cracker (military ration), just like the previous day. However, there were too many visitors. It was very tough to handle the visitors while eating the crackers. It took me like 1.5 hours to finish the two crackers inside the pack because I had to stop eating multiple times for explaining my projects to my visitors. At the end of the lunch, my voice turned very bad and my throat was extremely dry. Despite that I drank a lot of water, it didn't help much. :(

The event was going to end in an hour. I was extremely tired and I needed to sleep pretty badly. There was less visitors by that time. But still, it was pretty tough to me.

After the exhibition had ended, I dismantled the booth and headed to the place of taking group photos. Here's how my booth looked like after getting dismantled:

A photo showing my booth dismantled

Nov 10 - End of Exhibition and Taking Rest

After the event, I went to hotel and took a nap immediately. After napping for a few hours, I got out and had dinner. I felt much better after having the dinner. Then I headed back to hotel, took a shower and slept. That's the end of the day.

Nov 11 - Sightseeing and Leaving Shenzhen

Nov 11 - Sightseeing

I had reserved this entire day for touring around in Shenzhen. The trip of this day was planned by the Japanese team that I've contacted. I took my baggage, checked-out from the hotel and gathered with the team. Here're the places that we went to:

  • Near Laojie station:
    • The anime mall "东门动漫城"
    • The food court "庙街美食广场"
  • Near High Tech Park station:
    • A large Xiaomi store
    • A large Huawei store
    • The Cafe "奈雪之茶"
    • The shopping mall "万象天地"
  • Near Baishizhou station:
    • The supermarket "福伴"
    • The bar Peko

For the anime mall, we arrived there too early. Almost all stores weren't opened. We still looked around there anyway. I've purchased an el cheapo tiny Vocaloid figure for RMB20 from an opened store, and I'm extremely disappointed. The coloring of the hair of the figure's far off.

As for the food court, it's a pretty fun one. One of the stall sold grilled insect, which I didn't dare to try. We just randomly grabbed some food there and shared with each others. Most of the food there were spicy and mala (numbing-spicy). :)

After that, we headed to high tech park. Here's a photo of an artpiece showing the bird-eye view of high tech park inside a shopping mall that we visited:

Art of bird-eye view of high tech park

In the Xiaomi store, one of the Japanese team members purchased a new phone right on the site. Other members had purchased something else, like speaker and stuffs. I envy them. All I had got in the store was a fidget toy that costed me RMB10. I'm a poor man. :(

We didn't do much in the Huawei store because it's more expensive than the Xiaomi one.

In the cafe, each of us just grabbed a drink and we tried out the new stuffs that we've just purchased. I assembled the fidget toy. A Japanese team member had tried out the Xiaomi speaker that she had just bought and played some random music. We had fun. :)

In the evening, we went to a bar, had drinks, chicken pieces and taco and we parted.

Nov 11 - Heading Home

Right before getting back to the home, I decided to check the local news in Hong Kong about the traffic. It was pretty scary. Large scale protests were happening in 11th Nov 2019 in Hong Kong, blocking the traffic and stuffs. After discussing with my family, I decided to try returning to my home anyway. If I failed, I'd get back to Huanggang and book a hotel room to stay there.

I went to Huanggang Checkpoint using metro. Then I took a cross-border bus to get back to my home. After alighting from the bus, I took a detour to avoid the police station because it's where the chaos often happen. I passed thru a road with bricks all over on it. Apparently the bricks were used for blocking the traffic and was put there by the protestors. Nevertheless, it's not that dangerous because there's no fighting between groups of people having different political ideology. In the end I managed to get back to home safely.

Goodbye Shenzhen! I'll come back again some days later! :)

Reflection and Moving on

The entire Maker Faire experience was pretty awesome. It was quite fun overall, including the preparation work, exhibition and the post-exhibition sightseeing. I've also made a few new friends there. :)

However, it took me a loooot of work to join the exhibition. Weeks of work had been done solely for the preparation. And the exhibition itself was extremely exhausting. It's far more exhausting than joining Global Game Jam. I'm not sure if that's because the event itself's exhausting, or the event's held outside my home town, or the combination of both. Fortunately I've taken good care of myself and ensure that I've got enough sleep and food. Despite that I've caught cold, it's still nowhere as bad as the cold spell that I've caught in my first Global Game Jam.

After the event, my mana bar has almost gone empty. I pretty much need a break. Since it's exhausting, I'm not sure if I'll be doing another exhibition next year. I guess it'd be easier if I had partner(s) for exhibition. (Oh well! As if I'd be able to get one! I only socialize with online friends that aren't in Hong Kong) Anyway, in the near future, I'll probably be laid-back for a bit and focus on watching anime and playing video games. :)


Exhibition in Maker Faire Shenzhen 2019

Oct. 29, 2019, 2:50 p.m. Electronics Exhibition ilo nanpa

Big news! Sadale'll be exhibiting in Maker Faire Shenzhen 2019 in booth E10. It'll be my first time starting a booth for doing exhibition in my life! :)

ilo nanpa will be the main project to be exhibited. That's because it's the most successful project of Sadale. It's also my only project that had entered "mass" production stage (well, it's actually home-based "mass" production with the quantity of produced units of 40ish). I'll be introducing toki pona numeral, toki pona language and ilo nanpa device to the visitors of my booth during the event.

In addition of that, I'll probably be also showcasing some of my smaller projects, including Arduino 1602 Snake (Gaming Device), Raspberry Pi Single Key Keyboard, the Poopie game and HTML gallery generator during the exhibition.

All visitors'll be welcomed to try out the projects that I'll be exhibiting. :)

Preparation Work - Visiting Maker Faire Hong Kong Last Year

I've planned for doing an exhibition more than a year ago. That's why I had checked out Maker Faire Hong Kong 2018 to see what exactly'd be going on in Maker Faire.

Well, that was pretty much I had expected. There's exhibition and seminars and workshops. Except that the exhibition were meh. Honestly, I was quite disappointed by the exhibition of Maker Faire in Hong Kong last year.

Almost all of the exhibitors were from education institutes. Some of them were schools, while some other of them were cram schools. Despite that there're a few impressive projects among them, almost all of them were lame, dumb, meh and unimpressive. Those projects just involved using very limited technical skill. As for cram schools, they're just joining the faire for marketing their classes for kids.

Another common type of exhibitors were those who make education materials. Developing education material isn't bad per se. However, no one's going to use them for anything professional. No one ever! And what those education material doing is to raise a bunch of half-ass engineers. Same goes for cram schools. And I was hoping that I'd be able to find more exhibitors that's actually technically competent for developing something serious.

I think I'd only found like 5 non-education makers out of like 100 booths. Well, I guess learning solely from classes is a culture of Hong Kong, which's an idea that I don't quite buy into because I've become what I'm now mainly by self-learning using online resources. And the problem with those classes is that it won't take the kids far enough to be able to do everything they want to do. And that's how some, if not all of those education institutes make money. They keep teasing the kids so that they'd apply for more and more classes. :(

Why Shenzhen?

Despite being lame, I still planned to join Maker Faire Hong Kong this year as an exhibitor. Mainly because it'd be the most convenient to me. To my surprise, it's apparent that there'd not be any Maker Faire in Hong Kong this year. I've contacted the organizer earlier this year without any response at all. And their website is still displaying the info of the 2018's event as of the time of writing.

Since there's no Maker Faire in Hong Kong, and I still intend to do exhibition this year, I've decided to exhibit in a Maker Faire that's close to Hong Kong. The Shenzhen one is the closest one. Therefore, I decided to join the one in Shenzhen.

As a bonus, exhibition is free for individual and non-commercial team exhibitors. It's so nice of the organizer to offer booths to us for free! I'd like to thank the organizer and sponsors of the event. :)

Achievements to be Unlocked

By joining this exhibition, I'll be doing these things for the first time in my life ever!

  • It'll be the first exhibition in my life
  • It'll be the first time I take part in an event outside Hong Kong SAR (a part of China) under the name of Sadale
  • It'll be my first time planning for a trip, including arranging the commute, booking for accommodation, food, etc.

I'm so hyped up! Can't wait to join the event! See you in booth E10 of Maker Faire Shenzhen 2019! :D