A time ago, while shopping online for some electronic components, I ordered also what I supposed to be a Lego Power Function IR receiver, without realizing it was not an original component, but just a clone not compatible with my sets.After received the item, I just put in a box until a couple of days ago, when I decided to disassemble it and recycle the shell for my M5stamp
HardwareI connected my M5Stamp to a small H-Bridge made with L298 compatible chip, small enough to fit inside the receiver shell. The bridge is powered from the battery pack at 9V, while a AMS1117-3.3 provide to lower the voltage to 3.3V compatible with the M5stamp.Since I'm not using 5V in any place, I'm not providing this voltage to the board.
The pin selected for output and connected to the IN pins of the chip L298 are:
- G26
- G18
- G19
- G21
I skipped G36 because that ping can work only as Input
After connected everything, I put the board inside the shell. Unfortunately, the LED and the G39 Button are not accessible from the front.
SoftwareAfter installed the latest version of UIFlow (Pico) from M5Burner, I was able to connect to the chip from my preferred web tool.
I Use UIFlow on M5stamp because it's so easy and doesn't require USB adapters after burning initially the chip
Tests
On test one, I just changed the colour of the LED, to verify connectivity to UIFlow.
Second test involve the motors, and just powering them for 1 second to check if everything works as expected, and it did.O third test, I configured 2 PWM, to verify the capabilities of controlling the speed.Now that everything work properly, I have the full flexibility of installing anything via Arduino or UIFlow, I prefer the second one as not requires any USB to serial adapter.
Not sure if I will change something there, maybe I can make available the grove port to use with Units, as most of them are compatible with Lego
Comments
Please log in or sign up to comment.