It’s no longer than a month since I bought a Raspberry Pi. Pi 4B to be precise. In this post, I’m going to log how I spent my 1st month with it.
Setup the Pi
When I decided to buy Raspi, I decided not to go with the kit. The reason was the model I was looking for, which is 8GB Model B wasn’t available in India. And finding a kit for it would have been more challenging.
So I bought the Pi itself from OL Electronics. It cost me ₹10,700 INR with taxes and delivery charge.
As you might know, Pi does not ship with a power adapter. So I bought one from robu.in. It cost me ₹315 with delivery charges.
Pi also does not comes with a memory card. I tried searching for 64 micro sd cards offline and online. The best deal was from Amazon. It cost me ₹539. You will also need a card reader, which I bought from the local market at a price of ₹30.
While flashing, I choose to use the Lite variant of OS which comes without a desktop environment and has a footprint of 300 MB on disk.
Setting up the OS
The Pi board, a 5V 3A Type-C power adapter, a micro sd, and a card reader is all you need to boot up a Pi. You don’t need a monitor or HDMI adapter if you already have a laptop because you can also SSH to your Pi to do your work remotely and that is how I usually work on my Pi.
As you know, I use Ubuntu on my machine. If you are also using Ubuntu, you can install it by:
sudo apt install rpi-imager
Instruction for other operating systems can be found on their GitHub page.
Put a micro sd card in the card reader and Please consider watching How to use Raspberry Pi Imager.
I prefer to use the gpiozero package for dealing with GPIO. But there is also an
Make sure you attach the long head of the LED to pin 18.
There is also an equivalent code using the
I have also short a video I have posted on Instagram. Here it is:
Actuate on Proximity
Here I have used both packages to run something when the proximity sensor detects any object near the sensor.
The sensor I am using is an IR proximity sensor.
Controlling LED brightness, 0-100 and back
Below is Python code to change the brightness of a LED light using Raspberry Pi.
I don’t shoot a video for this one because the intensity was so low that it was very hard to distinguish between different strengths of light.
Controlling an RGB light (failed)
I have also bought a common cathode LED. But somehow, I’m not able to turn on the LED. Not sure if the problem is in the LED, my code, or the pins.
Here is the code I was using.
And here is the setup I was using.
In the above image, the blue, green, and red are placed at 6, 7, and 8 on the left column, and the common cathode is placed at 3rd from the right.
Please let me know if you have a solution for this one.
This is not the entirety of the things I have done with my Raspberry Pi in the first month. I have a DHT11 sensor which I mistakenly bought without the IC. And now I need a 4.7K resistor to work with it. I am yet to order the resistor.
Alongside Raspi accessories, I have also bought some NFC tags to play with. I will post another blog if I make something interesting with it.
Installing Home Assistant is another thing that I have done on my Pi. This board is going to be the hub of other smart devices on my network. I’m planning to buy some ESF32 to help me with my home automation journey.
If you are also keen on home automation and IoT, I’d recommend you IoT for Beginners.
Let me know if you want more articles like this one.