kpower
Published © GPL3+

Use your Arduino and a X9C10x to control a 555 Timer

Use the X9C104 programmable potentiometer with an Arduino to control the frequency of square waves produced by a 555 timer.

IntermediateFull instructions provided1 hour2,459
Use your Arduino and a X9C10x to control a 555 Timer

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
555 Timers
555 Timers
×1
Resistor 1k ohm
Resistor 1k ohm
×1
Capacitor 100 nF
Capacitor 100 nF
×1
X9C104
Renesas X9C104
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Custom parts and enclosures

Results

Schematics

Schematic

Code

Arduino XC9XXX control code

Arduino
/*

Code used to control the frequency of a 555 timer circuit using the
X9C104 variable potentiometer. User inputs a value between 0 and 99 via the
serial monitor to set the value of the X9C104 and timer circuit frequency adjusts

FastX9CXXX library available at https://github.com/GitMoDu/FastX9CXXX

*/

#include <FastX9CXXX.h>

#define X9_CS_PIN 3  //X9CXXX CS connected to digital pin 3 of Arduino
#define X9_UD_PIN 4  //X9CXXX UD connected to digital pin 4 of Arduino
#define X9_INC_PIN 5  //X9CXXX INC connected to digital pin 5 of Arduino

#define STEP_DELAY_MILLIS 250

// Setup object to control X9C104
FastX9C104 Potentiometer(X9_CS_PIN, X9_UD_PIN, X9_INC_PIN);

uint8_t Step;
String incomingString;

void setup() {
	Serial.begin(9600);
	Serial.println("X9C104 Digital Potentiometer 555 Timer Control.");
  Serial.println();

	// Reset potentiometer to known position (Step = 0)
  // This conicides with max resistance in the circuit and minimum frequency
	Potentiometer.Reset();

	// Plot Header.
	Serial.println(F("Step\t  Result"));
}

void loop() {
	// Wait for User input via Serial Monitor
  if (Serial.available() > 0){
        //Read the incoming string
        incomingString = Serial.readString();
        //Convert to a integer
        Step = incomingString.toInt();
        //Set Potentiomter to step value
        Potentiometer.JumpToStep(Step);
	      
	     // Plot the result.
	     Serial.print(Step);
	     Serial.print('\t');
	     Serial.print("Nominal Resistance in KOhm: ");
       Serial.print((100 * Step / 99.0) ,DEC);
	     Serial.println();

	     delay(STEP_DELAY_MILLIS);    // wait for a bit for circuit to stabilize
  }
}

Credits

kpower

kpower

19 projects • 6 followers
Qualified Electrical Engineer with experience in software and hardware development

Comments