Arduino projects

Solar light controller based on Arduino development board

Solar light controller based on Arduino development board

This article mainly introduces a light sensing switch unit controlled by Arduino. Its main use is to control solar lights to turn on outdoors in darkness, but it can be used in many more applications. This guide will walk you through every aspect of the building process. This article has provided you with the code and schematics, so no prior knowledge of the Arduino unit is required. This project would be quite complicated to make without Arduino. This is a great example of how microcontrollers enable significantly less circuit complexity and less hardware trial and error.

Main features:

●Input voltage range: 7 to 18VDC

● Switching power: 3A

●Brightness range: variable, from very bright to dark

*Using relays can greatly increase switching current.

 

illustrate

The project consists of three main parts: Arduino unit, software and circuit.

The circuit consists of two parts: light induction and power switch. The light sensing section consists of a photoresistor R4, which is connected to R2 like a voltage divider. Since the resistance of a photoresistor changes with the amount of light shining on it, the voltage ratio of the voltage divider changes with the amount of light present. The voltage across this part of the circuit is 5 volts DC, provided by the Arduino board to J4 of the circuit. Therefore, a voltage divider divides the voltage between a maximum of 5 volts and a minimum of 0 volts. The Arduino senses this voltage on its “analog pin 0” which is connected to J3 on the circuit. This is called “analogRead” and it divides 0 to 5 volts by 1024 (10 bits or 2^10) so it can detect voltage changes as small as 0.0048 volts.

The power switch portion of the circuit is very simple; it uses NPN switching transistor Q1, which is digitally controlled by the Arduino board connected to the circuit via J2 via “Digital Pin 3”. It switches the negative side of the supply voltage from J1. J5 is for connecting a low voltage light or anywhere you want to turn it on and off.

I’ve provided two different PCB bottom copper designs, one with a ground plane and one without. I won’t cover the various parts of the Arduino, mainly because it’s already a well-documented unit. The picture of the top trace should make it pretty obvious how it’s connected. The main thing to note is the PWR SEL jumper between the USB and PWR connectors, which will need to be switched to EXT if USB power is not being used. If you don’t understand something, you can get more help from their homepage: http://arduino.cc/en/Guide/HomePage

 

The software code is located in a compressed folder called “Code.zip” and it works as follows:

Required parts list

● 1k resistor

● 10k resistor

● R4 photoresistor

● TIP122 Darlington transistor

[embeddoc url=”https://simplemetaldetector.com/wp-content/uploads/2023/12/Arduino_Solar_Day_Night_Switch.zip” download=”all”]

Back to top button