Unfortunately, it’s only halfway useable because of chintzy interface design and a wobbly mount. So I spent an afternoon, took the microscope apart, and got it under microcontroller control, complete with WiFi and a scripting language. Much better! Now I can make microscope time-lapses, but much more importantly I can take blur-free photos without touching the wiggly rig. It was a fun hack, so I thought I’d share. Read on!
The scope, as it arrives, is really fun. The image is just fine and most everything works as advertised. Looking at bugs and flowers was good for a few hours at least. However, all of the small details that make for a pleasant user experience are botched.
For instance, the clearance on the SD card is so tight that you can’t insert or remove it without something thin to press it in, or having very long fingernails. Some of the buttons are hard to reach behind the big focus knob. The menu system, to turn on or off the LED ring light for instance, is horrendous. These are minor quibbles, and for the price I’m totally willing to overlook them.
But the killer, for my purposes, is that the stand is so wobbly that the act of pressing the “OK” button to take a picture blurs whatever image was there. The video mode has a “motion detection” method — it’s always on because the camera wobbles so much that it always thinks the object has just moved. The culprit is the cheesy frame that ends in a thick silicone suction cup that wiggles around like a bowl of jelly. This is not how you design tripods.
There are two possible fixes for the vibration issue. The first is to build a better frame, and that’s something I’ll probably end up doing eventually, because the inspection scope is a useful piece of gear. The other solution is simply to trigger the exposure (and other) buttons without touching the wiggly little beast. Welcome to the Internet of Microscopes!
Opening up the case, the first thing I found was a row of five test points on the key panel, so I soldered some header wires to them to see what’s up. (That was easy!) They’re labelled GND, VCC, KEY, PWR, and VBAT, which doesn’t leave much to the imagination. Four out of the five are labelled correctly.
I’m an analog hacker at heart, and I usually start off with an oscilloscope when poking around unknown signals, but I decided to start off with a logic probe this time, because surely the single KEY line was encoding the five front-panel buttons in some sort of digital code. Imagine my surprise when each button press looked identical on the logic sniffer. Burned again. Back to the trusty oscilloscope.
It turns out that the five buttons are tied to five different resistors that serve as the lower half of a voltage divider, and an ADC reads this voltage out to figure out which key was pressed. That explains the five voltage levels on the yellow scope trace.
This is a classic dirty trick and I’ve been waiting for the day when I absolutely had to minimize the number of wires connected to a panel. Who knew that I’d see something hackish like this in an actual product?
The power button is separate and pulls the PWR line (in green on the scope trace, on a 5 V vertical scale) to the VBAT line. A quick test with a 3.3 V power supply convinced me that I could turn the device on and off with a microcontroller’s GPIO. I was also pretty sure that I could connect up five GPIO pins to different resistors and “press” the corresponding button. So I pulled off the panel to measure the individual resistors.
In case you want to replicate this at home, the resistors are 0 Ω, 15 kΩ, 30 kΩ, 46.6 kΩ, and 70 kΩ respectively, and doing a little math on the measured voltages, the pullup resistor on the top of the voltage divider is probably nominally 100 kΩ. Alternatively, if you have a DAC you could just send voltages of 0 V, 400 mV, 750 mV, 975 mV, or 1325 mV to the KEY pin. I soldered up the closest resistors I had in my box, verified that they all worked and called the hardware done.
But what’s up with the VCC line? Something didn’t make sense, because the buttons pulled the voltage down despite being connected to VCC, and the KEY line was pulled high by default. Testing it out, of course VCC was a dead-short to GND and the pull-up resistor was on the KEY line. There was an unpopulated resistor on the keypad panel PCB as well, suggesting that in a previous revision the buttons pulled up, but the manufacturer optimized away a single resistor by using the microcontroller’s internal pullup. It’s either laziness or deliberate sabotage that they didn’t change the test-point silkscreen to match. (Imagine how much fun it would be to connect your test equipment up to “VCC” and GND!)
The rest of the work was just me using my favorite tools for a quick job like this. You might want to use an Arduino or a single ESP8266, but I’ve been playing around with Mecrisp-Stellaris Forth on cheap STM32F103 boards lately, so that’s where I went. I was originally thinking of making a custom remote key panel, so the many GPIO pins would have meant that I wouldn’t have to resort to the ADC-and-resistors trick.
I was already using UART serial for programming and debugging, and decided that a separate key panel was a project in its own, so I cheesed out and put the microscope on the WiFi network. I flashed an ESP8266 with the esp-link WiFi-serial bridge firmware. Voila, remote control. Powering the microcontrollers off of the microscope’s VBAT line (through a switch) makes the whole thing entirely self-contained when I have to move it around the desk.
There were many details that required trial-and-error testing to get right. Different delays are required for button presses in camera mode and in the menu system, for instance. I didn’t optimize these, but made the delay long enough that it always works. The power on and off button only works if held down for longer than 1.5 seconds. It’s quirky. This was all pretty quick to get working with an interactive debugging system like the Forth environment, although I don’t think it would be all that much worse in a compile-and-flash loop like in C or Arduino either.
There are two cute things that I did in the firmware that are worth mentioning. The KEY line that’s used to detect button presses is only pulled up when the microscope’s power is on, so it can be read by the microcontroller to figure out if the microscope is currently on or off. When the microscope first turns on, it is in video mode, which allows the software to keep track internally of the mode it’s currently in.
Combined, this allows for a single “shoot” command that first verifies that the microscope is on, then switches into camera mode if it’s not already there, and then finally takes a photo. Similarly a “delete” command switches over to preview mode and deletes the last photo, confirming all of the “are you sure?” dialogs automatically. The code is here if you’re interested.
The out-of-the-box menu system is horrible. It requires something like fifteen keypresses to toggle the ring light on or off. Scripting this in the microcontroller makes it a lot more pleasant. Moreover, it’s now possible to set up repetitive exposures to make time-lapses, or film a two-minute video once every ten minutes, or automate essentially anything. I might add a distance sensor to make filming automatic when a PCB is present under the lens, or something silly. I really like the idea of tying these script functionalities to external buttons: a one-press light toggle or bracketed exposure button would be nice, as would a single-button delete.
The world is now my oyster, so expect to see a lot more super-closeup footage in upcoming Hackaday articles. And if you pick up one of these microscopes, don’t hesitate to open it up, solder a handful of resistors in, and take control of it yourself. You’ll probably find it useful enough that you’ll build it a proper stand, but that’s another story.
Wasn’t sure why you’d want a time-lapse function on the camera until I watched the video – great choice of music (not so sure about the soldering).
Brian likes to call that “superliminal advertising”. I actually have a Jolly Wrencher under glass on my bench, and caught the corner of it by accident when setting up the video. Then I thought, why not roll with it? :)
The soldering was janky. It wasn’t small enough to warrant changing out my largest iron tip, and without solder mask on the PCB, that stuff sticks everywhere. Maybe SOT-23 was a bit of a stretch for that tip. Plus, I was doing it in mid-air to get the focus right. I need a better rig for the microscope now.
I thought your soldering looked fine. I’ve been looking at these microscopes on amazon. Looks like I’ll have to pick one up. The Chinese stuff is usually the most hackable when it’s as cheap as possible. I might try to get something that’s a little more user-friendly out of the box, though. The less I have to hack [i]on[/i] the microscope, the more time I have to hack other things [i]under[/i] the microscope. Thanks for the nice write up.
minor point, but when posting to an English language blog, it’s probably best to post an English link to the products mentioned
I would expect better if I were subscribing to a magazine. But.. I lived through those days. Live information from the internet is soooo much better than any monthly rag could hope to provide. But… you have to look past the warts.
Re-reading that sounds kind of anglo-centric. By ‘warts’ really only meant the mixing of languages (since a person who reads one might not read the other), not any specific language.
Thanks! I didn’t notice. It’s hard to get an English-language link sometimes if you live outside of the obvious EN countries. I’ll go replace it in the article.
I have a Panavice clone with a suction cup base. I bought it when I was in college because at that point in my life I lived in an apartment, moved every year or two and had no place to permanently mount a workbench let alone a bench to mount a vice to.
Anyway.. this was not a cheap clone, it is a very sturdily built tool that I bought in a brick and motor store years before we had cheap Chinese shops pedaling their goods on the internet. It isn’t exactly a suction cup either, it has a rubber base with a lever that causes the center of the base to collapse upwards to create the suction. Anyway.. even on the best surfaces (not what one generally uses for soldering) it only holds if I wet it and then it only holds strong for a short time before the water dries out.
One tool is not a trend of course but over the years I have also bought several car accessories which claim to mount to a dashboard or windshield via suction cup. Some were cheap, some were not. None have been acceptably reliable and yes, I’ve tried them in several cars. I would love for such a thing to work as I hate scarring a dashboard with drill holes, glue or even double sticky pads which after years in a hot car will probably never completely release from the plastic, not without something abrasive or caustic enough to take the coloring with it.
Tool? Nope. We have a suction-cup hook in the kitchen that keeps dropping our metal colander in the middle of the night. Sounds like people breaking in. When they actually do, we won’t think twice.
The suction cup that came with GoPros is good. I’ve driven hundreds of miles with one on the hood of a car.
I attached the suction cup base to the scope, and immediately took it off and went looking for something better. So far the dial test indicator stand works the best. I removed the thumb screw from the dial indicator clamp and it turned out it was the same thread as the screw on the scope. https://www.amazon.com/Magnetic-Adjustable-Indicator-Holder-Digital/dp/B00L5T2ZA8/
Thanks for sharing you experience about the G600. Apart from the fun of playing with STM32, is there any specific reason why you did not hookup all the stuff directly to he Wemos ?
Not really. Five GPIOs that can source an arbitrary amount of current? But it looks like the keys are pulled up with a 100k resistor, so that’s well within the ESP8266’s (limited) current-handling capacity.
I would bet that an ESP module could handle it alone. If you build one, send us an email to email@example.com. It’ll be cuter and smaller than mine!
How is the latency on this setup? Is this thing fast enough for using it to solder in real time while zoomed in?
I’ve played with a few cheap USB microscopes in the past and they generally had too little working room were so laggy that it gave me a migraine trying to solder with it. If those two things aren’t issues here, this is a truly intriguing hack that I may need to copy!
I don’t notice any lag. It’s straight from the camera to the LCD — no USB or WiFi in the middle. But now that I’m wiggling stuff around on my desk, you’ve made me unsure. It’s certainly reasonably fast, but I don’t know if it’s “instantaneous”. I can’t think of a good measurement rig either…. Maybe and LED strobe and LDR taped to the screen? The lag hasn’t bothered me — yet.
With these simple gadgets, the magnification depends entirely on the distance to the target, and vice-versa. If you’re going for the claimed “600x” magnification, you’re going to be something like 2 cm from whatever you’re inspecting — not very comfy for soldering. If you’re going for 4x-10x, you get a better working distance, but the little ring light might not cut it anymore.
There’s definitely an ergonomic issue with having the screen tied to the lens — better would be a remote monitor, but then you’d need a VGA/HDMI/whatever out. (They must make a version like that?)
I noticed that some versions of the product have a better stand, for 2X the price. I’m going to cobble a stand together, but I’m starting to think the $40 stand would have been money well spent. YMMV.
A lot of those inspection microscopes work as USB cameras, so yo get remote monitor you just need a computer (for most there is no need for drivers in Win10). As such it can be used in timelapses, as the computer decides what and when to save.
It sounds like it actually passes the migraine latency test so it’s probably good enough. I wonder how involved of a project it would be to convert the LCD signals to LVDS, extend them on some twisted pair cable, and convert back to parallel or SPI? This would potentially allow the LCD to be mounted in a more convenient location, instead of stuck where it is.
Thanks for pointing this little microscope out! It looks like I need to buy one of these and try it out.
You can buy the stand separately for $18 from Banggood:https://www.banggood.com/Aluminium-Alloy-Stand-Bracket-Holder-for-G600-Digital-Microscope-p-1194155.html
I get similar magnification on a Nikon D5300 with some random $20 lens and some extension tubes. I use a 13 inch full HD laptop screen with an HDMI adapter for live output. The latency is not perfect but acceptable. You can see the results on my channel.
Are webcams / digital microscopes really useful for soldering? I wonder because you don’t have a stereo view like with an optical dual microscope (not sure about the name) and so you can’t really see/estimate distances etc. Good optical dual microscopes are sadly not avaible for $40…
Are they good for soldering? Depends. I’ve been using a loupe for the past (fifteen?) years, and so I’m used to no stereo vision, and to burning my eyebrows. I still like the loupe.
It’s sold as an inspection microscope, and that’s probably about right. But the loupe doesn’t take photos or videos, which is what I really needed — I mostly need this for documentation. And for this very article, I needed an excuse to shoot a time-lapse video. :)
I wouldn’t be too surprised if the processor inside this thing has some video output but it’s disabled in software. I suppose U9 is some form of memory (can’t read whats written on) containing the firmware so dumping would be easy, but without any documentation no chances to analyze/hack… (I did not search for this processor but from my experience no chances to get documentation for AppoTech chips, see comment below.)
If you enter 640×480 as the video size in the VLC capture device window then it is a lot happier about it. I’ve tried other various standard resolutions but it only seems to want to do 160×120 or 640×480. Not sure how to convince it to stream the full resolution of the camera.
I have an old CRT TV with ‘analog’ front panel buttons like that, which I use for my various old machines and consoles. Its remote died a long time ago, and the front panel is driving me nuts sometimes – when you try to press one button, it randomly “pushes” an adjancent one instead! So when I try to lower the volume, I end up switching inputs all over the place, and when I try to do that, I end up opening up the setup menu, which stops any further switching unless you go through all of its 6-7 pages :( I tried to remove the keypad board and cleaning it, putting small ceramic caps on the output signal, and both (esp. cleaning, first time I opened it I couldn’t see traces through the dusty gray crust) helped for quite a while, but it always comes back. I wonder if the unshielded crappy long wire, that is coming from the keypad to the mainboard across the entire CRT might have to something with it…
I use a system from Plugable found on amazon. It plugs into the USB Port on a computer and they have software that you can download. Not a bad system for $15 USD
Nice article, this thing might be useful one day, especially after the improvements you shared. Thank you!
Btw, in case anybody wonders, the main IC you can see on the picture is from a company called “AppoTech”. http://www.appotech.com/dp/ Don’t expect to find any datasheet however, i searched for a long time a few months ago for one of their ICs located inside a cheap “action cam”…
I have macro-focused video cameras to to do this. Unscrew the lens part way or otherwise move it out a little more than 1mm. Zoom in and modify to macro and end up with a nice distance to work under. I am very near-sighted so I don’t need any mag till it’s10x. One easy to way to figure out how much delay there is is to aim the camera at the monitor if possible. With several frames of feedback you will see delay more or less.
Looking at the search results from the link in the article, there seems to actually be a model with an aluminum base instead of the suction cub for only 10 dollar more.
An even better deal here. https://www.aliexpress.com/item/600X-USB-electronic-microscope-lcd-digital-video-microscope-camera-4-3-inch-HD-OLED-Endoscope-magnifying/32815449530.html?spm=2114.01010208.3.88.yk4zCX&ws_ab_test=searchweb0_0,searchweb201602_5_10152_10065_10151_10130_10068_5210018_10136_10137_10060_10155_10062_437_10154_10056_10055_10054_10059_303_100031_10099_5220019_5290018_10103_10102_10096_5320019_10052_10053_10107_10050_10142_10051_5270019_5260018_5280011_10084_10083_10080_10082_10081_10178_5240019_10110_519_5230019_10111_10112_10113_10114_10182_5250019_10078_10079_10073_10123_10189_142,searchweb201603_1,ppcSwitch_5&btsid=7e3bdf2b-5ddb-4263-b7f6-2d38e60ec073&algo_expid=9e369aec-6f7c-4a12-b05c-7e989ec3aee9-12&algo_pvid=9e369aec-6f7c-4a12-b05c-7e989ec3aee9
My Westinghouse dishwasher uses this technique on the cycle selector knob, I think it’s more common that we know.
Upvote on the music. There is only one visual for me though: Benny Hill on a ladder “cleaning windows” lol.
I recently bought an Adonstar ADSM201 off Ali and I can say its a great bang for your buck scope at $199. Its direct to HDMI (I connect to a PC monitor) = virtually no latency. Its based on a dashcam as far as I can tell so you get video recording, photos etc. The GUI could be better, but I’m really glad I got it. Makes SMD inspection a breeze.
I hacked the firmware on one of these so that it would no longer draw those annoying/ugly images on top of the live view.
Step 1 – Desolder, dump and resolder SPI flash chip. Step 2 – Analyze SPI flash dump (identify instruction set, disassemble code, find/decode bitmap data, etc.). Step 3 – Replace function calls that draw the video/resolution/sdcard images by NOPs and replace battery images bitmaps with nicer ones. Step 4 – Use firmware built-in upgrade feature to upgrade firmware from 1.3.0 original to 1.3.0 hacked via microSD card.
I have written my own software to dump/restore the G600 microscope firmware via USB. So far I have collected 5 different V1.3.0 firmware dumps. If you would like a copy of my software and my firmware collection (including the hacked one), then send me an e-mail to hackaday at outlook dot be.
Has anyone figured out how to capture images over the USB connection at a higher resolution than the 640×480 video? I can capture up to 2560×1440 images (5MP) by using the microsd card instead of USB.
What can I say, .. me too. I would like to know. I looked into this device, and usb device description might be wrong. Does anyone have firmware update?
Anyone recognizes which microcontroller they use? The print seems to be some kind of serial number, mine has 19030 BDGT584-81202. To the right there seems to be some kind of EEPROM and a voltage regulator. Many pads are not populated, especially there seems to be some kind of microphone and speaker missing. Womder if an alternative firmware could be flashed to this device.
4.3 Inch Portable Digital Microscope Repairing Pcb
By using our website and services, you expressly agree to the placement of our performance, functionality and advertising cookies. Learn more
Biological Microscope, Stereo Microscope, Digital Microscope - Tianyu,https://www.yujieoptical.com/