Remote control

Store Forums Lumazoid General Discussion Remote control

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #8560
    Vadpol
    Participant

    Hi there!
    Just thought about adding of the IR sensor and portable IR control instead of pots and buttons. It might be handy especially during parties in order not to mess around to change the pattern or band with knobs and buttons. It will not make it more expensive as this set of universal IR control and sensor costs around 2-3 bucks at AliExpress for example. I belive that it will not require big effort to update schematics and code a little bit but will make the usage much more convenient. What do you think?

    #8563
    Michael
    Keymaster

    That is a good idea, and I have considered it. The problem is that the Lumazoid is 100% busy sampling the audio and then running the analysis and updating the display. I think that if you added the code to read the IR sensor, it would disrupt all of that. I have experience using IR sensor + remote on other projects, and the code requires precise timing and interrupts to determine the incoming IR code. I don’t think you could do that without disrupting the Lumazoid’s smooth function. Make sense?
    Definitely a good idea, though.

    #8568
    Vadpol
    Participant

    Hi Michael,

    Thanks for your quick response! I like what you are doing, that’s something I was always interested! I do realize the issue of real time calculations if capacity is limited… There are two ways to solve it I believe – to increase capacity (i.e. using of the more powerful processor – ARM Cortex core based f.i. or to make part of the calculations – FFT analysis – by hardware, a small MSGEQ7 chip could do it). But both will require more investment of course which is not in line with your initial intention, right? However every product has its consumer, maybe this is something for the future development 🙂
    Also in order to increase sensitivity the good idea might be to use a simple circuit based on cheap LM386 amplifier at the input of existing schematics after stereo signal joint. This will make the device more sensitive to the line input and – the most important – to the mic module you’ve indicated somewhere already. This will eliminate the necessity of wire connection and thus give a flexibility in installation at any corner of the room. If you are not against I will try to make a prototype of this based on your initial design and share the result with you. I hope that it might make the usage of the device more convenient as well – just trying to make it more customer friendly 🙂

    #8570
    Michael
    Keymaster

    Yes, by all means give it a try! In designing a product, it is important to keep the hardware as simple and cheap as possible. That is why I did not include an amplifier. The sensitivity control should allow you to turn up the sensitivity high enough for line-level input.

    #8692
    Vadpol
    Participant

    Hi Michael,

    First of all – all the best in the New 2017 Year! Merry XMas and Happy New Year! Sorry for being silent for a while, but in the meantime I’ve managed to make a through hole PCB design by using just of standard mockup type of it, no customs made yet. Therefore I made some electrical connections just by thin wires at its backside. Also I used LM386 preamp and put IR sensor TSOP3848 connected to D6 digital pin of AtMega328PU chip for the future developments (still think about it). Everything I put in the small plastic box with two potentiometeres and two buttons in front and two parallel LED outputs and audio in and out jacks at the rear. It works very good! The device started to be much more sound sensitive, also it has a small built-in electret mic with separate amplifier which is automatically connected to audio input when there is no plugged in audio signal. This makes it wireless from audio source and much more mobile therefore. I could send the pictures and video to your mail address if you want to. You’ve made a very good initial design, this is just an improvement and it works very fine!

    As for remote IR – I was thinking about processor load and came to conclusion that it is still might be possible to implement I believe. It could be just one additional check on the IR signal presence in the main loop which will not consume a lot of resource, the smallest size simple IR lib is still needed though. In case the received IR code matches the prescribed one (only pattern change is needed so far I think) just another small subroutine (void) should be there to select the pattern in a button push cycle – almost the same as in pattern button case. As soon as there is no IR signal checked the main loop should work as it is. This small check should not overload the main processor from real time FFT calculation. It could be easily checked I think. Hope that it might be interesting for you. Many thanks!

    #8695
    Michael
    Keymaster

    Hi Vadpol, I’m glad you reported back with your progress. Sounds like you’ve been having a lot of fun with it, so that’s great. Feel free to send pictures if you want.
    Regarding the IR signal: you are correct that checking for the last received IR code could be done once every time through the loop(), but the problem is that the processor needs to measure the IR pin on a constant basis to pick up all the changes in the voltage. IR sensors modulate a 38KHz frequency, so the receiver has to read the sensor pin thousands of times per second. The IR library does this by scheduling an interrupt service routine (ISR) to run at this high frequency and keep track of the voltages. So, this code does need to run all the time as an ISR, and that would interrupt the Lumazoid code thousands of times every second. It would interfere with the collection of analog samples and probably ruin the audio analysis.

    Bottom line, even if you ask for the last code infrequently, the microcontroller has to make many perfectly timed measurements to receive the signal.

    Here is a good description of how it works: https://learn.sparkfun.com/tutorials/ir-communication

    Keep having fun with your project though — you are making lots of good improvements!

    #8697
    Michael
    Keymaster

    Here is some more info about why reading an IR sensor and reading the audio at the same time is going to be a problem. The ISR code in an IR library will use a timer interrupt vector to run some code thousands of times per second:

    ISR(TIMER2_COMPA_vect){
    ...
    }

    This is the code that will run on a constant basis, interrupting the Lumazoid code. The TIMER2 interrupt vector has higher priority than the ADC (analog to digital conversion) interrupt, so it will preempt the ADC conversion. See the Lumazoid code ISR:

    ISR(ADC_vect) {
    ...
    }

    This is the code that runs 9000 times per second to sample the analog input. It must run with precise timing between samples or the frequency analysis will be wrong.
    But try it and see what happens!

    #9739
    Vadpol
    Participant

    Hi Michael,

    Finally I did a very straight forward solution for IR remote control of Lumazoid – just organized the IR part with additional ATTiny85 processor and TSOP4838 IR sensor. Two pins of ATTiny are programmed in a way to simulate buttons operation (HIGH/LOW state upon receiving of the certain code from IR control, fully programmable) and could be connected in parallel to original hardware buttons. There is a lot of such a code examples available, so quite easy to adapt for any type of remote control. Perhaps it doesn’t work for the setup tuning as soon as the knobs will not work with IR in this case (however it also could be programmed with other pins of ATTiny). However it is good enough to switch in between patterns and colors on the fly. This fully solved my problem as I have LED strip and Lumazoid PCB installed behind the ceiling canopy in the room. I also added an additional pattern of just warm white light (dimmable with the same buttons) which is used for conventional lighting scene in the room. This made a custom oriented solution in my case. Here is my IR pcb variant where OUT1 and OUT2 are PATTERN and COLOR button connections at main pcb.

    IR control for Lumazoid

    Thanks again for your great initial design!

    • This reply was modified 6 years, 4 months ago by Michael. Reason: trying to fix image link
    • This reply was modified 6 years, 4 months ago by Michael. Reason: trying to fix image link
    #9743
    Michael
    Keymaster

    Great job! I use a similar IR sensor on the Game Time Pro product and it is very easy to use.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.