Battery third (temp) terminal as multipurpose analogue input - page 8 - Hotwire! Hardware Mods, Accessories and Insights - CHDK Forum

Battery third (temp) terminal as multipurpose analogue input

  • 199 Replies
  • 80066 Views
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #70 on: 21 / January / 2014, 16:46:10 »
Advertisements
But there is one thing. Until now when having the camera  to USB I switched it on and some autostart.lua ran. Know the camera stucks in the ALT-Mode, the autostart script does not run anymore. I suppose the camera is in the play mode?
I don't think it is to do with the lines you quoted.  That change is there for another reason.  I suspect you are running into an issue related to the third point in my previous emails : 
Quote
Finally,  shooting_set_playrec_mode() in core/shooting.c may not be right as the patch messes with get_usb_bit_physw().
I'll look at it tonight.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline srsa_4c

  • ******
  • 4451
Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #71 on: 21 / January / 2014, 18:20:34 »
In case GetAdChValue ever becomes part of CHDK, here's a little research:
It's available on all VxWorks and DryOS based cameras.
Its argument is int* on VxWorks and on the first few DryOS models (S5IS, SX100, ...).
On later DryOS cameras it's always int.
Of course, the ixus30 and 40 are exceptions, the argument is char* (yes, it expects a string).
On cameras without an external audio codec even the audio input (microphone) is accessible.
Fortunately, wrong channel numbers don't cause an assert.

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #72 on: 21 / January / 2014, 18:28:46 »
Ah yes,  i did not realize it really yet. There might be other ADs too!? What values may I have seen with the script waterwingz posted here? Just being curious.

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #73 on: 21 / January / 2014, 19:03:14 »
Finally,  shooting_set_playrec_mode() in core/shooting.c may not be right as the patch messes with get_usb_bit_physw().
Fixed and tested on my G10. Please try  the attached. 

If it now works,  I have the basis for a more generic patch.   From conversations with reyalp,  this will probably need to be enabled on a "per camera" basis (rather than try for something general that lets users pick A/D channels and that deals with the issues srsa_4c mentioned above automatically).
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #74 on: 22 / January / 2014, 03:12:06 »
Thank you very much. I'll try that today.

One question a little ot: The switch,  what would you recommend for positioning it? Should it be near the camera or doesn't it matter?

And furthermore: I'd like to keep the possibility to trigger the cams with slight delays,  so I'll use a 54-channel Arduino. I will have a lot of cables,  probably multicore.  Should I have a look at a good shielding or would you say the kind of signal is stable enough?
« Last Edit: 22 / January / 2014, 03:24:20 by Karmaschinken »

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #75 on: 22 / January / 2014, 08:46:45 »
Quote
One question a little ot: The switch,  what would you recommend for positioning it? Should it be near the camera or doesn't it matter?
It's highly unlikely that any significant amount of noise will be picked up by the cables, so it probably doesn't really matter.

Quote
And furthermore: I'd like to keep the possibility to trigger the cams with slight delays,  so I'll use a 54-channel Arduino.
Are you still planning to use individual supplys for the cameras? I presume if so, you will (or already have) connected the Grounds together?

Keep in mind that the ADC input has a 20Kohm(?) pull-up resistor that pulls it up to just over 3 volts. I'm not entirely sure what would happen if the input went up to 5 volts from the arduino, you might have to either make sure the arduino never pulled the output high (instead of setting a pin high, use pinMode() to set it to an input so it will be floating ie. effectively disconnected) or, safer, use a simple resistor voltage divider to reduce the voltage. You probably want to keep it below 2 volts if the camera is to think the battery is in the normal operating temperature (not that they really shut down or anything anyway)

I'd also imagine this could be done in code on the cameras, but probably take more work than just using an arduino.

Quote
Should I have a look at a good shielding or would you say the kind of signal is stable enough?
Also unlikely to be a problem, whatever's easiest/cheapest should suffice. However to be 100% certain you may want to test how well it works with one camera before buying several hundred meters of wire.


I haven't really been keeping up with this thread that much, how did you go about with modifying all 50 dummy batteries? Or are you going to make your own?

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #76 on: 22 / January / 2014, 09:01:39 »
Quote
One question a little ot: The switch,  what would you recommend for positioning it? Should it be near the camera or doesn't it matter?
It's highly unlikely that any significant amount of noise will be picked up by the cables, so it probably doesn't really matter.
That's going to depend a lot on what else is connected to his rig.  High power lamps?  Flash units?  Cheap switching power supplies?  Lots of things can throw EMI and cause problems if it gets coupled into the camera power.

If Karmaschinken want to move the switch some distance from the camera,  I'd recommend installing the resistor in the dummy battery and only moving the switch remotely. 
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #77 on: 22 / January / 2014, 09:50:26 »
Thanks for your mail.

I want to use the Arduino to trigger either MosFets or PhotoMos as switches, so the power that will trigger the shot and be fed to the sensor will not be provided from the Arduino itself but from the power supply directly. If you take the last electrical flow diagram and replace the switch with a Photomos, then this will be the setup I am thinking of.

This is my plan:

I have four 13-port hubs connected to a computer. The Arduino is also connected to this computer. From the Arduino I have four multicore cables with the same length as the hubs-cables to the computer. So directly nearby the hubs I was planning to have the Photomos switches soldered to a self-made board. Thus up to here I will have the 5 Volt from the Arduino. "Behind" this board I have the voltage from the power supply, each at a single cable connected to the dummies. The resistor could be in the dummy.

Have a look at the my childish diagram I attached  :) The green cable should be multicore...

Hope that this will work. What do you think?

Thanks a lot!


« Last Edit: 22 / January / 2014, 09:56:45 by Karmaschinken »


Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #78 on: 22 / January / 2014, 11:25:07 »
Oh now I see what you're trying to do. I probably should have read the rest of the thread before posting. Well if you're going to just be switching the inputs to ground (via a resistor) with the photomosfets, noise may be a problem unless as Waterwings said you put the resistors inside the dummy batteries, particularly the 10k one between the input and ground (assuming there is one there, I just found the diagrams you mentioned back on page 5, which diagram are you going to be using?). You may even want to consider a low-value parallel capacitor in the battery if you're not going to attach a grounding resistor (but you're better off with that resistor).

Have you considered putting the photomos switches inside the batteries? It may possibly work better though it would probably also take more time to build especially if they're surface-mount.

One thing to remember if you go with ordinary mosfets is that the source (on an N channel mosfet) will have to be connected straight to the battery ground to avoid grounding problems (as the arduino and camera's grounds aren't isolated due to the USB cables) so the resistor in your diagram will have to be 'above' the mosfet. Of course, the source pin should be wired straight to the arduino's ground and not just rely on the very long connection between all the USB cables and connections. Also, to prevent noise from interfering with the gate charge a low enough value (maybe 1k to 10k?) resistor should be connected between the gate and source pins.


Looks like the attached diagram should work but I'm still curious as to why you need even need to use photomos relays or mosfets to switch the ADC inputs, as the cameras aren't going to be isolated from each other anyway because of the USB cables.

Re: Battery third (temp) terminal as multipurpose analogue input
« Reply #79 on: 22 / January / 2014, 12:57:04 »
Thanks a lot for your mail. Well it is no problem to put mosfets or photomos or whatever into the dummies. As said I am have no knowledge of electronics when it comes to build my own stuff. All I have is patience and the will to learn.  So I would appreciate it very much if you could help me with advices.

So I could put resistors and mosphets or whatever if you propose it is the best way.

But what I don't understand at all is your question why I am using such at all.  I mean I have to have switches somewhere,  no?

If it gets too complicated I would also do without the 50 single channels to be able to delay the cameras.  Most important thing is they fire at the same time.

How would you do if you would build such setup? Thanks a lot!

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal