Sunday, May 25, 2025

Making Minimal Mechanical Digital Clock


Making Minimal Mechanical Digital Clock

  • New devices are so much fun to build or use. Lately been motivated by interesting designs from around the Internet and building time counting/displaying devices are an obsession, as they are more useful than just showing some irrelevant counter, been building quite a few clocks.
  • ThingSurfing led me again to Thingiverse and I came across this Minimal Mechanical Digital Clock
  • Seems like the maker Shiura is also obsessed with making various "time machines" (clocks). But there is an interesting mechanical and digital interface to all these devices, which is unique and provides a new angle to time.
  • It was 3D printed and mechanically well designed enough not to need any changes. Used the standard code provided. Though this code runs on a network connected microcontroller, was able to get this working on an Arduino with manual setting of time. The ESP was not able to drive the motor well. Maybe an issue with the power supply. Need to check this later.
  • Attaching the video of the operation of this clock.
  • This is still very much a work-in-progress. As the other sensors to sense origin, etc have not been interfaced, manual intervention is needed frequently. When there's more time maybe will settle the other things.







Friday, May 16, 2025

Scan2Cloud: Automated scanning and transfer of documents to the Cloud


 Scan2Cloud

  • There was a need to send good quality prints/scans of documents to a cloud location without much user interaction. Applicable use-cases would be say: send prescriptions, bills, invoice from the front desk etc.
  • It has to be simple and should be easily operable by laymen.
  • There are many such scanners which provide a similar funtionality but they are limited in their function. Many of these scanners are reasonably expensive, upwards of 15K INR.
  • Also a drawback with handheld devices is that there is possibility of a camera shake, lighting, document alignment etc and hence the picture might not be properly taken. A flatbed scanner does not have any of these issues.
  • So to provide a remote scan trigger and also a simplified user scan function, a device was created as shown in the picture above.
  • Some bit of testing was required to find a suitable scanner for this SBC.
  • Also given that there was some experience in builiding an RPi with an enclosure that had buttons and RGB LEDs, it was chosen to implement this device. Blog entry for Customised RPI case with RGB LED, 16x2 LCD and capacitive buttons.
  • Automated tools to sense various states of the scanner and upload them via HTTP to a Django server were implemented.
  • Sucess/Failure case event alerting was provided by means of the LCD and the coloured LED. The coloured LED is interesting in the sense that if any person unfamiliar with computer usage would still be able to figure out the success or failure status of the document upload. Its a simple interaction, just insert the document in the scanner and press a button on the web app and a high quality document goes seamlessly to a cloud location.
  • As can be seen from the video, the RPI keeps "pinging" the server for scan commands and when a user on a web app initiates a remote scan, it senses it and accordingly scans and uploads the document with varying LED color indications and LCD Messages. It scans and uploads the document in roughly 20 secs.



Sunday, March 16, 2025

Custom Raspberry Pi 4 case with Display, Touch and RGB LED









  •  I have been using Raspberry Pis for a long time now. Used many of the commercially available cases. RPis can be run headless (without a display) or an HDMI/SPI display can be used.
  • There are many cases that are available for the 5" displays, etc.
  • But it would definitely be nice to have small display with maybe an LED and touch support. Say like the commonly available 16x2 char displays and a WS2812B led and a button.
  • This led me to search for a similar thing on the Internet and finally to a ThingSurf.
  • Found this: Design on Printables webiste for a Raspberry PI 4  with displayThe Design is by user guytas on printables and already had all the things I needed.
  • This was locally printed on a Creality Ender.
  • The 16x2 display fit nicely. But as there was a need for an RGB did some "jugaad" and fitted an RGB Led below the button hole and a couple of capacitive sense buttons below the casing.
  • Wrote a small program to showcase all of the features.
  • The program shows the temperature of the Pi with yellow blinking and on button press moves over to blue and date and with another press to green with time.
  • It can be used for any kind of visual aid by means of the Display or the LED.
  • Need to check how it performs on long term use.





Tuesday, February 11, 2025

Making PlotClock



Building the PlotClock by Joo from ThingiVerse 
with English Character support


  • Plotters are fun things. One can move in a 2D space and do very interesting things. Been fascinated by plotters from a long time. Notable mentions like the Drawbot, AxiDraw, EggBot, etc.
  • Always wanted to build a small inexpensive one which did not require too many components or a lot of domain knowledge.
  • One of my favourite past-times is to ThingSurf ie check which open source designs are available and try to make them, either on Thingiverse or Printables, etc. Its a lot of fun and because these provide designs for real-world things,  one can study and learn from them and also extend them to do other things.
  • There is also a requirement of a device that will be a low-power notice board, like a limited power device that will just consume power for a short time, do some useful work, maybe display a message and go back to sleep. Things written on a sheet of paper remain visible for a long time. So it would be nice to have a device that can write. And as a plotter can do this it is a suitable thing.
  • Also, I do not remember the day of the week as most days go off in a blur. So a device that does time and day/date is much needed.
  • So on one of these ThingSurfs I found A link to an interesting clock design on Thingiverse by Joo
  • It is an amazing design that uses just three off-the-shelf SG90 servos and also provides a mechanical base for housing the motors. 2 motors for moving in a XY plane and 1 for the pen up and down. The code is also open source.


  • The above picture shows what PlotClock sample output looks like.
  • The PlotClock software sets the time and writes the 24 hour time on the board.
  • It only has support for numbers and there is code to write the numbers, erase the board using a Dry erase marker with a sweeper that has an eraser base.



  • The 3D files were printed on a Creality Ender printer by a 3D Printing service provider and above is the intermediate assembly stage.
  • Some of the issues were how to connect the servo motors to arms. The holes on the arms and frame had to be enlarged to fit the M3 screws. And earlier I had used 10 mm screws but the screws used to keep falling off so reversed the bots and nuts and used 20mm ones. The servo horns were glued to the base of the arms and to the lift servo, standard servo screw was connected to the horn.
  • The calibration program has to be run so that the servo arms move in an expected pattern.
  • Above is another intermediate phase with the arms
  • Everything has to be just right, the arms have to horizontal, the pen up and down mechanism has to be straight, the sweeper position has to be known. A little variation/play can cause it to go off and not write anything.
  • After playing around with the sample program, I decided to extend this to study the mechanism better. Basically added a CLI interface to manipulate various things with commands: arm lift up and down, pen move to xy coordinates, sweeper activation, speeds of movement etc. If anybody is in need of this maybe can upload it. It helps study and refine the mechanism better.
  • Also after getting the basic version working predictably, there was a need to add English characters.
  • So studied the way the Clock writes it and added the Alphabet.
  • Changed the program to support ASCII character set (though not implemented all) so that strings can be printed.
  • Also added support for an RTC with a DS3231 (it has higher accuracy than a DS1307). One can set time and the clock also reads this and starts writing the time and on a another screen the day and date.
  • There are many other cool uses of this mechanism which will be tried later.
  • A splash image too was added for some Chamak(Bling). It reads time from the RTC, writes hour and minute, erases it , writes the Month, Date and Day endlessly.
  • It is indeed a fun thing to build. Below is the video played at 2x speed.





 



Monday, January 13, 2025

Building a GPS device for Navigation, Tracking and Metrics


The Implemented GPS device for speed, odometer, etc


Building a Tracking and Metrics device using a GPS Module

  • GPS (Global positioning system) modules are commonly used now a days for various tasks: navigation for maps, tracking speed, Geo-location etc. A couple of decades ago around 2002-3 they were not as common and there was need to use such a module for the Railways for tracking speed, odometer, maintenance information, etc.
  • One recent usage of such a device can be found here on my blog: Prototype Bangla Rail Remote Fuel Monitoring


  • The above was the device that was built for the Railways. It had 2 parts to it, a front end part that implemented the UI and a back end part that would take the GPS module readings, analyse and store information, etc
  • As this had to be a tiny system, a Linux SBC was chosen and in those days a tiny Linux distribution called CRUX was used. It could work off 16MB RAM and some 128MB flash and had support for USB flash for data storage.
  • It was indeed fun to write an NMEA 0183 parser from scratch and making sense of the various GPS statements returned and their implications. GPS modules return statements like GPRMC, GPGGA, GPGSV, etc that provide highly accurate date and time information, satellites in view, the number of satellites used for calculation, the latitude and longitude information, etc. Using this one can implement many use-cases, say for showing track information on a map, traffic information, etc
  • The backend CRUX system was implemented by me and would interact with the microcontroller at the frontend for user inputs.
  • A few numbers were tested for a period of time for the Railways. 

GPS integrated with display and uC



  • To relive the nostalgia of having built such a system years ago, and also to track various every day activities (trips, walks, etc) decided to build a current age device, given the maturity of GPS and its usage.
  • Implementing this with the usual suspects: ESP/Arduino, an OLED 1.3 inch display and also an NEO 6M GPS Module for 200 Rs. 
  • The GPS price for too good to be true. So immediately bought one. But it was kept in cold storage because of the numerous things to parallely do and trying the same chip after say a month or so, it was found to be non-functional. Tried various things and in frustration ripped off the GPS label. Turns out there was another older label inside the new one.🤣 So these local hobby parts vendor might have got cheap refurbished ones and selling them here in Bangalore. Scam !!
The old gps chip with double labels sold on Online stores


  • A New slightly more expensive gps chip was bought for 500 Rs and it had external antenna. The external antenna helps getting GPS fix faster. Else in some cases, one needs to wait a long time
  • This also had it problems (I think old devices are being sold off)  but luckily got a replacement.
  • The berg wire connection was made with the controller and using the standard GPS libraries: TinyGPS, GPSplus, etc a quick frontend for the Oled display was built. The earlier device had taken a month or so to build, now this one took just a couple of days.
  • This device now shows the speed of travel, the direction, date and the time (which really is in GMT and needs to be converted to local time) and using the latitude and longitude readings, the odometer (distance) calculation can be done.
  • Also a kind soul Mr. SG helped me assemble this circuit on a generic PCB. 
  • Made this device portable with a Lithium Ion battery, LiOn battery charger/booster circuit, switches, etc. Most important part of the assembly was the use of a local sweet vendor's plastic box. It was the right fit and of course the sweets are tasty too. 
  • Below is the video showing off the capabilities and being used in the car

  • As can be seen, shows the right date/time and shows speed and does the odometer calculation and displays it.
  • This works well with an error of around 3-5% in a car. On person carrying of this box is not reliable as the GPS antenna moves too much. Maybe will build a GPS antenna holder that can fit on my bag while walking.
  • Also next need to interface an SD CARD and store the GPS information and do interesting things.




Sunday, September 22, 2024

RGB Dot Matrix Display as Multi-Function Panel Display



PxMatrix on ESP8266 connected to an 32x16 RGB DOT MATRIX 1/8 SCAN Panel

  • It was always wonderful to see the numerous colour displays that display messages and animations on Dot Matrix Displays (DMD) in the commercial places.
  • One useful thing would be to take an Off-the-Shelf Display and run fully controllable custom software rather than rely on some external products to do.
  • Luckily found a display vendor who offered to give me some DMD as samples for experimentation. I was given a P10 32x16 pixel color DMD panel.
  • I have experimented with Monochrome DMDs (maybe blog about this later) but the RGB display is another world all together.
  • The Monochrome world does not have lot of open source software, the RGB world has PxMatrix, RGBMatrix and SmartMatrix.
  • As I wanted the controlling entity to be super cheap which meant use of an 8266 I had to start with PxMatrix.
  • Though there are better options than PxMatrix, the others use a more expensive controller.
  • Its better to start with the lowest cost option and then go up the cost list.
  • The Demo worked like a charm and was able to get some sample colours and shapes.
  • After experimenting with the examples, there was an internet clock example.
  • As this support a generic display library like the adafruit_gfx library, one doesn't have to spend much time adding fonts, drawing primitives, updates, etc.
  • The above image was generated by using a tiny 4x5 font that is available online.
  • And using other available libraries, because the example one would sometimes get Internet time, I was able to consistently get accurate Internet time. Internet time is provided by the Network Time Protocol (NTP) and it reaches out to servers worldwide and after determining location is able to synchronise time to very highly accurate values like a few milliseconds.
  • Once this was done, there was an interest to find out what more can be achieved by this 150 INR controller.
  • It would be so cool to have a News Station with scrolling information of various kinds.
  • So decided to added International News Feeds, Commodity rates, Stock Market rates and also a Custom Message option
  • The Newsfeed library that was found was very rudimentary and did not function well in all conditions. So using this as a base, extended it to add NewsFeeds, web scrape for Commodity Rates(Gold,Silver, etc), scrape for Stock Market Information (low rate for now) and finally provide an interface for displaying custom messages.
  • Interestingly this is a 50 kilo Byte computer and the data that comes in is a few millions of bytes. There was no way this data could be saved and processed later as is done on big computers. Added stream processing of the received packets. This controller accesses the web page over HTTPS and then on the fly analyses and extracts the relevant information and stores it for later display.
  • As this controller also supports  WIFI, a simple server for a user to  control the various features by using a standard browser like Chrome was also implemented.
  • Enclosed below the finished feature set where any mix of features can be chosen.
  • It was indeed fun to have enabled International News Feed and just watch news from all over the world scroll on the display forever.
  • As can also be seen in the video, it was a very good day for the Indian Stock Market which had a 1000+ point surge.
  • Video shows Custom Messages, Commodity rate(gold) scrolling, Stock Market Index and News Feed from an Indian Media Company: Times of India.
  • Also there is an option to enter new News feed URLs which has not been used in this video.
  • Shortcomings:
    • As it is a single core controller, sometimes there are glitches seen on the Display
      • Maybe use other ways of sending data on the controller. Need to study
    • Uses a slower method of data transfer to the Panel. Need to search alternatives.
  • Maximum of 2 panels (?) are supported. 



Monday, July 15, 2024

Solving the Case of an Untraceable Car Owner

Photo by Dhiva Krishna on Unsplash


  • It is both fun and pain to have an independent house. As much as there is freedom from a few things like nagging floor mates or just too many people around, there is also a pain to watch out for ourselves all around the house/neighbourhood. Houses used to be independent ones in the "golden" days where people would still live like Kings. 
  • One such problem of such a house is parking space around the house and more so if the house is adorned by many open road corners which means more places to watch out for. People generally just thrust their responsibility on others and suddenly there is a new car in one of the empty places around. If the parking is transitory then it is kinda OK, say park for a short while and then move on. But nothing is known of such cars, they could be stolen, there could be people staying in them, any other activities, etc. So it is a headache if such a thing happens. One can call the police to solve the problem but it involves filing a case, etc and its painful. Sometimes fancy cars like BMWs etc too get parked which might be OK for a short while, but still it causes "mande bisi" (head-ache). Anytime there is a  such a fancy car, I make it point to ask our daily wage working city council workers if its is their car. It invariably brings a smile on their faces at the thought of the implication🤣

  • Now that the above background is done, we heard a sound late time in one of the parking spots but did not pay too much attention to it. Next day morning this beaten dinosaur of a car is parked there. As usual needed to wait for a short bit for the car to move.
  • Minutes turned into hours to tens of hours to few days. Still no movement of the car. Now the suspicion had set in. Minute by minute checking for the presence of somebody approaching the direction was conducted. Asked some random people too. Frustrating of course.
  • About the second day, I used the govt vehicle database (parivahan) to check for the owner. The name can be kinda guessed, came to know it  does not have a Fitness certificate and is 30 years old. The doubt is that if it has been sold and the paper work not transferred, the car will still be registered in the original owner's name. So it might not lead to the true owner.
  • Around the 5th day, went around all the roads nearby asking if they had seen the car by showing them a picture because there is possibility that some new neighbourhood ran out of parking space. They definitely must have thought it was a crazy idea. But still no success.
  • Interestingly I have a new phone and it has a 50MP camera. Was photographing the inside of the car, I saw a visiting card. Tried the normal phone camera capture mode, it was focussing more on the window rather than the visiting card. Luckily the phone has a pro-mode where one can choose manual focus. Using that even though not so clear could make out the name of an Engineering Fabricator and I put the name on Google and it gave me a location about a couple of kms from my house. Below is a picture of the visiting card through the glass.

  • After the door to door asking proved futile I decided to go the Fabricator, maybe this car owner could be client of his or know him etc. I wanted to go and meet him in person maybe he will remember more else with this social media thing nobody pays any attention even to serious stuff.
  • After I landed up at the location, turns out there was nothing, no Fabricator company. All the Google Maps pictures turned out to be false. But then as usual is my practice, I asked people around, they too could not help but they confirmed that such a place existed recently.
  • I finally called the number and somebody answered. I asked him if he knows anybody who has a white car. He was a little perplexed at first. But then I told him what the issue and gave him the car number. He said it is his car and that his car service guy had taken the car for service some 5 days ago and that just today was the day they moved their fabrication place to a new place !! I told him if it had been delayed a little longer he would have had to deal with the police. He said he will get the service guy who had irresponsibly just left the car in some random place to remove the car ASAP.
  • Thus the case was solved by some daring detective skills.😎 Trade queries are welcome.
  • BTW the opening Merc picture is click bait to make you want to know what the story is 😉 Thank you for making it so far.
 

Tuesday, May 14, 2024

Leg Brake for a Bicycle

Leg Brake on a Bicycle

  •  Growing up, there was a need to learn how to drive a geared motor cycle and also get a driver's license.
  • There are two categories of two wheeler licenses: one for geared vehicles usually with leg brakes and one for auto/non-geared vehicles where the braking happens by hand and are simpler to operate.
  • Driving license had already been acquired for the non-geared vehicle but due to lack of availability of a geared vehicle for practice, the acquiring of this license was taking quite some time.
  • The main problem was adapting to braking a vehicle using the leg where one to respond differently and the conditioning takes some time.
  • Unfortunately could not manage to get anybody/s vehicle for learning after many attempts.
  • And at that time (1995 or so) bicycles were rather common and used for transport. So an idea was: why not add such a feature to a bicycle.
  • A Hercules Town and Trek was also available.
  • After some visits to the local bicycle shop and a used vehicle parts market, a hand brake was obtained.
  • Using the required clamps and the cable and adding a parallel to the rear brake assembly, this  hand brake was added to the slanted portion of the bike frame to function as a leg brake, which could either be operated by hand or by leg. A picture of the assembly is as shown above.
  • It functioned rather well for its implementation and provided enough practice for leg braking, though it was a funny sight for people to see the way the  braking worked, by reaching out on the slanted frame.🤣
  • As this was implemented years ago, there is no actual picture of this contraption just an edited picture.
  • It was indeed a cool hack way back then.

Saturday, April 20, 2024

Web Based Fuel Tracking System for Diesel Locomotive - A Prototype


  • A quick Proof-of-concept was needed to demonstrate web based Locomotive Fuel monitoring capability .
  • Diesel based fuel sensor was a SICK sensor and hardware interface to it was built by third party.
  • There was a need to build an internet gateway device to upload and display the fuel readings along with the GPS coordinates, speed, etc and the associated book keeping, etc.
  • As this was a PoC, an Off-the-Shelf SBC with a 2G modem was chosen and quickly integrated to provide internet communication, reading from fuel sensor hardware, interfacing with GPS device and web server integration service to push all the relevant data.
  • An nginx php web server was run on an AWS instance after the DNS procurement etc.
  •  Openstreet maps was used as it is free and simpler to use than others.
  • An access token to access the OSM tiles/etc was obtained and Leaflet was used to customise and show the maps/tiles, customize markers, etc.
  • As this was installed on only one locomotive, the picture above shows the track on the html page generated with the marker showing different colors for speed and on hover, displaying the fuel as measured by the fuel sensor interface hardware.

  • The above picture shows the data that was read by the Internet Gateway device and sent to the server. The data is as shown in the table: time, fuel level, the co-ordinates and the speed. No effort was made to optimise the hardware: fuel sensor readings, etc
  • A sample location on Google maps of where the loco was, is as shown in the image below.



Sunday, March 17, 2024

Reviving an unused Pharmacy Digital Display System to display custom advertisements


  • There is an unused Medical Advertisement system in a pharmacy nearby. 
  • This system would show many medical ads on local medical services; hospitals, medicines etc.
  • Since a long time now it has been switched off and unused "perfectly working" things cause a lot of botheration.
  • Got the Mukesh Medicals Pharmacy owner interested in reviving it so that it could be repurposed to show other things: custom ads, local information, products on offer etc.
  • The hardware turned out to be an MP4 player with a VGA out connection.
  • Good deal of time was spent in experimenting in encoding a suitable video that could be run on the System as it was 10+ years old and many codecs and features have evolved and cannot be run on older systems. Also the file structure on the storage device also played a part in the video operation. The earlier system keeps a record of how long and how often a particular ad has been played for payment purposes and this feature couldn't be changed.
  • There was a need to play a video of the local products that had offers and also show a welcome message to the patrons of the Pharmacy.
  • The below video shows the intended outcome 

Making Minimal Mechanical Digital Clock

Making Minimal Mechanical Digital Clock New devices are so much fun to build or use. Lately been motivated by interesting designs from aroun...