Have been playing with this tonight on my Leonardo, and digging deeper into ArduboyTones (for the first time! )
ArduboyTones only uses the second speaker pin for volume boost, no ‘bi-tonal’ sound there.
So you won’t be missing out on any notes if you just use pin 5 for your line-level output.
Actually, not sure how that circuit above will react if both pins are fed into it, when they are in ‘volume boost’ differential-drive 10Vpp mode? Time to find that electrical engineer again…
OK - good to know.
I am hoping to play with this on the weekend. I will update with results.
So a bit more sciencing today and I have sound.
As you will see, when it isn’t actually playing sound I have some awesome white noise going on. Obviously, all my wiring is on top of each other which is probably not helping but I wonder if the Arduboy introduces sound itself?
I did not even have to change anything code-wise to get this going. Again, would any of the Arduboy library hacks people have mentioned help the issue? @uXe, @Mr.Blinky ?
Do you have a link to the little amplifier board you are using there?
OK, looks like that uses an LM386 - datasheet for LM386 says max 0.4V input voltage.
Would need to check what the voltage is coming out of that line-level circuit?
(I needed to get 0.3V from 5V for my NESRAM project, so I just added 333K of resistance in series - might be worth trying if you have enough resistors around?)
Right I can probably test that with the trusty old multimeter … I should have a few resistors lying around too!
I will give it a try and report back …
I tried with a 222K resistor as that is what I had but it didn’t improve things. I noticed that when I moved the amp away from the Leonardo, the humming was much less.
Hmmm… is this with just pin 5 connected directly to the amp input with the 222K in series? Bypassing the line level thing altogether? Do you have two that you could chain to make 444K?
I put the 222K resistor in series before the line level 2.2K one shown above. I could test directly to the amp input tomorrow. I do have two, so will try both resistors in line with the circuit below and then directly.
To step down the input voltage, you need to put a resistor in parallel with the 33nF capacitor, to form a voltage divider with it and the 2.2K resistor. Another 2.2K resistor will cut the voltage in half. Either that, or put a resistor divider after the 100uF capacitor for the audio jack.
I ended up with a simple voltage splitter using the 2.2K and 222K in series - and I am taking the small ‘half’ as input. There is still a lot of humming but its marginally better than before.
If I hold the input line, I can pick up radio signals (or maybe TV) !
None of this was intended when I made the Arduboy, I want you to know that.
None of what? The large screen, the NES controller or sound?
I was thinking of making a 10:1 enlargement of one. It would stand 85cm high by 55cm wide.
Just any of it, I know it’s just all Arduino but it’s cool to see everyone working together.
Missed the notification (Had too many of them) the hum sounds like it’s coming from power supply and gets amplified. I had a look at that audio board and found some referece schematic (I edited out a few bits that where hooked to the input):
The input signal goes directly into the 10K variable resistor. To see how much noise comes from the power supply you can put those two 220K resistors you have in parallel to form a 110K resistor and connect one end to 5V and the other to the audio input. Don’t connect anything else to the input.
If the hum is still as loud then you need to supply the board with a different power supply. If the hum is very little we can look at the audio source. What resistors and capacitors do you have lying around?
I went and bought a whole lot of different resistors in a pack … capacitors unfortunately not many, if any.
EDit: The amp is powered off the back of the Leonardo which in turn is powered by USB at the moment.
@uxe I am wondering if you should make a Leonardo compatible shield? The SCK and MOSI pins might be a little difficult but doable.
Definitely a possibility - that locks you into the Leonardo though, and most of the DIYers here seem to use Pro Micros instead? And once you start designing a shield, feature-creep becomes a hazard… and you end up inadvertently designing the console version of an Arduboy!
What I liked about having it self-contained is that it has a single, obvious application, and can just slot right into any existing Home-made Arduboy in place of the OLED! (and that it can be repurposed as a GameBoy VGA output, or used with a Raspberry Pi, or any other FPGA / VGA application someone might dream up)
Did you end up trying separate supplies for the amp / Leonardo? You could grab any other dev board you have around with an AC adaptor, and switch the jumper wires for amp power over to that board?