Tutorial : Replacing the Voltage Regulator on the Arduino

I was doing my school project and then suddenly the voltage regulator on my clone Arduino mega blew up. One of the 5V wires from the breadboard had accidentally touched a ground wire. Quickly, I removed my 12V power source. I then plugged in to the computer and luckily it was detected by the computer. This will be a tutorial on how to change the SMD voltage regulator on your Arduino. (Uno, Mega 2560 and etc). The Arduino I’m using is a clone Arduino Mega 2560. It is not really that hard as what you may think. It was previously using the 5V version of the AMS1117. The picture below shows the regulator after I had scrapped part of the plastic casing. It had ruptured to the point that I could simply use my tweezers to pick the plastic casing off. Burnt AMS1117 1. Using a side cutter/snipper, cut the 3 pins connecting the regulator to the Arduino PCB.

2. Use a soldering iron to heat up the tab of the voltage regulator. Depending on the wattage of your soldering iron, this may take a while. The Antex XS25 25W soldering iron I’m using did the job pretty quickly, only taking about 3 seconds to melt the solder around the tab.

3. Using tweezers, lift the voltage regulator up. Do this slowly, as you may rip the copper pads

4. Using a solder sucker or solder wick, remove extra solder on the pads and any remaining bits off the pads

5. Tin the pads with solder.

6. If you’re using a similar part to the one that burned, simply start soldering as per normal. Make sure that the pinouts are the same If not, go to step 8.

7. If you’re like me and only have LM7805 voltage regulator in the TO-220 form, and have a part that does not have the same pinout as the AMS1117, bend the ground and Vout pin so that they are crossing each other. Cover the pins with heatshrink or tape to prevent them from touching.

1         2         3                   1        3        2

|          |          |                    |         |         |

Vin     Gnd   Vout              Vin     Vout     Gnd

(Cross pin 2 and 3)

8. Solder them to the pads as per normal and you’re done. 9. Test by plugging a power source to the 2.1mm jack or the Vin pin. Use a multimeter to measure the 5V pin to make sure it outputs 5V. LM7805 Arduino


P.E.T : Personal Easy Transporter

P.E.T : Personal Easy Transporter

Project Supervisor: Teo Shin Jen (http://shin-ajaran.blogspot.sg)

The P.E.T is an open source personal urban transporter, designed to be used for commuting on sidewalks and for connecting the last mile between the MRT Train Station to home. It has a small size which makes it suitable being brought into MRT trains. The benefit of it is that: It is cheap, easy to build, highly adaptable to any spare parts the end user has, small footprint, and relatively acceptable travelling speed.


What its made of

It is made of a pair of repurposed car wiper motors from a previous project, bolted to a piece of 40 x 45 cm plywood. An Arduino Uno receiving commands from an app on an Android Smartphone through the HC-06 Bluetooth module is the brain of the whole transporter. It also gives commands to the Sabertooth Motor Controller through Serial UART. The app is readily available on the Google Play Store here. The P.E.T is powered by a rechargeable 24V LiFePO4/NiMH battery also recycled from a previous project.

How its made

The first thing to do is to test out everything first. The arduino is connected to a breadboard which has the HC-06 Bluetooth module and to the sabertooth motor driver with 24V powering the motor driver. Solder/Crimp fork and push on connectors for easy disconnecting/connecting of the motors. Remember to use sufficiently thick wires. The program for the arduino can be downloaded here.

Motor Driver Vin -> + 24V

Motor Driver Ground -> Arduino Ground and Power Supply/Battery Ground

Arduino Pin 1 -> Motor Driver S1

Arduino Pin 2 and 3 -> Bluetooth Tx and Rx to Arduino

5V and Ground -> Bluetooth Vcc and Ground


The second thing to do is to think of the layout, how everything is mounted to the plywood. Then measure the total size. I chose the wheels to be flush/’hidden’ within the plywood so as not to hit other surrounding things easily.

The third thing to do is to cut the plywood to size. I had it cut to 40 X 45 cm. Using an automatic jigsaw, it was cut from a larger piece of plywood. Then, draw guide lines for drilling the mounting holes. Before drilling, make sure that the mounting holes align with the markings. Double check! Using a hand drill, with a piece of scrap wood underneath, drill the holes needed. I used a 6mm drill bit as the bolts used are M6, giving it a tight fit. Next, using the appropriate screw size, screw in the motor to the plywood. As the screw head has a hexagonal shape, use a spanner to tighten it. Insert a nut to the other end, if available. The fourth step is to drill holes for the battery, Arduino and the Sabertooth motor driver. This should be fairly simple. Use self tapping screws for this as these screws do not go fully go through the wood. The last step is to fasten the battery to the plywood, connect the respective motors to the respective ports on the motor driver. Remember, one of the motors has to have its polarity reversed. Test the forward direction first to see which motor has to have its polarity reversed. If you don’t have the correct connector for the battery, use crocodile clips. Add a switch between the battery to the motor driver input. As the motor driver has a 5V out, use that to power the arduino through the Vin header. Refer to the earlier wiring diagram on top of this post. Solder wires to the Bluetooth module and a connector to the other end. Make sure the wires are all not hanging freely. Use wire fasteners to secure them.

And you’re done! Wasn’t that hard, was it? Now go out there and show the world what you have made!

TKKYIA 2015 Update #1

In the previous post, I talked about the Tan Kah Kee Young Inventor’s Award (TKKYIA). In this post, I will be talking about what are my detailed plans for the personal transporter.

The motors are from a car windshield wiper which was also used previously on another personal transporter. It has a gearbox to give it some torque while sacrificing speed, which is not really what is needed. Its fairly heavy, so this will ensure stability.

Testing the motor

A motor driver will be used to drive those motors using PWM. The PWM speed is regulated by the motor shield which receives serial commands via a Rx line from the arduino. This particular model is the Sabertooth 2X25. It can drive up to 25A per channel, but we only need about 800mA – 1.5A, so at normal operation, the currents are way lower than its limit.

Testing the HC-06 Bluetooth Module

Right now I’m just testing different android apps that send char characters to the bluetooth module and using the serial monitor to see the output. Originally I wanted it to be accelerometer controlled, but the app I found doesn’t really work on newer versions of android. There was another app of which I can customise every slider and button on the phone side. However, it is a paid app so in free mode I could only use it for 10 secs. The link to app can be accessed here.

The other apps only send a ‘f’ for forward, ‘b’ for backward and so on. There are predefined in the app so in the arduino sketch I have to match those commands. They also support moving forward while turning slightly. (8 directions of movement). Most likely I will use this method.

Main Things

The wood panel used is plywood and I had it cut to 40cm X 45cm. I gave some extra tolerance so that I don’t have to recut in case everything doesn’t fit. I can cut the wood to the smallest possible size later on.

The battery is rather large, so I have to see how it fits into the transporter. I have not gotten it yet, so I did not drill holes for the motor mounts. Currently I have 2 possible layouts as shown below, if the battery is really large, I would have to place it in between the motors.


Mounting the Motors

The motors have a M8 standard holes, so what I’ll do is screw them in from the top of the wood panel.

Tan Kah Kee Young Inventors Award 2015

I am going to be building a personal transporter for Tan Kah Kee Young Inventors Award 2015 (TKKYIA), inline with my diploma course which has some elements of transporting systems.

My plan is to have a small wooden platform with 2 motors on each side with a arduino uno and motor controller driving both of them. Commands to drive the motor will be from a HC-06 Bluetooth Module connected to an android smartphone. A Lithium Iron Phosphate (LiFePO4) battery will power it.The intended use case for this is to be used in sidewalks.

5V Supply From TI Launchpad MSP430FR5969

Although many newer devices use 3.3V, 5V still remains as a standard requirement for many devices such as sensors and displays. The launchpad works with 3.6V – 1.8V (to be specific) and the board provides 3.6V to the microcontroller. The easiest way to derive 5V from the board is through an unpopulated pin hole on the ezFET side. In this guide, I will be showing how to derive 5V from the MSP-EXP430FR5969 board.


I was looking at the schematics of the ezFET power delivery on the EXP430FR5969 on the official User’s Guide. Mine is the Rev 1.6 of the board, it doesn’t have a standalone 5V port on the board. The newer revision (Rev 2.0), does have a labeled 5V pin hole near the boosterpack connectors
I found a header that is directly connected to pin 1 of the microusb connector. (Circle in Red)
The actual purpose of it is for debugging purposes, but as long we do not draw more than 500mA from it, it should be ok.
If we take look at the ezFET, there are 12 unpopulated pin holes. This matches the 12 debug lines, so this should be the correct one!
Pin 1 is the top leftmost pin and pin 12 is on the top rightmost. Pin 3 is 5V, so it should be the bottom leftmost pin.
I used a multimeter in continuity setting and got a continuity between that pin and pin 1 of the microusb connector. Pin 1 is 5V on the microusb connector.
Just to be sure, I measured the voltage and I got 5V.

Aquaponics with TI MSP-EXP430FR5969

Project Supervisor: Teo Shin Jen (http://shin-ajaran.blogspot.sg/)

The Singapore Mini Maker Faire is coming up in about month’s time and I am thinking of making something new with the MSP430. I thought of doing a tweeting monsoon drain/weather station. Currently there is no way to tweet directly from the MSP430, although Adrian from TI had made it possible by using the computer to help the MSP430 tweet. However, its not possible to put bulky computer in the drain with the MSP430. (Think about the costs of waterproofing it, its not pratical). So I thought of making a home automation system, with a smartphone/PC controlling it by means of a website with the MSP430 being the local server. It requires a CC3000 WiFi boosterpack, but at that time it was out-of-stock. I don’t really have much time to wait, so I ditched the idea and went on.

Final idea is to make a MSP430 controlled aquaponics system. It would have sensors and pumps to control water flow which I will describe later on in the next post.

My idea of this project is to solve the problem of food growing. In Singapore, costs of fruits and vegetables are rising, partly due to we import some of it. Common vegetables are grown hydroponically here.



You’ve probably heard of ‘hydroponics’. Aquaponics is actually a portmanteau of two words – Aquaculture and Hydroponics.

There are 2 systems – The hydroponics system and the aquaculture. Basically what is does is to pump nutrient-rich (fish wastes) water and use it for hydroponics. This will reduce costs by a large amount, as hydroponics chemical solutions are not cheap. The bacteria in the plant roots will break down fish waste into nitrates and nitrides, of which then the plants can use. The only input into the system are fish food and water. Water has to be changed every 1-2 weeks to prevent bad bacteria build up.

The diagram on the right shows how the real thing would be. A pump is used to transport water from the fish tank to the hydroponics and the ultrasonic sensors as water level sensors. But because it takes a lot of time to make it, I will be just making a proof-of-concept.

The 2nd diagram shows how the proof of concept will be done (minus the solar panel). There will be no fishes used and instead I will be using an organic fertilizer mixed with water to simulate the fish waste. I am using the drip system as it is the easiest and not too sensitive.

(Types of Hydroponics Systems)

pH,ammonia and oxygen sensors are ridiculously expensive, so I will be skipping them. I am currently working on a DIY water-resistant TMP36 temperature sensor.

Making a DIY Water-Resistant Temperature Sensor


I used a LM35 Temperature sensor due to its convenience and ease-of-use.

According to the datasheet, it takes any voltage from 4V to 30V and outputs a linear-calibrated voltage proportional to the temperature for a maximum of 1.5V at 150°C.

Although it requires at least 4V, it seems that 3.6V works just fine. There is, however, an unpopulated pin hole on the launchpad providing direct 5V from the USB connector. The guide can be accessed from here. I’ll definitely use that pin for the LM35 for optimal perfomance

I used a rubber tubing to cover the sensor. It fits very snugly and then I used some hot glue to seal it up. Not the best method, but hot glue is fairly water resistant as I don’t have waterproof silicone glue.

This slideshow requires JavaScript.



I bought a large tub from the 2-dollar japanese shop Daiso. I then drilled a large hole for the tubing. Originally I used a rubber tubing and hot glued it to the tub. However, it seems that hot glue does not stick very well to that type of rubber. Instead, I used a plastic angle connector and then applied a generous amount of hot glue.

The diameter of the outlet of the connector is a little bit smaller than the inlet of the pump. I applied some hot glue and while it is still hot, I quickly squeezed it in. The pump is from an old water boiler and uses 8-12V. It can however run on 5V, but it is too slow for practical use. Anyway my plan is to use a 12V power supply for it and it will be controlled by a transistor.

I did a test run and it seems that the hot glue seal is doing quite well.

This slideshow requires JavaScript.



I would say that programming is one of the most time-consuming parts of this project. There are quite a few parts to the code:

1. Clock Time adjustment function

2. Clock Time Advancement

3. LCD Updating Code

4. LM35 Code

5. Ultrasonic Sensor Code

6. Motor PWM Code

7. LDR Code (If I have time)

I won’t go too detailed into the parts of the code as it is too long.

The clock time advancement codes I partly copied it from code meant for an Arduino alarm clock.

The code for the clock time adjustment function itself took about 130+ lines of code. I wrote all of them from scratch, as I didn’t really fully understand the codes that I found online. Moreover, the method to adjust the time I used is different than theirs.

The code for the LCD was pretty simple, everything was adapted from the library that ‘Chicken’ from the 43oh.com forums wrote. He also recently made the library capable to display .h bitmaps image files in the LCD, upon my question/thread on the forum on how to display .h images on LCD here. Special thanks to Chicken!

The ultrasonic sensor and LM35 code is fairly simple too. The ultrasonic sensor code I took from the example sketch in energia. Since the LM35 outputs a voltage proportional to the temperature in deg C, I used adafruit’s LM36 code to get the temperature. At first, I didn’t know that the Wolverine Launchpad has a 12-bit ADC (Analog-To-Digital Converter) which means that its analogWrite() outputs 0-4096 instead of arduino and the G2 launchpad’s 10-bit ADC 0-1024. I was getting false readings and for 2 days over 3 hours I couldn’t solve the problem. I had asked the 43oh forums and the great community there pointed out about the 12-bit ADC.

As of the time of writing, I haven’t finished intergrating the motor PWM code into the main program. It should be easy and just a few lines.

Making A Boosterpack

I am making a boosterpack for the launchpad for easy connectivity.

It is where the Temp sensor, ultrasonic sensor and motor(pump) controller will be connected to the launchpad.

The LM35 requires 4V, while the SRF05 ultrasonic sensor requires 5V. However, with testing, it seems that both of them work just fine at 3.6V (Which is what the launchpad provides at Vcc).

I used fritzing to plan out the circuit first. Then, I soldered the 20-pin boosterpack pin headers.

I made some DIY manual-crimped standard 2.54mm connectors for the pump, ultrasonic sensor and the temperature sensor. It was quite tedious, but it is convenient to remove/connect after that.

For controlling the pump, I used a TIP110 transistor with a 1K ohm resistor to limit current into the base.



Since I didn’t have a water tube for the pump, I had to buy one at a Local Fish Shop(LFS). It was amazingly cheap, I bought a 2m long small tube for 80 cents. It was meant for air bubblers, but since my pump isn’t that high pressure, it should be enough.

When I tried the tubing on the pump, the whole tube could go into the pump’s output. It was too small. I used some PTFE plumber’s tape and taped the end of the tubing. It fits quite snugly. I had also cut a few slits on the other end of the tube so that the plant roots can get consistent water supply.

So far, I have been running the pump and I have not gotten any leakages. The only leakages came from the connector connecting the container to the pump.



Originally, I had bought a chilli plant but it unfortunately died due to lack of sunlight. I then bought a hydroponically-grown basil plant but it also died due to lack of sunlight. I also bought an unknown flower plant but it also died due to lack of water. Seems like I don’t have green fingers.

With all the 3 plants died, I bought a spring onion that was meant for cooking for $1.10 . Since it was meant for cooking, I placed it in the fridge to make it last longer until I need it on this saturday.

So far, I have left the spring onions for 24 hours with the pump turning on periodically and looks like it is working as well as it should.

As for the planting pot, I designed it myself using Autodesk Inventor and then 3D printed it on the Makerbot Replicator 2. The model with the STL file is available here:




For the plantation media, I used some small pebbles/rocks. I chose to use small rocks as they can retain water easily. Also, it filters out solid waste which be used by the plants for nutrients and gives out clean water for the fish.

Trying Out The New TI MSP430FR5969 LaunchPad

So one day I was reading about surfing the net on DIY stuff and I came across the TI LaunchPad. It looks interesting, and its cheap too. Programming wise, its using almost the same IDE as Arduino. So I told myself, why not give it a try?
I originally thought of buying the EXP430G2 board (USD 9.99), but there was a better deal. The EXP430FR5969 Eval board + LCD Boosterpack Bundle boasts more features than the latter. It has a 64kB FRAM,  a 0.1F supercapacitor for batteryless applications, includes a Sharp Low-Power 96×96 LCD with 2 capacitive touch sliders on it. The LCD itself costs USD 19.99 but the bundle only costs 29.99. Its definitely a good deal! Also, shipping by Fedex is free!
I also ordered some (3 actually) models of bare MSP430 ICs, 2 each, through TI’s sample program.
1. MSP430G2201IN14
2. MSP430G2111IN14
3. MSP430G2121IN14
The MSP430FR5969 bundle with the LCD comes in a large blue box while the G2 comes with its own smaller box.
Inside the G2’s box we find:
1. MSP-EXP430G2 LaunchPad
2. MSP430G2553 microcontroller
3. MSP430G2452 microcontroller
4. Mini-USB cable
5. Quick Start Guide
6. 32kHz external crystal
7. 2 TI Launchpad Stickers
8. 2 Female Headers
While the other box contains:
1. MSP-EXP430FR5969LP board
2. Micro-USB cable
3. SHARP96 Booster Pack with LCD and capacitive touch sliders
4.Quick Start Guide

This slideshow requires JavaScript.

8/6/14 (Edited and added content 15/6/14)
Since the G2 is for my lecturer, I didn’t cut open the anti-static bag so I didn’t get a chance to try its out-of-the-box example
I did however got to try the FR5969 with the LCD boosterpack.
Its preloaded with several demo applications:
1. Clock
2. FRAM speed
3. Battery Free
4. Active Mode
5. SliderBall Game
The first thing I tried was the SliderBall game(Kinda like pong). The capacitive touch sliders are used to control the paddle.The capacitive touch sliders weren’t that senstive, but it worked okay.
I also tried the battery free application. This app will make the FR5969 go into LPM(Low Power Mode) 3.5, which is one of the many low-power modes the microcontroller offers. It literally can last for more than 8 hours with the screen off in this mode. There is also another submenu, where there is an option called transfer data. It allows us to transfer the logged voltage readings of the supercapacitor from the FRAM to a PC via back-channel UART.
The FRAM speed application is to demo how fast writes on the FRAM can be (At around 7564kBps) and the endurance.
The active mode application allows us to measure power consumption of the MCU. The power consumed is dependent on 3 things: the code, data cache hit ratio and clock speed of the CPU. There are various options to allow us to change the operating frequency of the CPU and cache hit ratio.