My Bike Executes Prolog!

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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: