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



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...