So as on the title I wanna use a 4 digit 7 segment display with 74HC595. The hardware side is OK. But the software is the problem.
I'm using Arduino Nano and I wanna to make a solar charge controller with Bluetooth(HC-05), That 7 segment display(which is common cathode), Attiny13 based remote and receiver(Or I will use a generic remote for Arduino), 2 P channel mosfets(IRF9540) with NPN driving transistor(2N3904), 100k and 22k voltage divider for solar input and battery input, buck converter for power the microcontroller and others, LM35 temp sensor and a lot. Here is a schematic with a scheme PDF below.
And also if there is problems with it; just say me.
Anyway; You know what; I'm new to this. And I only know some of them.
The problem is that I don't have a lot of time to figure out how to do this because I'm still 14 or 14.5 and I have a lot of exams.
Don't worry about grammar because I'm also not English.
I also don't wanna to throw this away because It cost me 30$ and I accidentally broke one that was in home. My mom said it's okay. But my father will eat me if he noticed that. (And if I made one I can say him it was a junk and I made one better than it).
So if the 7 segment thing doesn't work well how can I use a LCD with I2C module?
Here is a bit of code I wrote(based on another code; I will put them below) but not sure any line is correct.
I sent this because I'm using this pins.
Some codes I found while searching is also below.
ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)
Measure any DC voltage using Arduino
Getting Started with HC-05 Bluetooth Module & Arduino
Use an IR Remote Transmitter and Receiver with Arduino
7 Segment LED Displays 102 -- Using a Shift Register
Create a Bluetooth App and control the Arduino - YouTube
Thank You.
I'm using Arduino Nano and I wanna to make a solar charge controller with Bluetooth(HC-05), That 7 segment display(which is common cathode), Attiny13 based remote and receiver(Or I will use a generic remote for Arduino), 2 P channel mosfets(IRF9540) with NPN driving transistor(2N3904), 100k and 22k voltage divider for solar input and battery input, buck converter for power the microcontroller and others, LM35 temp sensor and a lot. Here is a schematic with a scheme PDF below.
And also if there is problems with it; just say me.

The problem is that I don't have a lot of time to figure out how to do this because I'm still 14 or 14.5 and I have a lot of exams.
Don't worry about grammar because I'm also not English.
I also don't wanna to throw this away because It cost me 30$ and I accidentally broke one that was in home. My mom said it's okay. But my father will eat me if he noticed that. (And if I made one I can say him it was a junk and I made one better than it).
So if the 7 segment thing doesn't work well how can I use a LCD with I2C module?
Here is a bit of code I wrote(based on another code; I will put them below) but not sure any line is correct.
I sent this because I'm using this pins.
Code:
// A0 - Voltage divider to measure solar panel voltage (Solar)
// A1 - Voltage divider to measure battery voltage (Battery)
// A2 - LM 35 Temperature Sensor IC
// A3 - 7 Segment Digit 3 (analogWrite funtion)
// A4 - 7 Segment Digit 4 (analogWrite funtion)
// A5 - Bluetooth En/Dis (Bluetooth ON/OFF)
// A6 - Push Button 1 (Options)
// A7 - Push Button 2 (Change (ON/OFF))
// D0- Bluetooth TX
// D1- Bluetooth RX
// D2 - PWM Output to control MOSFET Q1 (Charging MOSFET)
// D3 - Control Load MOSFET Q2 (Output MOSFET)
// D4 - 74HC595 DataPin
// D5 - Battery Red LED
// D6 - Battery Green LED
// D7 - 74HC595 LatchPin
// D8 - 74HC595 ClockPin
// D9 - Load Green Led
// D10- Solar Green LED
// D11- IR remote reciever
// D12- 7 segment digit1
// D13- 7 segment digit2
void setup() {
#include <Wire.h>
#define SOL_ADC A0 // Solar panel side voltage divider is connected to pin A0
#define BAT_ADC A1 // Battery side voltage divider is connected to pin A1
#define TEMP_ADC A2 // LM 35 Temperature is connected to pin A3
#define DIG3 A3
#define DIG4 A4
#define BL_CON A5
#define OPT A6
#define CHG A7
#define AVG_NUM 10 // number of iterations of the adc routine to average the adc readings
#define BAT_MIN 09.5 // minimum battery voltage for 12V system
#define BAT_MAX 15.0 // maximum battery voltage for 12V system
#define BULK_CH_SP 14.4 // bulk charge set point for sealed lead acid battery // flooded type set it to 14.6V
#define FLOAT_CH_SP 13.6 //float charge set point for lead acid battery
#define LVD 10.5 //Low voltage disconnect setting for a 12V system
#define PWM_PIN 2 // pin-3 is used to control the charging MOSFET //the default frequency is 490.20Hz
#define LOAD_PIN 3 // pin-2 is used to control the load
#define DISP_DS 4
#define BAT_RED_LED 5
#define BAT_GREEN_LED 6
#define DISP_STCP 7
#define DISP_SHCP 8
#define LOAD_GREEN_LED 9
#define SOL_GREEN_LED 10
#define IR_IN 11
#define DIG1 12
#define DIG2 13
}
void loop() {
// put your main code here, to run repeatedly:
}
ARDUINO SOLAR CHARGE CONTROLLER ( Version 2.0)
Measure any DC voltage using Arduino
Getting Started with HC-05 Bluetooth Module & Arduino
Use an IR Remote Transmitter and Receiver with Arduino
7 Segment LED Displays 102 -- Using a Shift Register
Create a Bluetooth App and control the Arduino - YouTube
Thank You.
Attachments
-
141.1 KB Views: 6
-
20.1 KB Views: 3