Skip to main content

Posts

Plotting MPU6050 Outputs in Real-time

So, this was a problem/challenge given as part of the induction project for one of the technical associations/initiatives on campus. Essentially, the problem statement was to interface with MPU6050 and plot the results live on the computer. I kinda managed to do this using Python's matplotlib. It's been a while since I've used Python before, so had to look up a lot of pages on how to use matplotlib. Since I didn't use Python's CSV library, nor did a lot of File Handling with Python before, I thought I'd try using it in this to generate a CSV file of all the readings that were being read from the Arduino. For the Arduino, I used the readymade MPU Library to get the values. The code I wrote for this works, kinda, but it's messy. This was a one day job, so there's a lot of repetitive code that could be eliminated. Also, this is the first time I've tried using matplotlab for real time results. Link for code here . I'll probably get back to this ...

Java MiniProject

This was a small Java Mini-project I made as a part of a team of three as partial credit towards our CS F213 (Object Oriented Programming Course). Click here for the source code on GitHub . It's a hotel booking application where users can create accounts, new bookings and manage their bookings. Installing the required software itself took more time than expected. We started with Oracle NetBeans and shifted to Apache NetBeans 9 IDE, because it supports the latest version of Java/JDK. This was also the first time we tried to use git (and failed miserably). We ended up just merging our parts of the work by hand (the old-fashioned way - by email and copying source files from one pen drive to another) and then finally one person pushing/committing all the changes. Now we know how.  This was something made kind of in a rush on the last day, and the code isn't perfect. The project used a MySQL database to store the room, user information and JDBC to connect to the database. The G...

Sensors: Sound Sensor

Sound Sensor Just a basic thing where the LED goes on when sound is detected. So when we clap our hand or make any noise, LED glows. Pretty basic. Code here. Connected an LED through a 1000 ohm resistor, and made the necessary connections of sound sensor to +5V, ground and digital pin (why isn't analog output possible with sound sensor?). So, a few random things: Even when a constant beep sound is playing, the light keeps flickering slightly, especially at lower volumes. The reverse of this was not really possible to achieve - like the LED should be on when it's silent and should go off when there's sound. That really isn't happening - what happens instead is, when you make a sound (like the constant beep), the intensity/brightness of led light decreases, but it doesn't go off. Essentially something like pulse width modulation must be happening unintentionally.  Different color LED bulbs: I have red, green and yellow LEDs - and I tried plac...

Morse Code to Text using LDRs

Okay, so the idea was to convert light signals (Morse code) to text that would be displayed on the computer screen via the Serial Monitor. So, I set up an LDR circuit (in voltage divider configuration) to test the brightness of light. When the intensity of light is high, the LDR has low resistance and thus most of the voltage difference is across the 100k-ohm resistor, giving us a high voltage (analog values > 1000), and when there's no light values of 300-400 were common. To prevent ambient/surrounding lights from influencing the LDR, I set up a closed box housing the LDR+Arduino with a small hole, where the signal would be flashed. The circuit  Essentially the circuit is this: The Morse Signal would be flashed using my cell-phone back camera flash using an app called Morse Code Flasher . The opaque box - there are two holes - one for the light/signal and another on the side to run in the USB cable to Arduino. Inside of the box   After constructin...

Translating Text to Morse Code using a Flashing LED

Essentially, we input a string, and the base time (or the time required for a dot in Morse) and the output is the string in Morse code (displayed using a green LED bulb). Why a green colored LED? Because I didn't have  a white one.After transmitting the text, the red bulb flashes on for a while to signify end of message, and then the message is transmitted again. The source code for this can be found on this link . A video of the translator for the string "SOS" (...---...): Ideas and random thoughts: Next project to try - converting Morse code back to text.  Further improvements for this: adding punctuation and stuff to the Morse dictionary to edit the message we have to transmit, we need to manually change the source code and then upload again. While this isn't a big problem because all you need to change is a single line at the top, it is still kinda lame.  input can only be capital letters - change that to allow small letters as well. (I did try d...

Starting with Arduino

Finally unpacked and started to use all the arduino parts I binge ordered on Amazon a few weeks ago. The first real thing I did was this (very small) project from the Arduino Tutorials. Essentially making an LED bulb flash. It's a start, I guess. A picture of the messy wiring Okay, so notes in random order: I assumed that the small button switch I had would toggle between on and off whenever I press. Instead, for the circuit to be complete that button has to be pressed and kept pressed. So it's a push-to-on button - as long as we keep pushing, it keeps the circuit closed.  I could've just used a jumper cable instead of that lame button (could've saved some cash, ig). Whatever. A video: (ignore the background music - was using it to mask the noise in the video)   The code used can be seen here .

So, WebDev: My First Project Idea

Okay. So it's summer. And there's tons of time. So I'm trying to figure out WebDev cuz why not. Some people say that WebDev is not real "coding/CS" per se - but who cares? I'm not doin' it cuz it be CS, I'm doin' it because I want to build something I can see, ok? Anyways, I digress. Since this is my first post here - I'll make the purpose of this blog clear: to keep a record of what I'm trying to do so I can laugh at myself half a decade later. That's it. No other purpose. Nothing. Zero. Nada. Zip. The Idea: A TShirt Exchange Portal (copy-pasting the idea I typed in a notepad file at midnight yesterday): Project statement : To create a T-Shirt exchange website that would enable the students of BPHC to exchange T-Shirts bought on SWD Portal, if they have the same size. Impact : This project on completion will make it much more simpler and faster to exchange TShirts. A process that today involves tons of posts on FEG spamming...