Arduino / ATmega 328P fuse settings

Part of programming stand-alone ATmega chips is setting the fuse bytes, these are special settings that can be used to change how the ATmega chips operate.

Some of the things you can do by changing the value of the fuses include;

  • select different clock sources and change how fast the chip runs,
  • set the minimum voltage required before the chip works.
  • set whether or not a boot loader is used,
  • set how much memory is allocated to the boot loader,
  • disable reset.
  • disable serial programming
  • stop eeprom data being erased when uploading a new sketch.

There are many articles online but I could not find a single source that brought all the information together and fully explain what the fuses actually do.

It is important to remember that some of the fuse bits can be used to lock certain aspects of the chip and can potentially brick it (make it unusable). However, with a bit of care it is fairly straight forward to understand and use the fuse settings.

Disclaimer, I am relatively new to programming fuses and these are notes I wrote to help me remember things. The information is based on the data sheet for the ATmega chip, internet searches, and questions I asked on forums (especially the Arduino forum).

Continue reading

Arduino Nano as an ISP Programmer

05.12.2015 Updated the photos.
 

In a previous post I showed how to make your own Arduino on a breadboard. The next step is programming it.
 

Using an Arduino Nano to program a ATmega328P chip

ArduinoISP_001_1600

There are many guides online on how to use an Arduino to program a ATmega chip, two goods ones are:
Using an Arduino as an AVR ISP (In-System Programmer)
Nick Gammon’s guide

If you google “using Arduino as a programmer” you will find most of the results are for using an UNO, very few are for the Nano. One Nano guide I did find is at Lets Make Robots This explains how to set up the Nano but it does not clearly show how to program a stand alone Atmega chip.

Continue reading

Arduino on a breadboard

Breadboard Arduino / Stand Alone ATmega328P

Here is my Arduino on a breadboard. There are many online guides for creating a breadboard Arduino. All are basically the same and follow the same connections. Some use pre-programmed chips, others use blank chips. My intention was to use a new blank ATmega chip (no boot loader) and use an Arduino Nano as an ISP programmer.

ArduinoBreadboard_001_1200

Continue reading

12V to 5V / 6V

I have never been happy that my first version of the drop controller had 2 different power supplies; a 12 volt supply for the solenoid valves and a second 5 volt supply for the Arduino, so I looked for a way to share the 12 volt supply. After a short search I came across Derek Molloy’s video on Youtube. This describes making a 5 volt power supply from a mains adaptor.

PSU Circuit

Full video after the break

Continue reading

Keypads and Button Switches on the Arduino

Keypads used in the dropController
Digial keypad on the left. Analogue keypad on the right.

When I first started building the dropController and the camController I could not find suitable navigation keypads, the ones I did find were expensive or not really suitable, so I built my own. These were simple keypads and follow the normal wiring for press button switches. This means each of the push button switches is wired to a separate pin on the Arduino. This obviously means you need 5 pins. This was fine until I wanted to add extra solenoid valves and realized I didn’t have enough spare pins.

I starting looking for pre-made keypads again and came across the Keyes Keypad on Taobao. These are cheap and smaller than the keypads I made. They also use a single pin. These are analogue keypads that use a single analogue pin on the Arduino.

Continue reading

Solenoid breakout board V2

I am now starting to built a version 2 solenoid breakout board. While the first one works I have learnt a bit more about controlling the valves.

Here is the diagram from Fritzing.
MartynCurrey_SolenoidValve_V2

Added resistors in line with the diodes. The flyback diode may cause the the solenoid to release too slowly. Adding the resistor speeds up the current decay and causes the solenoid to release/close more quickly.
Using 12V 250mA solenoids with TIP121s, the resistor should not exceed 220 ohms.

Added a small bypass capacitor connected between the TIP121 emitters and the solenoid +ve terminals. The capacitor can be connected across the power in lines which is connected to the TIP121 emitters and the solenoid +V.

 

 

Breadboarding components

When building prototypes on breadboards I find it useful to have small pre-made components such as 3.5 stereo jack sockets configured to fit breadboards

3.5_Stereo_Connector_01

The 3.5 stereo socket is attached to a small piece of board and the connectors from the socket attached to pins that fit in to a breadboard.
Red is VCC, black is ground, and white is the centre channel or data

I also create mini boards that have more than one component
These have female or male headers and can be connected using standard breadboard wires
mini-board_connectors_01

Connect_CAM_01

Connecting a photo interrupter/optoisolator to an Arduino

In an early version of the camControl device (before the dropController) I used an interrupter/optoisolator to detect the water drops. The plan was to detect the water drop, wait a little bit and then activate the shutter.

There are various different kinds of photo interrupter, different shapes and different sizes but all do the same job.
Photo interrupter

A photo interrupter has a LED at one side (normally IR) and a photo transistor at the other. When the LED in emitting light the photo transistor allows a current to flow. Remove the light and the current stops.
Continue reading

Photographing Water Drops Using An Arduino Controller

I started creating a controller using a single Arduino Nano on a breadboard. Although it was very basic it worked fairly well. It allowed me to control a solenoid valve and trigger the camera shutter. I also added basic camera control and a timelapse function (intervalometer). This part worked well. I could set the frequency and the number of shots and the Arduino did the rest.

Initially had the Arduino controlling the solenoid and then triggering the shutter after a delay. I later added an interrupter sensor and a laser beam sensor to detect the water drop and activated the shutter based on a delay after the sensor was tripped. As the controller developed more the breadboard became very messy and this started to annoy me.

I separated the functions in to two units; a drop controller and a camera controller.

CamController

CamController

DropController

DropController

 

 

 

 

 

Photographing Water Drops: Second Go

I had another session photographing water drops. The idea is to create two drops slightly apart. The first drop hits the water, rebounds and creates a column and then the second drop collides with the column. Sounds a lot easier than it really is.

Here are some of the results.

Water Drop Water DropWater DropWater DropWater DropWater DropWater DropWater DropWater Drop

These are from plain water. Next step is to add washing detergent to the water in the bowl and add a thickening agent like guar gum to the drops.

 

 

First Proper Try At Water Drop Photography

I wanted to try taking water drop photos and see what worked and what didn’t. Overall the results were better than I expected but not as good has I had hoped. Lighting is not good but I knew this from the beginning and concentrated on the drops and the timings. Working on the lighting can de done later once I have the other things sorted out.

I noticed that I got different results even when using the same timings. All the below had exactly the same settings.
Same settings - different results

The only difference was the time between shots. I suspect that as you wait water in the bottom nozzle moved towards the exit hole and you get a cleaner drop. Couldn’t really tell and I may be completely wrong.

Here are some of the better shots

Water DropWater DropWater Drop

 

waterdrops01_04waterdrops01_05waterdrops01_06

Controlling a Solenoid Valve from an Arduino

There is now an updated and more detailed post. See Controlling a Solenoid Valve from an Arduino. Updated.

 
Using the Arduino to control the solenoid valve is simply a case of setting a pin high for the appropriate amount of time. There is, however, a caveat, the solenoid works at a different voltage to the Arduino and you cannot directly connect the two. In this case a TIP120 transistor is used as a bridge.

TIP120

The TIP120 allows a small dc voltage (from the Arduino) to switch a larger dc voltage (12V to the solenoid). It can be thought of as a switch, applying a current to  B allows current to flow between C to E.

Continue reading