Arduino Random Blog Topic Generator

Blogging is fun but only when you have a very good idea or topic to blog about. The topic must also be of some importance and demand to the public ,if you have started a new blog, to increase the traffic to the blog. When I started blogging I got good ideas to blog as I was very excited about running a blog, but later on it became difficult for me to search topics for blogging. I found some helpful tools on the internet such as this. I was blown by the way it worked. As I am a tech person I became curious to develop such an algorithm. Eventually I succeeded in it and to test it I used the good old Arduino. Let's see how I did it.

This project just requires two things: an Arduino and a computer with Arduino IDE intalled on it. Just download the code attached below and upload it to your board. You can hook up an LDR (Light Dependent Resistor) to improve the performance of the project.

Arduino blog topic generator

This is project is based on the generation of random numbers. Arduino can generate random numbers but it does this using a special algorithm so you are more likely to get the same set of random numbers if you happen to run the Arduino multiple times. In order to solve this problem there is a randomSeed() function. What this function does is it takes some analog input and uses it to start the random number generator at an arbitrary point that gives a random set every time we run the program.

The program is not the most efficient one but it gets the job done. There are four arrays with four prefixes in each of them. The program first takes the input which is a noun and store it in an array named "noun". For this the function Serial.readBytesUntil() is used. Then the program chooses each array one by one and generates a random number from one to four. This random number is used to randomly choose a prefix. You might ask why did I use four arrays. This is because if you have all the prefixes in the same array you might get the same prefix as the random numbers generated may be same.

You can improvise this project if you are an advanced Arduino programmer by adding an LCD screen to it and by using a PS/2 keyboard for the input or just four switches for the input using Morse code.

Popular posts from this blog

Build Your First Robot - Reading Resistors

Jarvis: An Arduino Based Home Automation System

Photoelectric Effect