NDP6020P
Lots of options on eBay
NDP6020P
Lots of options on eBay
arad2456:
Thank you guys so much for your answers, I really learn from them. I added my modified PCB (I still didn't read the post you send about the measurement of Vcc, larryd, I am gonna do it now). The width of the tracks is now 1mm (isn't it's too much ?) and the clearance of the ground fill is 0.7mm. I also removed the FTDI holes.
Do get female headers to stick your Pro Mini in. Makes life a lot easier if for whatevr reason you want to replace it later. Especially when realising you forgot to solder the FTDI connector before placing the Pro Mini on the board. Same for the DF Player.
Etemenanki I had a lot of problems while making my experiments on the bread board, maybe it's because of the MOSFET ?
That's likely to give problems; a solderless breadboard itself is also a common source of problems due to poor connections. That doesn't make them less useful, just something to beware of.
wvmarle The leds and buttons will be mounted on a different PCB, that's why I just have the holes here on the right side. Both PCBs will be connected via wires when I mount them.
Hope you remember to also connect the ground somehow
I don't see a separate connection for that.
If the LEDs and buttons are on the same PCB, I'd probably make a single connector for that. Including power and ground supply that'd be like 10 or 11 pins. Just to reduce clutter.
It does feel odd that the pot for volume control is apparently on your main PCB while the control buttons are not. Instead of a pot you can consider two push buttons - one for volume up, one for volume down. After all you have only 30 distinct levels for volume.
Any button on any pin can wake up the Arduino, you have to set up pin change interrupts (pins 2 and 3 are the "external" interrupts, that's a different interrupt).
Are you saying I should add a pull down resistor between on the Rx pin of the DFPlayer ? wouldn't it ruin the signals the arduino sends ?
Yes - that is to repair what the Arduino sends. Now it can only pull the signal high through the diode, when the Arduino output goes low the diode blocks and the Rx pin on the DF Player is left floating.
Come to think of it this won't prevent phantom powering, as the Tx signal is idle high. For that you have to turn the diode around, and have a pull-up between the Rx pin and Vcc - the Vcc line that is switched of course. Now the Arduino Tx can pull low the Rx from the DF Player, and when the Arduino's Tx goes high (the diode blocks now), the resistor pulls high the Rx of the DF Player. When the power to the DF Player is switched off, the resistor stops working, and the high signal from the Arduino has no way of reaching the DF Player.
About mounting holes: I always just add one in each corner. If there's a pot in the middle it' may be a good idea to add one more over there as physical support, so you don't stress the PCB so much when turning the pot.
wvmarle:
... and no replacement suggestions given there or in the datasheet...
For P-channel mosfets the life is harder every day passing
... you can find some more modern alternatives, but usually in SMD packages ... there is still something in TO220, but not too much ... as example, IPP80P03P4L works very good til 3.3V (less good with lower VGS), and is a "optimos" type ... i mean, 7 milliohm at 4.5V of VGS and 80A of current are not too bad, for a pair of dollars ![]()
And is also available in IPAK case, a bit smaller, as IPI80P03P4L
wvmarle thank you much ![]()
Do get female headers to stick your Pro Mini in. Makes life a lot easier if for whatevr reason you want to replace it later. Especially when realising you forgot to solder the FTDI connector before placing the Pro Mini on the board. Same for the DF Player.
It is a very good idea, especially because I already lost 3 Arduino and 3 DFPLayers because I soldered them, ruined the board and now I can't desolder them. I am afraid to use female pins though because I am afraid that the box will fall down somehow and the Arduino would get disconnected. If that happens I have to open all of the case to connect it again. Do you have any idea how I can connect it while securing it stays there, even in case the box would get a hard hit ?
Hope you remember to also connect the ground somehow
I don't see a separate connection for that.
It is on the left bottom side of the Board. There's a text "GND Top" next to it
If the LEDs and buttons are on the same PCB, I'd probably make a single connector for that. Including power and ground supply that'd be like 10 or 11 pins. Just to reduce clutter.
I am controlling them straight from the GPIO pins (pins 2-4 for the buttons and 5-7 for the RGB led) so I don't need a power pin, but I do have one main GND line. Is that ok ?
It does feel odd that the pot for volume control is apparently on your main PCB while the control buttons are not. Instead of a pot you can consider two push buttons - one for volume up, one for volume down. After all you have only 30 distinct levels for volume.
I uploaded a picture of the design so you can see how it'll look at the end. The main PCB, the one I posted here, will be placed on the bottom inside the box while the second one with the buttons and RGB led (and another low battery led which I still didn't add to the PCBs) will be placed on top with some cover on it to hide it. The Potentiometer is too high if I place it from the top so it comes from the bottom. I am going to print that form, in the picture I wrote next to it "poti connection", and connect it through frictional connection to the Potentiometer so you can change the volume by putting your finger in that small hole and rotating it
I still didn't completely decide how it will look and it's just the first design, maybe I will change the volume control to button but at the moment I stay with it like this now.
Any button on any pin can wake up the Arduino, you have to set up pin change interrupts (pins 2 and 3 are the "external" interrupts, that's a different interrupt).
As you can see in the picture I have only two buttons at the top of the box because I planned to put the wakeUpButton and the startButton under the same pressing button. I know it's stupid and I am definitely going to check again why I decided to do it like this, I will experiment with it and write back here as soon as I find out
Yes - that is to repair what the Arduino sends. Now it can only pull the signal high through the diode, when the Arduino output goes low the diode blocks and the Rx pin on the DF Player is left floating.
Come to think of it this won't prevent phantom powering, as the Tx signal is idle high. For that you have to turn the diode around, and have a pull-up between the Rx pin and Vcc - the Vcc line that is switched of course. Now the Arduino Tx can pull low the Rx from the DF Player, and when the Arduino's Tx goes high (the diode blocks now), the resistor pulls high the Rx of the DF Player. When the power to the DF Player is switched off, the resistor stops working, and the high signal from the Arduino has no way of reaching the DF Player.
About mounting holes: I always just add one in each corner. If there's a pot in the middle it' may be a good idea to add one more over there as physical support, so you don't stress the PCB so much when turning the pot.
I think I got you. So the Arduino will send low signals instead of high signals, but because of the pull up resistor every signal which pulls the DFPlayer low will actually be translated as high. Just to be sure I also added an edited sketch, did I implement it correctly ?
About mounting holes: I always just add one in each corner. If there's a pot in the middle it' may be a good idea to add one more over there as physical support, so you don't stress the PCB so much when turning the pot.
In the last PCB I designed I glued it and it was horrible. I learned a lot from that ahahahah. I will add it at the end when the layout and all is completely ready
Thank you so much ![]()
I forgot to make holes for the leds in the PCB on the top, I hope it doesn't confuse anyone
Assume the potentiometer has wires, to aid in soldering, if there is room, make potentiometer pads large.
With "to aid in soldering" you meant that it will help me solder it after I place the PCB inside the box ? Because I first solder it and only then place it in the box, the sizes are not a problem, I measured it once with something similar. Or did you meant something else ?
If the pads are small in diameter, they can be easily damaged during soldering.
The bigger the diameter, the more resistant to solder damage (especially if you don’t solder that much).
You will find that off board wires do best when soldered to good sized pads; also, 26AWG stranded wires should work for this.
The rim of the potentiometer pads in post #14 are almost non existent.
If you already have pushbuttons, adding two to replace the potentiometer would be a really good idea!
Paul__B:
If you already have pushbuttons, adding two to replace the potentiometer would be a really good idea!
That works.
Using a potentiometer has the advantage of remembering the setting if that’s important ;).
larryd:
If the pads are small in diameter, they can be easily damaged during soldering.The bigger the diameter, the more resistant to solder damage (especially if you don’t solder that much).
You will find that off board wires do best when soldered to good sized pads; also, 26AWG stranded wires should work for this.
The rim of the potentiometer pads in post #14 are almost non existent.
Ok, I understand now, I will do that.
Paul__B:
If you already have pushbuttons, adding two to replace the potentiometer would be a really good idea!
May I ask you why ? from the user experience side I find Potentiometer way more comfortable and I will stick with it unless it's horrible. Why is it a really good idea to replace it ?
Thank you guys so much
Thanks
it looks way easier than I was thinking (although it always looks easy ahahah), I will definitely try that soon
A suggestion, if you want to exercise at no cost (almost no cost, except your time and a bit of electricity :D) ... get some old PCB with SMD parts, 1206 or 0805 sizes mainly (like, old cd-readers PCB, things to throw away from a PC lab, usually they always have some ... not too modern items, actual ones almost all have 0204 sizes, that are way too small for starting trials) ... then you can take off the components (an hot air gun, a clamp for hold the PCB without burn the hands, and some cardboard for slam the PCB on for detach the components with "gravity method" while heating them
)
You will end with an almost-clean PCB with SMD pads, and a decent number of components for soldering tests, without have to buy new ones (no matter then if you place the salvaged components back on the right places on PCB, you can place them where you want, after all it's just for soldering practice
)
This is a very good idea
I will definitely do that, it will be a good practice. Thank you ![]()
The new MOSFET arrived and it works perfect now, thank you guys so much
it actually makes problems now when I connect it with the capacitor so I just removed it.
I don't see the use of a wake up button; the other buttons can double as wake up. What does the Arduino have to do after pressing the wake up button, other than waking up?
I realized why I divided it into two buttons now. I am using the low power library which keeps all asleep beside pin 2 which is an interrupt. In order to keep the arduino awake I need to put pin 2 into LOW. If I am using the same pin also for other things, say, to play a file, then the Arduino will constantly start playing the file because the pin in on LOW. If I don't put it on LOW the Arduino goes back to sleep immediately after I press the button. Do you guys have any suggestions on how to solve it ?
This is the example of the low power sketch :
// **** INCLUDES *****
#include "LowPower.h"
// Use pin 2 as wake up pin
const int wakeUpPin = 2;
void wakeUp()
{
// Just a handler for the pin interrupt.
}
void setup()
{
// Configure wake up pin as input.
// This will consumes few uA of current.
pinMode(wakeUpPin, INPUT);
}
void loop()
{
// Allow wake up pin to trigger interrupt on low.
attachInterrupt(0, wakeUp, LOW);
// Enter power down state with ADC and BOD module disabled.
// Wake up when wake up pin is low.
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
// Disable external pin interrupt on wake up pin.
detachInterrupt(0);
// Do something here
// Example: Read sensor, data logging, data transmission.
}
Thank you thank you thank you
How about using detachInterrupt() under normal conditions, after a time out period then attachInterrupt() again.
A flag can be useful to control program flow too.
Sorry it took me a while to answer, I really didn't have time to play with it in the last couple of days. Thank you so much for your answer.
Where should I put the detachInterruppt () ? I tried to modify it a bit but it just comes back to sleep if I don't pull wakeUp pin low. The waking up part in the loop looks like that :
void wakeUp()
{
}
void loop() {
attachInterrupt(0, wakeUp, LOW);
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
detachInterrupt(0);
// wake up & start
if (!digitalRead (wakeUpPin && sleeping)) {
delay (50) ;
if (!digitalRead (wakeUpPin && sleeping )) {
digitalWrite (wakeUpPin, LOW) ;
digitalWrite (transistorPin, LOW);
sleeping = false ;
delay (50) ;
myDFPlayer.playFolder(1, 1); //Play file
delay (200) ;
}
}
//loop goes on
.
.
.
}
I tried to play a bit with the detachInterrupt () but I don't really know what I am doing. It would be really fantastic if I could somehow "cancel" this command :
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
so the arduino would stay awake without the need to pull wakeUpPin down, and then make this command active again when goToSleep () [which comes later when the file finished playing] is active. Where should I place the detachInterrupt () for that ?
Thank you so much, I really appreciate it
Ok, I write it here in case it will help someone in the future. I used a flag as larryd recommended :
// ISR
void wakeUp()
{
sleeping = false ;
}
and then at the beginning of my loop I put :
{
if (sleeping == true) {
attachInterrupt(0, wakeUp, LOW);
LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
detachInterrupt(0);
}
// rest of loop
And now when I press the wakeUpButton the Arduino wakes up, stay awake, and starts to play and I can still use the button (to play a different file for example).
wvmarle:
Come to think of it this won't prevent phantom powering, as the Tx signal is idle high. For that you have to turn the diode around, and have a pull-up between the Rx pin and Vcc - the Vcc line that is switched of course. Now the Arduino Tx can pull low the Rx from the DF Player, and when the Arduino's Tx goes high (the diode blocks now), the resistor pulls high the Rx of the DF Player. When the power to the DF Player is switched off, the resistor stops working, and the high signal from the Arduino has no way of reaching the DF Player.
I just want to understand something before I send the PCB to fabrication. What you say is working, of course it is, I also checked it with the electronics. But actually why is it working ? Isn't the voltage that arrives the Rx pin of the DFPlayer so low (because it goes through the 10K Ohm resistor first) that it shouldn't pass the threshold ? and then Rx will always stay low, independently from the Arduino ?
I don't know if I read it right but on the last page of the datasheet it says that VIH should be 0.7Vcc. I also don't even know if that's the quantity I need to check for that though.
I added my configuration again so you can see what I did.
Thank you so much, I really appreciate it ![]()
When next to no current flows there is little voltage drop across the 1k resistor.