Adding the necessary to the extremely economical illumination
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
gen.shSensible defaults for the image conversionx-sh - 80.00 bytes - 01/05/2018 at 19:58 |
|
|
convert.pyImage conversion scriptpy - 7.23 kB - 01/05/2018 at 19:56 |
|
|
LightBeam_X_1.zipMPLAB Firmware Project, V1 (Alpha)Zip Archive - 39.83 kB - 01/05/2018 at 19:56 |
|
I previously wrote that a likely candidate for the original microcontroller that this uses is an Elan Microcontrollers EMP series.
Good news, everyone!
You can buy them at LCSC:
https://lcsc.com/product-detail/ELAN_EM78P173NSO14J_C108337.html
They are still one-time programmable, but the datasheets have been translated into English, and they are 17 cents in singles. 11 cents in QTY 100.
It's a 32-bit Cortex M0, and I'm actually considering picking up a few now to do this project properly :)
It's really nice that all boardhouses, ever, send multiple copies of a PCB. If they gave me the option, I would probably usually only order one. That would bite me in the ass, every time.
I like to butcher the first one with cut-up USB cables for power and through-hole LEDs crappily soldered into whatever socket I can access, for initial bring-up and debugging. And a little hot glue, for strength.
Smoke-test and blinky went okay, so I put it all on the real hardware for further development.
Here it is, plugged into my PicKit 3:
Looks awesome! The LEDs are actually slightly too bright to look at while debugging.
I was a little bit worried that all of the LEDs at full brightness might be too much current for the PIC to sink, but it seems to but completely fine. No heating up, and stress-testing is going fine. The code is now adjusted so that each bank of 4 LEDs is on at a time, so technically they're all PWMed at 25%.
I'm releasing the initial PIC code as a file on this project. It's very alpha so there are a few niggling bugs, and it requires some more testing and features, but, if someone wants to get a PCB made and flash it, they totally could.
Current features:
Planned features, supported by the current hardware:
So there's still lots to come, although most of it will be code changes!
The @oshpark PCBs have arrived!
Actually they arrived a couple weeks ago, but holiday bustle has kept me away from fun stuff.
A little bit of reflow, inspection, and touch-up later:
And, to modify the base PCB, a hot air station makes short work of it. Pop up one side of the IC:
And then the other:
Then the new components are ready to be soldered! 0.65mm isn't that small, good flux, a fine tipped iron and some solder wick are all that's needed to nicely place the headers, flash chip, and the R13 pull-up resistor. I think I used 10k or so.
Remember kids: Always clean off your flux before taking the pictures. I didn't do that here, obviously. How embarrassing. This is the reason I don't really like white solder mask.
On top of that whole mess goes the daughterboard.
Yeah, that's super low profile.
Fits nicely, I like it a lot.
I realise that I never posted what the light looks in its unchanged form.
This is because after the first attempt at testing (earlier in the logs), the thing flew way the fuck across my apartment, and I lost all the batteries. Over time, they started showing up again. One of them was under my fridge, with no direct line of sight, so there was probably some ricochet going on!
Anyway, I tested it out again. Forgive the quality, I didn't have time to mess around with the camera settings, and it's not my bike.
Anyway. PCB arrives soon, I hope to program my own sequences!
Changed the outline a bunch, printed off sheets of paper to mock them up, and then finalised the design.
The available area was much smaller than I originally assumed. It doesn't really have room for the PIC18F14K50 that I was planning on using. That's okay! I have a pile of them, but there are better suited PIC families that are cheap, too.
Although these are much more attractive in @oshpark purple, obviously.
So they're ordered, because I laser cut them out and fit-tested them, and I think they'll work great. They cost $3.95 for three. Ordered in 0.8mm FR4, because I need all the height I can get.
When I bought these bike lights in August, there was only one or two vendors selling them, and they were all the same item.
I've added that first AliExpress link to the components section.
True to AliExpress form, this product has propagated through a bunch of different stores, with minor permutations. It's awesome! Three months later, there's a ton of variation.
So for less than $10, and in some cases less than $4, you can get a whole mess of different paper cover styles, different mounting styles, and probably different LED colours.
Any combination of the word "32 LED Bike Spoke Light" or similar will yield results.
I would suspect that the PCB is identical, but I'd love to get some confirmation! I'd also love to get other people playing along at home - This product is neat and well worth the pocket change, even without a customisable add-on board.
The different mounting styles are the most surprising part of this. That seems like a lot of engineering talent to develop these mounting brackets for what otherwise seems to be a copied style. Here is a selection:
So I'm extra curious to see what the PCB differences are, if any.
Gotta redo it, though.
Had some out-of-civilisation time this weekend to chill and work on boards without distractions.
J2 will be a 1.27mm pitch SMD male header, soldered onto the original microcontroller's empty footprint. Thanks to @christoph and @zakqwy for sanity checking my footprint and stopping me from doing something dumb like special ordering 0.65mm pitch headers.
This is my third board in Upverter, and I'm actually pretty impressed!
It also saves history states in a fun way.
So I laser cut the outline to make sure it will work with my requirements.
It definitely won't. It extends way too far in both directions. I'll redesign the PCB to extend down, just to the left of the LED line.
Fortunately, I think I'll be able to manage shoving it into the case when I have the planar dimensions correct.
I'm still intending to put a scope up to the communication pins on the black box microcontroller at some point, but I don't expect to see anything, or if I do, be able to have any sort of effect on the system.
So the clear solution is to pull the microcontroller off, and then solder some headers in its place. Like how SMD JTAG headers are done.
With a daughterboard that connects to those headers, the world is my oyster in regards to hacking projects. The most obvious first step is to add a Hall Effect sensor, so I can detect wheel rotation.
Other than that, I was able to almost wholesale copy the schematic from #PIC-On-The-Go, which means I also have all of the components on hand. It really was the perfect pinout. I have enough space to do everything I want, and nothing more.
Let's take a closer look at the electronics.
It's extremely difficult to photograph the traces underneath white solder mask, but behold, my best attempt:
From here, and then with a quick assist from my handy multimeter, I have drawn a schematic!
There were a few funny things with this circuit.
The whole bottom-left section, and the connector are unpopulated - Cost reductions on display. U2 is likely an I2C flash chip, all connected to a 4-pin connector and some power switchover circuitry. AT24C02 fits the pinout of the chip, but any flash chip is identical, pretty much.
Not shown are the duplicate LEDs. Matching LEDs on each side are in parallel. On one side, they count from 0-15, and then on the other from 16-30 (there are two D17s, and no D31).
The LED is array is set up in an interesting configuration where each high-side control can select a bank of four LEDs, while the low-side controls which LED in the bank is on.
R11 is a light-dependent resistor, and along with S1 (the vibration switch), this the microcontroller is woken up only when it is dark out, and the device is moving.
Concentrating on the microcontroller, the unusual power and ground pin locations ruled out all of the listings on Digikey.
The first one I found that fits the bill is the EM78P153B. It's manufactured by Elan Microelectronics Corp, and looks like it's seldom seen outside China. Interesting. Most of their consumer line is one-time-programmable or masked memory, so it's unlikely I'll be able to rewrite it.
Side note: someone should start a database of microcontrollers and where special function pins are, to make identification of unmarked ICs easier.
Well first you attach it to your bike.
Then you spin up the wheel.
https://drive.google.com/file/d/0B3_kCL0lNAM9ZjMwUVJWZzRwRXc/view?usp=sharing
And then it fails catastrophically. The light bar is fine, but I only managed to recover one of the three batteries.
Hilarious.
Note: I don't have the patience to turn this into a GIF right now in any quality way. Taking suggestions or help, otherwise this link might disappear in the future!
Create an account to leave a comment. Already have an account? Log In.
To add to what I previously posted, these are the links for the factory software that comes with the programmable light:
32 Bit:
http://en.leadbike.cn/res/soft/2016/a25dcfdd1c8dd448.zip
64 Bit:
http://en.leadbike.cn/res/soft/2016/d9d105551e0cb288.zip
Windows XP:
http://en.leadbike.cn/res/soft/2016/f1561e6072405c18.zip
It may not be compatible now that you've replaced the MCU, but if it is, or if you can modify your code to work with it, then it will give you a nice GUI based interface for flashing the patterns to the device. It supports bi-directional flashing so you can download the existing patterns from the device as well as uploading new patterns.
The software has three design modes;
1. Individual Pixel Editing
2. Text / ASCII Input
3. JPEG Import
The light itself usually has storage enough for 32 patterns but the software does not seem to stop you from creating longer sequences so I suspect that replacing the AT24C64D with an AT24C256C may well increase its capacity to 128 patterns. I have yet to try this as my main focus has been trying to find a way to replace the MCU.
As I previously said, the flashing cable has a small 8-pin IC in the USB plug. I can't tell you what the chip is, because like the chips in the light itself, they have removed all trace of any device numbers on the chips. I managed to ID the EEPROM using a USB microscope, which at first saw nothing but then I reversed the image colours to create a negative type image and the number was faintly visible. Unfortunately this method has been unsuccessful with any of the other ICs. I guess I was just lucky to find one where they hadn't fully erased the number. All I can tell you about the cable is that windows detects it initially as an HID compatible mouse and then installs it as a USB input device. The hardware ID is: USB\VID_1D57&PID_AC01 which denotes a Xenta Wireless Receiver (Keyboard & Mouse), so I think it's a simple USB to I2C UART chip, but I'm assuming that the vendor and device IDs are important as the software must use those to tell it apart from any other devices that identify as a USB input device.
I noticed in your photos that the MCU you removed has a number on the underside. What does that say? It's not clear in the picture other than the fact I can see it starts with I2C.
Sorry, I missed this. Great information! We seem to have found a lot of parallel information :)
Yes, I'd say a chip inside your USB port is almost certainly an I2C bridge.
My microcontroller replacement is definitely the way to go, with the factory OTP ones being pretty useless.
Just checked my high res pictures, and the lettering is pretty faded. It's probably a date code and useless to you, but the best I can make out it:
12C ZET 1701
or maybe
I2C ZEU 701
Hi again!
You're probably right that replacing the MCU is the best way to go but I'm assuming that it would then no longer be compatible with the shipped software and I'd still like the end user to have the option to load their own patterns without me having to learn how to program my own app to do that. I'm actually trying to make a completely different POV product and this will cut a few corners if I can make it do what I want.
I've broken the device down to its constituent parts and soldered them to DIP converter boards to I can play around with it all on a breadboard and see what I can do with it. I've tried a couple of different eeproms (smaller than the one it came with) but they cause a crash in the software when you try to transfer, even if you only load it with one pattern.
My biggest issue with the thing at the moment is the brightness of the LEDs, or lack thereof! It's an even bigger issue now as I've converted the thing to run on a 3.7v Li-Po battery I've tried fitting brighter LEDs (10,000mcd) but it's still not much better, even with the 47 ohm resistors shorted out! As you already mentioned, they appear to be PWM'd to 25% and since the MCU is OTP I think the only way around that is to use a low pass filter so that's my next experiment!
I'd really like to ID that I2C bridge chip because then I only need buy the non-programmable lights and I could convert them myself. I don't know a lot about I2C or microcontrollers and I'm assuming that the software looks for something specific about that chip, otherwise it would just try to reprogram any usb mouse hooked up to the system! I'ts an 8 pin SOIC with a 10k pullup resistor on the SDA pin but that's as much as I know. Do you know if there's anything I can download anywhere that might help me id it?
I too have spent the last few months trying to reverse engineer this light, but for different reasons. I want to use it in a different housing rather than on a bike and unfortunately the original PCB is about half an inch too long for my uses so I've had to design a new pcb from scratch which I'm currently waiting on delivery. I've also added a lithium polymer battery charging circuit to the board rather than mess about with disposables. You obviously understand more than I do about microcontrollers - I'm only just staring to learn about them now, and identifying that mcu chip is currently my biggest obstacle. I'm going to need quite a few of these things and I'd rather just buy the components fresh, than waiting weeks for the things to arrive from China and then sitting for hours taking everything off their board! If I could just buy that chip all my problems would be solved! I have come to the same conclusion as you since the elan chip is literally the only one I can find with that pinout, and since it's OTP I think I'm stuck with having to buy the whole thing. I can however help you identify the "missing" components because I have also managed to get the programmable version of the device! The EEPROM U2 is an Atmel AT24C64D, you also need to fit Q8 (S9014 J6) which pulls down pin 7 of the MCU to put it in programming mode and the three missing resistors are: R13 - 1.5K, R14 - 4.7K and R15 - 100K. The connector is a type I've never seen before - the light is supplied with what looks like an almost standard USB cable until you pull the "A" plug cover off and discover there's a pcb inside with a tiny 8-pin IC lurking within. It's interesting to note that although the LED colours are fixed, the software supplied with it has a colour palette you can select from, suggesting that there may even be a full RGB version out there, or planned for the future!
hmm, you could add an ESP8266 and display every wi-fi ssid in range :D
Become a member to follow this project and never miss any updates
@davedarko Lol.
I've got the Leadbike A07 for my son: htoutp://en.leadbike.cn/index.php?id=2022
It's funny how these manufactures keep the source code closed, although the use a lot of "inspiration" from others. I would like to reverse engineer the USB protocol so I can write a software for Mac. Any idea what's inside (EPROM or MCU ?). Perhaps buying something with a programmable controller (eg. YQ8003) is a faster way forward? https://github.com/nomeata/bSpokeLight
PS. I'm late to the party, but hey things seem to live for ever.