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 

Saturday, January 20, 2024

How to build a Private phone network on VOIP using Asterisk PBX with Raspberry Pi and Mobile client














  • There was a need for an Organisation to build a phone network for use by their employees. Unlike the yester-years where telephony was analog and it required switching exchanges to route calls. The Govt or large corporations would set up Private Branch Exchanges (PBX) for this function. Now a days calls can be made digitally on the internet itself given that a server can appropriately route them to their chosen destinations. Voice over IP is used to digitally transmit packets over IP on the network to enable calling. There is a need for a VOIP server and clients that can talk to each other just like the old phone network. This can be easily achieved using robust opensource tools.
  • Asterisk is an opensource PBX that has been around for a long period of time. Asterisk is an open source framework for building communications applications. Asterisk turns an ordinary computer into a communications server. Asterisk powers IP PBX systems, VoIP gateways, conference servers and other custom solutions. It is used by small businesses, large businesses, call centers, carriers and government agencies, worldwide. Asterisk is free and open source. https://www.asterisk.org/
  • For the VOIP Client Linphone is a good choice. There was need for a command line interface to auto dial a call, etc.https://www.linphone.org/
  • The above video demonstrates a few capabilites of the  system. As can be seen a netbook was used to run the Asterisk Server and configure  various VOIP clients to be given numbers that they can be reached at. A couple of spare Raspberry Pis were used to run linphone as VOIP call originators/receivers. 
    • The first part of the video shows how to dial an RPI receiver using a phone as a VOIP originator. Linphone on the RPI is configured to auto answer the calls and play the message for the intended recepient.
    • In the second part, Asterisk can be used to broadcast audio to various configured end clients. As can be seen any call on a configured public number is broadcast to all the clients and played out in public. One use of such a system is in Airports, etc. This system can also be extended for say conditional broadcast for eg. informing the public of an illegally parked car determined so by using computer vision, etc.

Wednesday, November 22, 2023

Web Based Video Streamer using TPLINK MR3020 (TL-MR3020) Pocket Router

 


  • A portable camera was needed. This was before the time of the Raspberry Pi, commonly available mobile phone extensible apps.
  • The following would be nice to have
    • Very tiny form factor
    • Low cost
    • Open Source software to enable extension
    • Support standard computer interfaces
    • Maybe run on battery too
  • As other extensible platforms were not too common, it was standard practice to use existing low cost Access point. A few notable mentions would be the Linksys WRT54G, which has many mods and hacks like WIFI car, etc and others.
  • A suitable candidate was the TPLINK MR3020 Pocket router. TPLINK MR3020 POCKET ROUTER
    • It has a USB Port so its extensible.
    • Has Ethernet too.
    • Has an OpenWRT port so any new software/configuration/mod can be written.
    • It can be battery powered.
    • It is super cheap less than 1000 INR.
  • Downloaded or generated (it was too long ago) a ROM for this router and added USB support in the kernel for various USB devices including UVC Cameras.
  • It has an mjpeg video/camera streamer built into the ROM 
  • One can access the stream via any browser on a desktop/phone/etc at a URL
  • The router and the stream is as shown in the pictures below for a Logitech webcam.





Friday, September 29, 2023

Make a Hand written like Calendar

Handwritten Like Calendar 



  • Intent: To make a unique calendar of my own.
  • Handwritten Calendars look arty and it was chosen as a good calendar format.
  • There was access to a CNC machine.
  • A template file was created in Inkscape, the Vector Drawing tool and the month files generated.
  • Had to add support for other fonts and the files generated were then converted to a format suitable for printing.
  • Had to experiment with various fonts and styles and sizes to make it look good.
  • A batch of 15 calendars were produced and physically processed by a Calendar maker.
  • A Limited number of  copies of the 2023 calendar were generated
  • It was made in two colors: ivory and card board style.
  • It was well received by interested parties and all the calendars were sold out. Satisfying !
  • Next steps for new calendar might be:
    • To automate calendar generation via an extension for Inkscape.
    • Allow users to specify important dates and custom images
    • Auto generate calendar for printing.
  • The 2  types in ivory and cardboard are as shown below






Monday, July 31, 2023

Rudder control for a Putt Putt Boat

Adding Rudder Control to a Putt Putt or Pop Pop Boat


 

  • Putt putt boats or pop pot boats are inexpensive toy boats that are fun to use. They basically use a simple steam engine, a boiler that is mounted in the centre of a boat frame and when water is filled into the boat heater pipes and heated at the boiler, it causes steam to be expelled from one of the pipes which causes more cold water to be sucked in. The expulsion of the steam causes the boat to move forward and creates a suction/expulsion cycle.
  • As the only motion that is provided is forward motion, it would be very desirable to have turn control. This is done by using a rudder.

Implementing the Rudder Control on the Putt Putt boat

  • This mechanism needs a rudder a piece of metal/wood/plastic and turns left or right depending on the control from the user.
  • To achieve this mechanism, simple off-the-shelf parts or parts available from the numerous online electronics hobby stores were chosen.
  • A simple SG90 servo can provide the left, center and right turn capability.
  • As this needed to be wireless a wireless controller with either WIFI or Bluetooth would be necessary. As WIFI is easier to implement and the UI can be provided via a web browser a WIFI chip was chosen. As it had to be small in size an ESP-01 was used. ESP-01 has some 4 usable pins.
  • A small web server and servo control were implemented and using chrome web browser one could send relevant turn instructions wirelessly as clickable text links.
  • To power this tiny circuitry a tiny 200mA Lithium-ion battery was used. But the ESP-01 only works at 3.3V and this regulated voltage needs to be fed to its Vcc/Input Voltage pin.
  • There is buck-boost voltage converter available on the electronics hobby stores that uses a Li-ion battery voltage from 1.8V to 5.5 V(even down to 2V) and either boosts it or reduces to 3.3 regulated voltage. The product is linked here 1.8V to 5.5V to 3.3 V buck/boost converter.

Rudder control 

  • Above is the picture of the implemented rudder control and the mounting.

  • The above video shows the rudder servo operation.

Implementation outcome

  • The rudder side servo turned out to be too heavy for this light boat and it would tend to drown the boat.
  • So this attempt has to be discontinued and a new stronger frame has to be used or built.
  • Updates on the next frame in a later post.
  • Below is a video of a free running putt putt boat.









Friday, June 23, 2023

Tech Stuff from the Past

<a href="https://www.freepik.com/free-photo/toy-bricks-table-with-word-blog_11260586.htm#query=blog&position=9&from_view=keyword&track=sph">Image by Racool_studio</a> on Freepik


Notable technical stuff from another of my Blog 

  • The Old Blog is here Aj's Old Blog 
  • Custom Android ROM generation and new hardware interface for a Micromax Funbook for an interactive table for a Coffee Franchise
    • Needed a new touch screen with deeper depth sensing to be interfaced to an android tablet.
    • A hackable Android tablet was found and its hardware enabled to make changes.
    • Cyanogenmod was a popular alternative Android variant. The CM10 Android ROM was compiled for 24 hours and its ROM updated to a stock Micromax Funbook (P300?)
    • Google apps were also run separately.
    • A different touch screen needed for this was interfaced to Android and was found to be working satisfactorily.
    • The link to a related blog is Cyanogenmod 10 (Android ROM) on Micromax Funbook
  • Howto build a tiny Home projector
    • Needed to build a DIY projector 
    • By taking apart the reflector backing from a phones display one can get transparency like film.
    • Using a strong light and some proper lenses, a projector can be built.
    • A type candy bar phones display was used as it was the cheapest to afford making mistakes on. And also it was borrowed from somebody else too 😀
    • The projector build and relevant info is here DIY Tiny Mobile Phone Projector
  • Simplified Medical Prescription System 
    • Learning to use a computer and be familiar with the keys etc was a cumbersome process then.
    • So to simply process a Kitchen order terminal like interface was developed. One could add/delete medicines,  the duration of the course and also add/delete notes for home care. 
    • This was before the Raspberry PI time, so an HP thin client was bought from the refurbished market and Linux was customised to provide the UI. Interestingly maybe the inspiration was a similar ncurses based UI used even in the McDonalds kitchen.
    • A dot matrix printer was also interfaced via parallel port and it could print out Prescriptions.
    • It was actively used for a few years.
    • The blog link is here Medical Prescription System
  • Howto build Digital Photoframe using an SBC
    • Need to mimic the cheap photoframes that were in vogue then.
    • Used a discarded SBC and found a tiny linux distrib tinycore and  built one.
    • Link here   DIY Digital Photoframe
  • Accelerometer demo on the Nokia Xpressmusic 5800 phone
  • Ubuntu image generation using ubiquity
    • How to customise ubuntu and generate the OS and associated problems
    • This was used to create an Ubuntu image for a school
    • Link here Ubuntu Image Generate
  • Autorickshaw Media Player
  • Java app on a Motorola Ming Phone
  • Nokia phone LCDs as alternate display on a PC
  • Display change enables different UI On Nokia phone
  • External USB adapter support on Linux
  • And many more. Head over to the other blog.

Sunday, June 11, 2023

PineTime (Pine64 Watch) Trials


  • Long time wish to build a smart watch. Experimented with various platforms, not built anything usable yet.
  • Many opensource variants: watchy, openwatch, pinetime, etc.
  • Pinetime is by the Pine64 Organisation Pine64 Org. They make many open source products like laptops, phones, watches, SBCs, etc.
  • The Pine64 forum has a watch called the Pinetime. It looks nicely packaged and so wanted to see if its suitable for everyday use. More info here PineTime
  • It is an NRF52 based chipset with an IPS display and chinese sensors for heart rate and step counting.
  • They have an FreeRTOS based OS called the Infinitime . It was WIP then (Mar2021), so many features were under development and also the UI was rudimentary.
  • At about the same time there was another micropython based OS called WaspOS which was under active development. 
    • Downloaded this and generated the OS.
    • The advantage is that one can just write micropython apps and download to this board. No classical embedded development necessary.
  • Using the standard Nordic Semiconductor tools both the OSes were flashed and various features explored.
  • Observations:
    • The apps were basic, back then in 2021.
    • Most importantly the values of the step counter and heart rate sensor were compared against a FitBit and a MAX30102 based homebrew device. The default values had many variations from the other reference devices. Maybe time could have been invested to make it rugged but then there were more accurate options so this was discontinued.
    • Interestingly it has Notifications support with an Android Mobile phone using Gadgetbridge. So this could be used for writing cool watch based control things.
  • Below are some images/videos of the watch in operation.







Tuesday, April 18, 2023

Building the Otto Starter Bot


 


HOWTO make the OTTO STARTER BOT using components bought off the Internet.


  • As there is an avid interest in building toys, opensource bots come in very handy.
  • One such opensource bot is the Otto Bot. They have designed multiple versions of bots that can be integrated by kids and provided detailed information on their website Otto Bot Website
  • Designed by a toy maker basically uses off the shelf hobbyist components to build and program bots.
  • One can learn to assemble the hardware, write code using a GUI like scratch or even use the Arduino IDE and also is extensible.
  • The plastics are also open sourced and one can download and print them if there is a 3D printer available. There is availability of online 3d printed parts. After assembling the first Otto, a couple of other Otto kits were also integrated by interested parties (kids/adults)
  • The default software collection comes with a Scratch frontend called Blockly. One can download it and examples for various hardware and emotions etc are available. This makes it a good tool for STEM.
  • The basic movements that are possible are as shown below




Wednesday, December 21, 2022

Customisation of MYS-8MMX NXP imx8 Single Board Computer from MYIRTECH

 


  
  • As of December 2022 Semiconductor shortage has led to various companies searching for alternate options that are in stock or have longer term availability. One such example is the availability of Raspberry Pi, Toradex older versions, etc.
  • MyIrtech has an extensive portfolio of such equivalents. https://www.myirtech.com/
  • There was a need to support a client who needed a browser preferably chrome and apache and php.
    • One requirement was to support serial port via PHP modules, needing the not actively maintained DIO module
    • Why anybody would use serial port via apache definitely weird, but maybe the customer only had that as the default skill
  • An NXP imx8 SBC MYS-8MMX was found to be suitable wrt the application needs. 
    • Its an imx8 quad 1.8G cores and also a single 400 MHz microcontroller.
    • 2GB DDR4 and 8GB emmc, with USB Host, NVME, gig E, WIFI/BT, MIPI CSI, LVDS/HDMI output, etc
    • All for a cost of 100 USD. And with a 7 inch display would work out to say 20k INR
    • It has support for Yocto and Ubuntu.  

   Yocto

  • The default environment provided was the one with the Yocto build system.
  • As this was the first time Yocto was used, there was no awareness of the time taken for the build.
  • On a Core i5 machine 4GB, the first build of the entire tarball took some 30 hours 😊
  • One has to add recipes to compile in various programs. And everything is compiled from scratch. So addition of Chrome, apache etc took another 10 hours. This was by far the most I have spent time on compilation.
  • It has good support for all the devices and also QT is supported out of the box. So in case custom app development is needed QT support etc can be readily used.
  • Below is a pic of the QT interface running on the machine.



Ubuntu


  • As development on Yocto is time consuming, it was then migrated to Ubuntu 18 provided by myirtech themselves.
  • The DIO modules etc quickly added thanks to the package management utilities.
  • Only the device drivers need to be customised.
  • This board uses the Lontium LT8912 LVDS/HDMI bridge. The requirement was to support 800x480 resolution but the driver would only go down to 1024x800.
  • The device configuration was also changed to add both the display and the serial ports.
  • As the resolution requirement was not satisfied further development was not attempted.
  • Dual displays 5 and 7 inch working parallely on this board

SBC

  • This SBC has a good software ecosystem along with ML frameworks/CV etc all built into.
  • To be attempted at a later date.

Friday, November 25, 2022

ESP32CAM Night Vision Hack - How to enable ESP32CAM to provide night vision

 



  • The ESP32CAM is a super cheap IP streamable camera running off an ESP32 and an omnivision sensor like the OV2640. It is around 600 INR (2022). It would be cool indeed if it could do night vision too.
  • A long time ago another webcam had been hacked to provide night vision capabilites.
  • So there was a need to check if the ESP32CAM could also be similar converted to an IR camera. The advantage this would provide would be to have night vision with an IR light as is common in security cameras. 
  • So the uses are many: security camera, trail camera and more importantly a camera with source available to change it to do anything.
  • With help from the right contacts, the lens assembly was opened up and the relevant filters were removed.
  • There was a problem in re-assembly as a small lens would keep falling off and would interfere with the image. It was solved by gluing the lens assembly.
  • Below is a video showing the results of the enabling of night vision on ESP32Cam. 
  • One can see that in total darkness, there is no image and when an IR light is introduced, the camera does provide night vision of the object. The IR light used was not very powerful and hence one had to get close to it to see the effect. 
  • Maybe next version change this to use high power IR light and also make a trail camera with a PIR sensor, etc.




Saturday, October 15, 2022

8x8 RGB Dot Matrix Display as Multi-Function Display (NEWS, Emoticons, Time, etc)

 8x8 RGB DOT MATRIX DISPLAY as
CLOCK, EMOTICON DISPLAY, NEWS FEED DEVICE



  • Would be interesting to build a multi-function RGB color display device. 
  • Good to have  display of time, images and any other chamak (custom messages, RSS Feeds,etc)
  • ESP has good support for RGB Led via the Fastled library. 
  • Bought and interfaced an 8x8 RGB from an online store with an esp8266
  • Fabricated a casing with the face and the box from a local vendor
  • The FASTLED capabilites/effects are as below. FASTLED is available here 

Thursday, September 15, 2022

Raspivid Modification to Display Custom Message as Annotation on Video Feed (Local/Stream)

 




Raspivid Custom Annotations

  • Raspberry Pi distribution is equipped with an executable called raspivid/raspistill which is used to capture and view video/still images from the RPI's CSI camera. The source code for this is available on the internet.
  • It has various options like displaying video on HDMI, running TCP/UDP stream server, capability of reading encoded MP4 streams from the encoder, annotating the transmitted stream, automated still captures, effects, etc.
  • Annotations like an OSD label can be provided on the stream being transmitted. Time annotations, etc can be enabled on the stream/video feed. 
  • The only drawback is that annotations are updated every second on the feed.
  • As there was a need to view various sensor information embedded in the video from a remotely operated vehicle, it would indeed be advantageous to extend raspivid capabilites.
  • As a quick modification was intended, the relevant files were changed to use an IPC (InterProcess Communication) mechanism and any program that would write its string into the IPC entity at approximately 1 second interval could send its information embedded on the video feed to the remote client.
  • A video showing the ultrasonic sensor reading on the front of a vehicle is being embedded in the network stream and is as shown in the video.

Tuesday, August 30, 2022

Driver Display Unit (DDU) using Railware/Scheron/HasslerRail Rico004 MVB/MICAS interface for WAP Series Electric Locomotive: A Prototype

 




Running GUI on sample hardware


Sample GUI showing DDU interface for WAP Series Locomotive



  • Driver Display Units are used in Locomotives to provide HMI for operating the locomotives. Various realtime sensor information of the locomotive/train are presented in user friendly interface on an LCD screen on an SBC. 
  • The WAP Series locomotives use a variant of the MultiFunction Vehicular Bus (MVB) called MICAS. It is a master/slave realtime bus operating in the locomotive and beyond and can work over long distances (~4kms). Information is exchanged over the bus in the form of process data and messages. It supports connection via wire or fiber.
  • There was a need to implement a Driver Interface while being interfaced to the MVB/MICAS.
  • The design also had to be kept similar to existing products so as to retain locopilot familiarity and also provide similar features.
  • Just as a fun exercise, an oscilloscope was used to dump traffic on the MVB from an available setup and manually validated with the IEC 61375, the TCN standard. It was a tedious exercise indeed.
  • Later a Zeroplus MVB analyser was procured and interfaced to the same setup and it was proven that the test setup with indeed working well. The Zeroplus is limited in the number of packets it can capture, etc.
  • So a feature rich MVB traffic analyser would be desirable and writing one locally was dropped as it is a time consuming process.
  • Luckily Railware, an Italian manufacturer (which subsequently got acquired by Scheron and then by HasslerRail) had an MVB compatible card along with a MVB protocol dumping and analysis capability. This is called the  Rico004 by Railware and there are tools written on Windows/Linux to configure it for various modes.
  •  A couple of cards were purchased and interfaced with the VCU setup and the protocol studied.
  • Railware also provides MVB cards for various SBC interfaces like SPI, serial etc. A suitable card for the SBC was procured. There also was availability of libraries and APIs on Linux so that an end client could receive MVB data as a slave.
  • After configuring such a setup an application to receive MVB data and present it in a real-time fashion on the SBC as DDU was implemented. 
  • The above Video shows a sample UI which shows emulated data on the DDU screen. The image shows the various sensor information that would be relevant to a locopilot: including various subsystems, PIXY data, status of braking systems, meters, etc.
  • This setup was working well in this test setup but due to change in project priorities never made it to actual deployment.




WAP7 Locomotive. Image from Wikimedia

Saturday, August 27, 2022

Driver Display Unit (DDU) for Diesel locomotives WDP4/WDG4 (EMD GT46PAC/GT46MAC)




  • The WDP4/WDG4 locomotive is a diesel locomotive used actively by the Indian Railways. It is a locally built General Motors Electro-Motive Division's GT46MAC (freight) and GT46PAC (passanger) variant. More details can be found here WDP4/WDG4 info on Wikipedia
  • The various gauges on this locomotive are Analog and there was a need to digitize them and provide a single console like is common on many locomotive Driver Display Units. 
  • A commonly available industrial x86 SBC which could run Linux and a GUI was chosen.
  • It was interfaced at a location on the loco rack where digital signals were available.
  • It could show a locopilot various readings on the console: Speed, Brake Pipe/Cylinder pressure, BE/TE, Notch position and also various fault conditions.
  • This DDU was used in a few locos and has worked reliably.
  • Below is a picture of a physical meter and how it looks on the implemented DDU.



WDP4 Locomotive
Original Wikimedia image here



Wednesday, May 4, 2022

Nuvoton NUC980 IIOT Board Experiments (Interface ST7735 SPI display)


Introduction

  • Nuvoton NUC980  is a 300 Mhz ARM processor.
  • Has a host of peripherals onboard: 64/128 MB RAM, 2 Ethernets, 2 CAN masters, some 8 UARTS, SPI, I2C , etc
  • It comes with Linux, uboot and a buildroot system for generating system assets.
  • A popular board is the NUC980 IIOT board
  • The major advantage is that this processor is available for a low cost of 5$ (2021)

Intention
  • Try and see how fast the system is
  • Performance of python etc.
  • Given that it was a low RAM system, how convenient would it be write a program in python.
  • Maybe interface a device say a Display.

Experiments
  • The tar ball that Nuvoton provides is an approx 8 GB virtual machine running Ubuntu 18.04.
    • One can run this virtual image on an VM emulator.
    •  The recommended is VMWARE but it ran comfortably even in an Oracle VirtualBox VME.
  • After logging into the VM and on running a make nuc980_defconfig it generated the uboot, linux and other assets.
  • On Linux one can use nuwriter to flash the SPINAND. 
    • A run.ini file is needed as configuration to the nuwriter
    • It specifies destination of writing: SPINAND flash, SDCARD, RAM, etc.
    • Each destination has section for which the relevant files to be flashed has to be provided.
  • One problem that was noticed was that even though the flash writing progressed successfully, the system would display a few bytes as follows:
NUC980 IBR 20180813 
Boot from SPI-NAND
Nand boot!      #S
finish SPI dow&*


Python support
  • Idea was to try writing a user space driver for an SPI device like the ST7735 in python
  • A python driver for Pimoroni displays can be found.
  • It was modified to drive a color display to show time.
  • Python took a long time loading but after it was loaded in RAM, it was fast enough to update the display
  • Also FB-TFT could have been a good way of interfacing the display
  • Below are 2 sample videos.








Friday, April 29, 2022

IOT Dot Matrix Clock

Dot Matrix Clock

IOT Dot Matrix Clock / Dot Matrix Display  (DMC) (DMD)

  • An accurate clock for displaying time (Hours/second) and date would be a nice creation.
  • Added advantage would be to have it connected on the internet and splashes messages to it.
  • A WIFI based solution would be much better for easy access to the home/network ecosystem
  • Using an accurate RTC like DS3231 and Wifi chip ESP8266, a PCB was fabricated.
  • Also there was a need to make a good case to host the electronics.
  • Acrylic case making is cheaper as compared to 3d printing.
  • Found an enterprising acrylic fabricator who made an amazing case.  The power supply was embedded in the back of the case so it could be directly plugged into the wall socket or the ESP8266's USB power connector provided for at the side of the casing.
  • Uses the MajicDesigns MD_MAX72XX library from here MajicDesigns MAX72XX library
  • The fabricated DMC looks as follows:

Mains Enabled Clock



  • The DMC can be run off either AC mains or an external battery.
  • It keeps accurate time and also shows scrolling date.
  • The clock also has switch at the side to directly interact with the device in case Net access is not available.
  • The DMC comes up in Hotspot/AP mode and runs a Webserver internally. Using a browser after connecting to the AP, one can set the DMC to connect to an existing home AP with configuration options for
    • Network Name
    • Password
    • Update Server (for OTA updates)
    • Manual Update Option
    • Set Time on the RTC
    • Mechanism to display custom message (scrolled a few times a minute)
Firmware Update over the Network

  • Custom Messages via web URL can be sent to the display over the network as in the below example

  • New firmware to show live Indian Stock information was also added recently.
  • This clock has been operational for 2 years and more now in 15+ units all over the world. A teeny bit of happiness.