Posts

Showing posts from May, 2021

DIY VOLTMETER USING ARDUINO ADC

Image
This post helps to DIY yourself a high precision multimeter using Arduino. The UNO already comes with an excellent 10-bit ADC which is enough, but I recommend using an external ADC of 16-bit if you want to take it to serious measurement. But you don’t want you use it as replacement for a multimeter, buy a good multimeter instead of it. This Arduino based one is helpful for projects and static voltages that doesn’t change over the time.  We can create a voltage divider hence  We can measure voltage drop between the divider and hence multiply with resistance to get the VIN. Here I’m using a 1Kohm and 2.2KOHM resistance to measure max voltage of 5V. If want to measure the higher voltage use the following formula to adjust the resistors.   Vout = VIN * (R1R2/R1+R2) [NOTE:   This voltage “VOUT” should not have to be more than 5v, I recommend VOUT<less than 5V is safe to use]. Sounds easy because it is, but V_IN cannot be measure hence we need ADC to do trick, the 10-bit adc can mea

HOW TO IMPLEMENT PRECISE TIMED EVENT WITH ARDUINO

Image
Let us assume a situation where you want to blink an event at a precise moment with a trigger, while the Arduino doing other tasks and you want to prioritize the blink as important event. Well in order to do that you need timers help to time it precisely hence you need to use timer as interrupt to do that. The Arduino IDE default has a time function called “delay (microseconds)” it is pretty good and we can use it almost in many things, but it’s not precise and tends to shift some mill-seconds after sometime hence not reliable. That being said let’s see how we can implement a timer of Arduino to create a triggered event. The Arduino comes with two 8-bit timers, one 16-bit timer hence we can use the 16-bit timer to implement and triggered event. We are gonna use the TCCR1A and TCCR1B timer registers to implement. In the datasheet it is given clearly about how to implant it. The Timer/Counter (TCNT1), output compare registers (OCR1A/B), and input capture register (ICR1) are all

HOW TO WRITE YOUR OWN CODE FOR AN LCD DISPLAY (16X2 OR 16X4)

The Arduino ide default comes with an excellent library with examples for LCD display it’s really easy! One to use. Mine is not best one but the reason behind this post is to experience the feel of writing your own code and understanding the embedded displays and their working technology and how they works with u-controllers, maybe in future it can helps you to write a code for lcd display with other new microcontrollers or other programming languages. So let’s start with the one important things: The datasheet is your friend in this quest for any quest, for real! So getting the data sheet is important here I’m using a 16x2 LCD. This kind LCD is based on parallel interface LCD controller chip from Hitachi called the HD44780. Next is physical pinout the display uses a matrix of dots and displays only characters in 16x2 matrixes. Each character is displayed in a 5 column × 8 row dot matrix or a 5 column × 10 row dot matrix The pinout is LCD has totally 16 pins they are: 1.

HACK HC-05(BLUETOOTH MODULE) FRIMWARE INTO HID FRIMWARE

Image
This post helps you to change the firmware of the hc05 Bluetooth chip into hid enabled Bluetooth chip. The HID stands for “HUMAN INTERFACE DEVICES” means things like your keyboard, mouse, printer, joysticks, etc.. Drivers get automatically installed in your computer without any external drivers needed.   The hc05 default don’t have hid capability but, the chip hc05 uses is same clone of chip RN-42 uses (BC417) , the RN-42 is an HID enabled chip. We gonna swap the firmware’s of rn42 into hc05. [NOTE: this particular hc05 chip comes with serial interface in it if you perform this swap it no longer work as serial Bluetooth chip. If you want you can save the firmware of hc05 and re-swap again to work normal]. That being said what are the things we need to perform this task are: 1.   HC05 module for sure (duh!) 2.   RN-42 chip {Wait if you are performing this task you must be very enthusiastic in electronics or extremely poor then why the hell you gonna buy an rn42 chip for..