Saturday, December 19, 2020

Pandemic Pasttime

 Today's song is: Christmas is Coming ... Mariah

At the start of the pandemic Thavorn and I were building Lego cars and I was motorizing them with controllers bought from Hungary. These controllers were a crowd funding project and they work quite well, but by the time they arrive in Canada they are $150!

These controllers, Buwizz and sBrick communcate with the lego car via bluetooth.  Time for some research.

I studied electronics in High School as part of a 5 year science and tech stream that is unfortunately no longer offered. Too bad, it was a great program. My interest in electronics and single board computers and lately, microcontrollers has continued.

The good news is there are lots of inexpensive options for hardware and there are lots of videos and blogs on the net to help you.  Of particular interest is Adafruit a company started by Ada, a grad of MIT. She is really interesting and her company makes quality components backed by great learning docs.

I decided to buy their circuitplay ground that is used by many schools for STEM education. My second choice would have been the the BBC Microbit. The cdn cost was about $35. I added the circuit crickit at about another $35 but it is really not needed but seeing schools were pairing them with the playground to build robots I thought I would look at it.


Here is the crickit with the playground bolted on top.

To show the size, compared to an American quarater.


The cricket can be bought with a BBC micobit slot or an Adafruit feather slot for more experienced builder. But as mentionned before the playground and many other lower cost boards will work as well.

Most electronic cicuits utilize 3.7 to 5 volts DC power, but Lego used 9 volts for their motors and cicuits. You can always run the motors on 5 volts but that is about.6 of their capacity (speed).

So the hunt began for something that could be used to run my leo motors at full (or perhaps more) power. The legacy and populat moule selling for about $6 Canadian is the L298n module.


The big problem with this module is there is a 2 volt loss in the cicuitry so the 9 volts you feed it to power the motors gets cut back to 7 volts so that sucks. The other downside is that heat sink is there for a reason as it gets hot. BTW, according to the law of conservation of energy, that is where your 2 volts disappears to. There has to be a better circuit.  More research!

The solution I found was the Maker drive by Cytron (a Malysian componay) that sells for $5.99 CDN. BTW I buy most of my stuff from https://elmwoodelectronics.ca/ out of Toronto and they are fantastic, with four day shipping. I also buy from Amazon.ca.

The Maker Drive is excellent, smaller, test buttons, led indicator, and best of all, very little voltage drop. Note the absence of a heat sink.




I have always advocated that a day that goes by without learning something new is a wasted day and when playing around with microcontrollers there is always lots of learning.

Here is a pic of my Lego leaning platform. The wiring will be cleaned up in the near future but it is fully functioning. The playground and crickit have much more capability, including many sensors and the ability to play wav or mp3 files.

Crickit


Playground


The Mule



The Lego motors are a L-motor (drive) and a servo motor (steering).

In the near future I will change the electronics substituting one of these for the playground and crickit to make everything smaller. I almost forgot, I program the modules in python, but there are visual ides such at Microsoft MakeCode thay are extremely easy to program with.



Why, as Thavorn is want to say, why not?

TTYL

No comments:

Post a Comment