Archive for August, 2018

My Bike Executes Prolog!

Posted in Uncategorized on August 26, 2018 by Ruchira Hasaranga

This is how my bike fires alarm when stand is on: It runs Prolog query to detect risks & fire alarm when needed… But why Prolog? Instead of giving microprocessors direct instructions for doing things, we can give it specifications of problems and let it find the answers. As a human your skill is understanding what needs to be done; the computer’s skill is working out the best way to do it.

Facts & Rules interpreted on bike:

when (no-risk , alarm-off)
when (on-risk , alarm-on)
when (stand-on , on-risk)
when (stand-off , no-risk)

do-when (Situation , What) := when (Situation , Y) , when (Y , What)



I used DM ProMicro and flashed it with Haze-Prolog interpreter. Haze-Prolog is a light-weight prolog interpreter which can be run on embedded systems.



Here is the block diagram of the system. Reed switch used as a stand sensor. Output of the ProMicro fed to a buzzer. When power on, Prolog query runs on infinite loop to check the status of reed switch & fires alarm if needed.



Here is the photo of my bike. Front cover removed to install prolog module. The module was connected to the power connection of the side head light. The module will be turn on when ignition switch is turned on and it will check the status of the stand & fire alarm if needed.



This system can be extended by adding more sensors and output devices.

සිප්නැණ Microprocessor Programing Articles

Posted in Uncategorized on August 18, 2018 by Ruchira Hasaranga

Scanned articles about Intel 8032 processor in Sinhala.

I read these articles from “සිප්නැණ” magazine when I was in grade 9 (1999). I didn’t have a computer at that time and I was using pencil & book to draw circuits. I remember drawing processor and rom on a paper and interconnecting them… thinking about them… dreaming about them…

These articles inspired me to learn about bare-metal programming. So I scanned them to preserve it for the future.